VeTaL Posted April 19, 2010 Share Posted April 19, 2010 I crated crash-test for meshes: for (int i=-20; i<20; i+=1) { for (int j=-20; j<20; j+=1) PositionEntity(CreateCube(), Vec3(i*2,0,j*2)); } So, there is 40 * 40 = 1600 cubes. How can i sure that instancing is used? PS: In engine log i have "GPU instancing supported: 1", so video supports instancing. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Canardia Posted April 19, 2010 Share Posted April 19, 2010 Instancing is used when you use CopyEntity(). Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
VeTaL Posted April 19, 2010 Author Share Posted April 19, 2010 TEntity cube = CreateCube(); TMaterial mat = LoadMaterial("wall1.mat"); for (int i=0; i<100; i+=1) { for (int j=0; j<100; j+=1) { cube = CopyEntity(cube); PositionEntity(cube, Vec3(i*2,0,j*2)); PaintEntity(cube, mat); } } *fap-fap* xD wow, almost no FPS drops in this case... looking really great. This is instancing in editor, right? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Masterxilo Posted April 19, 2010 Share Posted April 19, 2010 Yes. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
VeTaL Posted April 19, 2010 Author Share Posted April 19, 2010 Thanks, great. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Gandi Posted April 21, 2010 Share Posted April 21, 2010 what happens if i got an instanced model and change the bone-position on one of them? would all the models have the bone changed?? Quote Link to comment Share on other sites More sharing options...
Masterxilo Posted April 21, 2010 Share Posted April 21, 2010 No. Every model instance has unique child/bones positions/animation state. They just share the same material and are all drawn at once. Quote Hurricane-Eye Entertainment - Site, blog. Link to comment Share on other sites More sharing options...
paramecij Posted April 24, 2010 Share Posted April 24, 2010 is there a way not to make instances in the editor? (i tried to give each models sub-mesh it's own material in code - no go Quote Link to comment Share on other sites More sharing options...
Josh Posted April 25, 2010 Share Posted April 25, 2010 No, but it is possible to write a shader that chooses a skin to show on a single instance. Put two or four textures in one texture, then store a "skin" key value that gets stored in the instance color, which the shader uses to choose a skin. There is an example of this somewhere on the forum. 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...
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.