I need to render the depth twice in one of my effects, and I dunno if I could do it faster using 2 RenderTargets with MRT to render my geometry with one pass only.
Is it possible to set the culling method inside the vertexshader ?
CullMode = CCW;
Is only valid inside a technique definition.
Do I need to check each normal against the view vector, etc. AKA remaking the culling algorithm in my vertex shader as the only solution to do a single geometry pass ?
If anyone has any advice, he is welcome
impossible with a zbuffer as far as i know
Hum… Bad news
Is it possible to draw all the faces without culling, and getting the depths this way ? ie: if I use culling.none, Can I obtain the depth of the front face and the one behind it ? Or will the graphics card only keep the one concerned by the depth comparison function ?
The thing is you don’t know what will be drawn first, the front or the backside, therefore you can’t work with a depth buffer because maybe your backside triangles are overwritten already
I just want the distance between the two depths. The nearest depth is already given when I generate the GBuffer.
Or could I use the stencil to increment a value each time a pixel is drawn (ie is overwritten by a front or backface) so I can sort of know how opaque an object is.
It is a transmitance effect, but I want to avoid rendering the scene 2 times which is a bottleneck with a lot of items (like grass, trees, etc).