TomF's Blog

Started by
2 comments, last by laeuchli 16 years, 1 month ago
Dear All(Esp TomF if he's browsing these boards again ;-)), I was just reading Tom's informative post on renderstate cost changes. Tom writes that one should "order by render targets". I took this to mean use the least number of targets, and dont render to one, switch to another, then switch back to rendering in the first(although this seems fairly common sense, and I dont see how one could get into that situation). Is this the correct reading, or is something more implied here? Regards, Jesse
Advertisement
What he meant if he's you're rendering object A, B, C and you have say one rendertarget d for reflection and one rendertarget e for regular rendering and you need to have A, B and C visible on both then you do :

setRendertarget d (1)
render A
render B
render C
setRendertarget e (2)
render A
render B
render C


and you don't do :
setRendertarget d (1)
render A
setRendertarget e (2)
render A
render B
setRendertarget d (3)
render B
render C
setRendertarget e (4)
render C

even if both render of A share some renderstates. Because switching targets is considered the most costly of renderstates.

Then inside one rendertarget you sort by the other renderstates.. (and by depth, and by opacity etc..)

LeGreg
LeGreg has it exactly.
Cool, thanks :D
Jesse

This topic is closed to new replies.

Advertisement