I would like to render to depth texture and color texture at the same time (MRT), problem is I would like to apply additive blending for color texture which means I need to disable Z writing, in result depth map is clear.
Now I found GL_EXT_draw_buffers2 extension which allows to allpy different blending states per each render target, is there possibility to do the same for depth states somehow ?
I don’t think so, what goona happen with my depth map if I disable z-test ? No, I need proper z values in depth map, I need z-test and z-write enabled for depth map render target and z-write disabled for color map render target. Is it possible ?
I think you assumes I am drawing sorted geometry, it is not the case. I am drawing not sorted point sprites and I want each fragment to be added in my color map so I must set z-mask to 0 or disable z-test, both of it spoils my depth map. As far as I remember blending is performed after depth test so if incoming fragment doesn’t pass it will not be added. Am I right ? At least my test says so.
I need it for depth map render target, for color map I need z-mask set to 0. I wondering is it possible to render it in one pass. I am getting some strange feeling I am repeating myself
So you want both depth test writing to depth buffer with only the nearest depth, AND AT THE SAME TIME no depth testing on the color buffer, as you have unsorted additive blended stuff.
Is that right ?
I am pretty sure that is not possible.
Do it in two passes.