|
Re: What are you working on?
[Re: HeelX]
#422240
05/06/13 09:05
05/06/13 09:05
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
HeelX, what are you trying to do there with the depth? There has to be some way (maybe vendor specific?) to render the depth into a special depth texture and use it in a shader, as that is what everyone uses for shadow mapping. In newer graphics APIs you can even use such a depth texture as a depth buffer in another rendering pass. Also, at least somewhen in the past, gamestudio sorted its objects from front to back, to reduce overdraw to a minimum, so even in a worst case scenario, a z prepass might not be as effective as one would expect. The easiest way for a depth prepass would be, to write a shader just transforming the vertices and the fragment shader setting a single color (with clip or alphatesting, for alphatested textures), the render stage would be set in a way that no color are writte, for example in your shaders technique definition, you could set some flags. And then before rendering again, you just don´t clear the depth buffer.
|
|
|
Re: What are you working on?
[Re: Slin]
#422274
05/06/13 19:40
05/06/13 19:40
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
what are you trying to do there with the depth? I wanted to clip pixels for which the depth is below the previously sampled depth to avoid complex light calculations. But I wasn't able to measure a significant performance boost. I guess this is due to the fact that I sort most of my geometry into the solid pass already, I guess.
|
|
|
Re: What are you working on?
[Re: Dico]
#422336
05/07/13 16:30
05/07/13 16:30
|
Joined: Feb 2012
Posts: 371
Dico
Senior Member
|
Senior Member
Joined: Feb 2012
Posts: 371
|
|
|
|
|