Game Producer Posted October 7, 2011 Share Posted October 7, 2011 I tried mesh=LoadMesh and then 40x copyEntity(mesh), but the FPS numbers are the same if I just use 40x mesh=LoadMesh My gfx card has instancing supported. Does it work with animated/material-painted meshes? Leadwerks Engine 2.5 Initializing Renderer... OpenGL Version: 4.1.0 GLSL Version: 4.10 NVIDIA via Cg compiler Render device: GeForce GTS 450/PCI/SSE2 Vendor: NVIDIA Corporation DrawBuffers2 supported: 1 32 texture units supported. GPU instancing supported: 1 Max batch size: 64 Shader model 4.0 supported: 1 Conditional render supported: 0 Quote Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48 game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine Twitter - Unfollow me Link to comment Share on other sites More sharing options...
Josh Posted October 7, 2011 Share Posted October 7, 2011 The engine automatically instances meshes when you load a file from the same path. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 7, 2011 Share Posted October 7, 2011 CopyEntity() will instance CreateXXX() commands. ie. CreateCube(). If you do 10k CreateCube() they won't be instanced. If you do 1 CreateCube() and CopyEnity() on it 10K they will be. If you LoadModel() 10K times on the same model it'll instance it because it knows it already has it loaded. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 7, 2011 Share Posted October 7, 2011 FYI, in Leadwerks3D you can do this with all assets to load a new copy: Model* model = LoadModel("mymodel.mdl",LOAD_UNIQUE); Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
paramecij Posted October 7, 2011 Share Posted October 7, 2011 FYI, in Leadwerks3D you can do this with all assets to load a new copy: Model* model = LoadModel("mymodel.mdl",LOAD_UNIQUE); Thank you very much, I have some duplicated files now to get around this.. Quote Link to comment Share on other sites More sharing options...
Flexman Posted October 8, 2011 Share Posted October 8, 2011 Currently I have the need to use the same geometry but different skins. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Game Producer Posted October 8, 2011 Author Share Posted October 8, 2011 The engine automatically instances meshes when you load a file from the same path. Ok. There goes my fancy caching tool then xD CopyEntity() will instance CreateXXX() commands. ie. CreateCube(). If you do 10k CreateCube() they won't be instanced. If you do 1 CreateCube() and CopyEnity() on it 10K they will be. If you LoadModel() 10K times on the same model it'll instance it because it knows it already has it loaded. Roger that. FYI, in Leadwerks3D you can do this with all assets to load a new copy: Model* model = LoadModel("mymodel.mdl",LOAD_UNIQUE); Good to know, this is excellent addition and will help creater much lower file size (earlier I had to create several copies of my 10 meg humongous character file) Currently I have the need to use the same geometry but different skins. You instanced your reply, I see it duplicated! Quote Intel Dual Core 3GHz / GeForce GTS 450 - 1024 MB / Driver ver 267.59 / 8 GB RAM / Win 7 - 64 bit / LE2.50 / BMAX 1.48 game producer blog - Dead Wake Zombie Game powered by Leadwerks Engine Twitter - Unfollow me Link to comment Share on other sites More sharing options...
Flexman Posted October 8, 2011 Share Posted October 8, 2011 Dunno how that happened. I deleted the instance leaving the original intact. However your message still contains a reference to it therefore the forum is now unstable and could crash at any moment. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Rick Posted October 8, 2011 Share Posted October 8, 2011 Currently I have the need to use the same geometry but different skins. Flexman have you ever seen this thread and shader? http://www.leadwerks.com/werkspace/topic/607-non-instancing-copy-command/page__p__5296__hl__instancing__fromsearch__1#entry5296 Bottom of 2nd page he has the shader file. It lets you have a giant texture that stores all the different skins and you control which section of this giant texture to use from the alpha value of SetColor I believe it is. His video that he links to seems to no longer be online but in the thread he should write the usage I think. Quote Link to comment Share on other sites More sharing options...
Flexman Posted October 8, 2011 Share Posted October 8, 2011 Flexman have you ever seen this thread and shader? http://www.leadwerks.com/werkspace/topic/607-non-instancing-copy-command/page__p__5296__hl__instancing__fromsearch__1#entry5296 Bottom of 2nd page he has the shader file. It lets you have a giant texture that stores all the different skins and you control which section of this giant texture to use from the alpha value of SetColor I believe it is. His video that he links to seems to no longer be online but in the thread he should write the usage I think. Thanks for that great link Rick. I thought about something like it, using the vert colour as an offset. I don't know how practical it might be for a helicopter with large textures but there might be something in it (a decal atlas or some such). Thanks again. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2011 Share Posted October 8, 2011 I'd use the entity red and green colors for the UV offset. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 8, 2011 Share Posted October 8, 2011 Then you should make a shader for us that does that Quote Link to comment Share on other sites More sharing options...
paramecij Posted October 8, 2011 Share Posted October 8, 2011 Then you should make a shader for us that does that I think he already did. Check out the switch model that came with the SDK, namely switch.frag and switch.lua Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.