I wanted to render some robots with a shadow map applied for self shadowing. I thought I’d create a nice big texture and reuse it to create a shadow for each character.
This kills the frame rate. Even if I don’t actually render anything to the texture, the cost of switching contexts in killer (on a GF4Ti anyway).
Is switching contexts just a really expensive thing and if I want it to work I can really only draw one shadow map for the entire scene instead of one per character?
Context switches shouldn’t be overly expensive. Switch times should be insignificant compared to time it takes to render to the texture. If not, then you’ll have to push nVidia to speed things up I suppose.
You’re using ARB_Render_texture, yes (along with the other assiciated extensions)? It is known that nVidia’s implementation of this extension isn’t terribly well optimized. Some have speculated that an internal texture copy operation is involved.