Original Post
Hi, I am currently implementing point light shadow mapping. I have so far successfully implemented 2 ways to do it: - Single pass cube map rendering using geometry shader (my 1st implementation) - Multi pass rendering (my 2nd implementation) I have implemented the second one because it allows me to do culling per cube face. I am seeing great improvements with this method and I want to try to optimize it. I am trying to minimise render target changes. With the first method, only one change per light (worst case). In the second method, 6 changes (worst case, could be less if culling returned no object for a face). So my idea would be to set the 6 render targets at once (just like the first method) and using an effect parameter, select the appropriate render target to write to. I could not do it with SV_TARGETn (because this is static, you need to know at compilation time to which target you'll be writing to). I also tried a if ( face==N ) output.colorN = ...; but I don't like the 6 if cases. I would need something in the pixel shader like output.color[ face ] = ...; where face is an effect variable set just before pass.apply() Is this possible?