Jump to content

  • Log In with Google      Sign In   
  • Create Account


About MRT


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 FireInDark   Members   -  Reputation: 148

Like
0Likes
Like

Posted 05 August 2012 - 10:43 PM

Think about that ,in case MRT,we have two render target (All are textures ): texture A and texture B.
Now the first element has been rendered ,texture A save the image and texture B save other datas..

then wen need to render another element ,but here , I need the datas in texture B to juge if the right pixel should be wirte or not..and the same time ,I also need to write texture B in some case when rendering the second element;

Any way ?

if i just bind the texture B as the GL_TEXTURE1 or GL_TEXTURE2 or somthing..

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6939

Like
0Likes
Like

Posted 05 August 2012 - 11:19 PM

You render your scene in passes.
1. pass: render to A & B
2. pass: render to A only, but use B as source
3. pass ...

Then you need to assign your render materials to one or more render passes.

#3 FireInDark   Members   -  Reputation: 148

Like
0Likes
Like

Posted 05 August 2012 - 11:57 PM

Then you need to assign your render materials to one or more render passes.


Seems it the right way .But wouldn't it be slowly ?

If the elments are in a "Tree" it'll take many times to change the target ..

#4 Hodgman   Moderators   -  Reputation: 28587

Like
0Likes
Like

Posted 06 August 2012 - 12:35 AM

It's not uncommon for modern games to have at least half a dozen different passes+targets.

#5 Ashaman73   Crossbones+   -  Reputation: 6939

Like
0Likes
Like

Posted 06 August 2012 - 12:50 AM

If the elments are in a "Tree" it'll take many times to change the target ..

Here's a practical approach:
1. define your passes and for each pass your targets.
2. When rendering (walking through your scenegraph, tree whatever), you cull and group all renderable objects by material, don't render them yet.
3. Walk through your (ordered) passes and render all model groups which have a material which is assigned to the current pass.
4. Special handling for terrain,particles,decals etc. which are assigned to certain passes.

#6 FireInDark   Members   -  Reputation: 148

Like
0Likes
Like

Posted 06 August 2012 - 01:48 AM

Here's a practical approach:

Thank you very much ,I'll try it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS