Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Prozak

The Correct Rendering Order...

This topic is 5402 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, so to avoid "cache misses", or its equivelent in the GPU, what should the correct rendering order be? 1) Perform Occlusion Culling (Frustum, BSP, whatever) 2) Get distance of object from the viewer, so that LOD decisions can be made on Mesh & Texture 3) Sort Objects (starting from most important to least important): - by Shader - by Texture - Blend Mode (Opaque/ Transparent) - by Distance 4) Now render using Vertex Arrays/ Vertex Buffer Objects Ok, give your 2 cents about this order, about adding extensions to the order, etc... Jester Says: Visit Positronic Dreams!
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"I say we take off and nuke the entire site from orbit. It's the only way to be sure."
[edited by - pentium3id on February 29, 2004 7:02:27 PM]

Share this post


Link to post
Share on other sites
Advertisement
sort by transparent vs opaque first.

"sort by whatever results in the least number of DrawPrimitive calls." (I think somebody at Nvidia wrote this)

Share this post


Link to post
Share on other sites
It depends on many factors that differ depending on the scene you render.

Since your predicate is you have occlusion and LOD, your overdraw rate is close to one, your geometric resolution is quasi constant and your texel/pixel rate is constant too. I call that the homogeneization of the scene in projective space.

After that, what counts most is :
- minimize state changes
- minimize bandwidth

1) Z-Order
Can you draw everything :
1a) front to back ? (No special focus on non opaque object)
1b) back to front ?
1c) any order (since you already performed occlusion) (*)

2) Instance
Do you share many instances of :
2a) textures (like detail) (*)
2b) primitives (ex: a column) (*)

1a) favors z-buffer optimizations, but since you have occlusion...

1b) is the best for non totally opaque scenes.

1c) is the easiest way to favor 2a) and 2b)

2a) covers shaders, etc... the hierarchy you gave.



[edited by - Charles B on March 1, 2004 5:52:11 AM]

Share this post


Link to post
Share on other sites
if you can occlusion cull, then it is likely that you already
know the distance from the camera to the object. This variable
is likely to be inherent in the occlusion detection function, so
it would be wise to store the values and allow them to persist
down the pipeline and I suggest you investigate scene-graphs.


Edit 2: my 2 cents.

[edited by - ray_intellect on March 1, 2004 6:18:39 AM]

[edited by - ray_intellect on March 1, 2004 6:24:00 AM]

Share this post


Link to post
Share on other sites
Here''s what I''d do:

throw everything in a vector.
write functors that sort by different things
then profile your results

Share this post


Link to post
Share on other sites
ngill, that might work, but you run the risk of optimizing for your hardware, instead of optimizing for global hardware...

we''re looking for a global way to organize the rendering pipeline.

Jester Says: Visit Positronic Dreams!
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"I say we take off and nuke the entire site from orbit. It''s the only way to be sure."

Share this post


Link to post
Share on other sites
there is no such solution, pentium3i.

the only thing that will work is addapting software. runtime measure, and reorder logic till it performs best on a certain hw configuration.

or something like this..




If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

Share this post


Link to post
Share on other sites
Even if you did find a sorting order that worked well with different kind of hardware, it might not work well with different applications. Bottlenecks differ, sometimes you''re bandwidth or fill bound and want to avoid expensive framebuffer writes by rendering front to back, sometimes you''re limited by state changes and you want to batch better. It depends.

Todays magic word is "profile".

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!