Jump to content

Model->SetViewRange() causes crash!


Scott Richmond
 Share

Recommended Posts

I don't see any change in the entity cull time using a group with all the entities in it. Am I doing something wrong here?

 

 

I get 25-29ms entity cull time with and without a group. Am I doing something wrong here?

       TGroup boksit = CreateGroup();

       TEntity boxarr[100][100] = {NULL};
       TEntity box = CreateCube();
       PaintEntity(box,LoadMaterial("abstract::concrete.mat"));
       ScaleEntity(box, Vec3(0.85));

       for(int x=0;x<=99;x++){
           for(int y=0;y<=99;y++){
               boxarr[x][y] = CopyEntity(box);
               SetEntityGroup(boxarr[x][y], boksit);
               PositionEntity(boxarr[x][y], Vec3(x-50,0,y-50));
           }
       }

Core i5-750 - GTX 460 1GB - 12GB DDR3 - Win 7 x64

Link to comment
Share on other sites

That's not a supported command, don't ever use that.

 

I also have the problem with high entity cull times. My projects tend to generate large world from 3d "tiles". When the tile count rises to tens of thousands there is a huge drop in performance due to the entity culling.

What other behavior did you expect?

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

I don't know.. maybe something to group the entity cull checks with. Of the total draw time of my scenes entity culling is always 95% - 99%.

 

This is also a problem with models that are made of many smaller meshes, so you always have to collapse the models to one big mesh before taking them out of the 3D modelling software.

 

All in all it's really the biggest pain I've had to deal with in Leadwerks.

Core i5-750 - GTX 460 1GB - 12GB DDR3 - Win 7 x64

Link to comment
Share on other sites

The entities get stored in an octree which discards large amounts of entities at a time. You can't expect to have tens of thousands of entities rendering at a good framerate, unless they are placed in the vegetation system.

 

This is also a problem with models that are made of many smaller meshes, so you always have to collapse the models to one big mesh before taking them out of the 3D modelling software.

That's just the way computer graphics work. Any other engine will have similar results.

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

Josh - vegetation system? I would like to hear more about that if you would. I'm guessing its a shader?

can I also confirm that you meant cull groups are unsupported?

 

Kazaar - your cull group code isn't helping because you need to put your tiles into multiple large groups, not just one. Assuming its supported.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

he meant that CreateGroup(), SetEntityGroup(), and anything related to Groups have been removed when he implemented octree hierarchy back in 2.32... the commands might still exist in the dll, but they no longer do anything...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Ah I see. That's really unfortunate as it would work well in this specific use case. Looks like hide and unhide might work best. Unless we can make use of the vegetation system somehow.

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

You should not need to manually cull anything. If you scene is slow, you need to think about cutting it down. The engine can handle an enormous amount of geometry, so I think you must be causing some extreme inefficiency in your scene. I can't say more without seeing a scene file.

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

You're assuming we're using a scene file. For the project that pertains to this issue, I'm procedurally generating terrains during runtime. The 'map' is made up of a huge amount of models. The polygon count isn't the problem, its the occlusion culling that causes the problem as more and more models are introduced as the player traverses the map.

I've managed to optimize the OC octree by tweaking the CLOSE, NEAR, FAR (or whatever they are) groups ranges on the camera which seems to do ok, but I think more could be done. The code in this thread above plays with that.

 

I'm wondering out loud here - Would parenting groups of models help? Does OC ignore parent-child relationships or does it only check the parent model?

 

How does the vegetation rendering work?

Programmer, Modeller

Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64

Visual Studio 2008 | Photoshop CS3 | Maya 2009

Website: http://srichnet.info

Link to comment
Share on other sites

I thought of parent all objects too, it should theoretically only cull the parent entity. But it won't make things necessary faster, if your drawing time is bigger than your culling time.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...