Jump to content
  • Advertisement

Archived

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

davidino79

Shader System Recursion

This topic is 5360 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

I have readed Material/shader implementation thread many and many times,but I have a question: How can perform recursion? Yann says that certain render pass is recursive,this means that it call the MainRender function that perform the shader pass another one time (for example for reflective/refractive objects). But when I change the camera and perform the render to texture ,I should call the culling function another one time.So where is it the culling function in main render?Yann say that the function MainRender is called AFTER the culling process,when the render pipeline if filled ..so it seems there is no culling function,but if I call MainRender changin the camera,I should make the culling process. The same problem is present for shadow mapping shader and so on. Is there anyone that can help me? Thanks Davide

Share this post


Link to post
Share on other sites
Advertisement
The way to go about this is to somehow pass a function pointer into the shader which will fill a different pipeline for rendering again. So effectively the purpose of the shader that invokes the recursion is to create a new pipeline - query the scenegraph for objects to be rendered - performing any culling with the new camera position and then call the main render function. Of course you need to keep a depth counter for the number of times this occurs to avoid infinite recursion. So the culling process is part of the traversal of the scenegraph.

James

Share this post


Link to post
Share on other sites
quote:

The way to go about this is to somehow pass a function pointer into the shader which will fill a different pipeline for rendering again. So effectively the purpose of the shader that invokes the recursion is to create a new pipeline - query the scenegraph for objects to be rendered - performing any culling with the new camera position and then call the main render function.


Is this a good thing?that is, is it a good thing to break the rendering process and perform the culling process another one time (ad use,for example,the query to graphics card to perform the culling?)

Share this post


Link to post
Share on other sites
I''m not sure whether you''ll be able to use the hardware occlusion queries since the camera will be in a different place - you may find that you don''t need to even do occlusion culling - frustum culling may be enough esp. if you use a custom LOD scheme to reduce the complexity of the geometry. Perhaps a software occlusion culler would be faster? I don''t know, I only currently use frustum culling - not had time to implement an occlusion culler yet, nor have I complicated enough scenes to test it!

James

Share this post


Link to post
Share on other sites
It was only an example,the base question was if it is correct (or a it is a good think,ot whatever you want to say)to stall the rendering process to perform the culling.

Davide

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!