Independent clip() in Multiple Render Targets

Started by
4 comments, last by DJTN 11 years, 8 months ago
Hello,

a few days ago I introduced Multiple Render Targets (MRT) to my render.
In the previous implementation I used the clip() HLSL function to perform alpha testing in my pixel shader. The problem is that now, when using MRT I want to use the clip on the first render target but not on the other ones. If I use the clip function it clips not only the first render target but also the other ones.

Is there any way to specify which render targets should be clipped and which not? Or is there a way to specify "not drawing" as the return color of an specific render target?

I'm using DirectX9.

Thank you in advance,

David
Advertisement
If you're using a pixel shader, you can create another technique that doesn't use the clip funtion and use it for those RTs.

Rememeber that clip doesn't return anything for that pixel, nor does it write any information to the back buffer or depth buffer. On newer graphic cards it stops the execution entirely.
There's some tricks you could do in DX10/11 for this, but I don't know of any in DX9.

The only hack I can think of is:
If you can guarantee that you've got no overdraw (two triangles covering the same pixel), which you can if you're doing a z-pre-pass, then you can render with additive blending and output black when you don't want to write data.

There's some tricks you could do in DX10/11 for this, but I don't know of any in DX9.

The only hack I can think of is:
If you can guarantee that you've got no overdraw (two triangles covering the same pixel), which you can if you're doing a z-pre-pass, then you can render with additive blending and output black when you don't want to write data.


Yes, I had the same idea, but I'm not doing a z-pre-pass right now and I don't know if it would be too expensive. In any case, I'm pretty sure this solution would work, but I'll leave it as the last option :P


If you're using a pixel shader, you can create another technique that doesn't use the clip funtion and use it for those RTs.

Rememeber that clip doesn't return anything for that pixel, nor does it write any information to the back buffer or depth buffer. On newer graphic cards it stops the execution entirely.


That would work. But is it possible to use different techniques, for the different RT when using MRT?? If it is possible, could you give an example or a resource explaining how to do that? I've not been able to find any :S
You cannot have different effects (nor techniques (nor passes)) for the individual parts of the MRT, of course. Not even in DX11. Am I right?

That would work. But is it possible to use different techniques, for the different RT when using MRT?? If it is possible, could you give an example or a resource explaining how to do that? I've not been able to find any :S




You cannot have different effects (nor techniques (nor passes)) for the individual parts of the MRT, of course. Not even in DX11. Am I right?


I should have been more specific, when I said RT's... I meant "RT" not "MRT". This would require multiple passes for each RT (surface).

I assumed you knew that you cannot render MRT's with multiple effects, multiple techniques, different bit depth, different width, different height, etc... in dx9 with MRT's.

MRT (Multiple Render Targets) = one pass.
Multiple RT's (several separate Render Targets) = multiple passes.


I apologize if I confused anyone...

This topic is closed to new replies.

Advertisement