Horde3D
http://horde3d.org/forums/

Depth sorting
http://horde3d.org/forums/viewtopic.php?f=2&t=436
Page 1 of 1

Author:  lachlanmcdowall [ 20.07.2008, 12:10 ]
Post subject:  Depth sorting

Could someone please confirm that when you specify order="BACK_TO_FRONT" in a DrawGeometry this means that the items will be rendered in the order of the furthest away from the camera to the closest to it.

If this is correct can someone please explain why I am getting square borders when rendering particles using this and with depth testing turned on.

I have included a screen shot to try and make it more obvious what I am talking about
http://lmcdowall.co.uk/dare/screen%20shot.JPG

The particle being used is the one included in the demo's and so does have an alpha channel I think

Author:  cantele [ 20.07.2008, 13:18 ]
Post subject:  Re: Depth sorting

I haven't tested depth sorting myself yet because I have another approach but:

Are you using a shader for the particles (actually, how could you not...)? What have you specified in the render configuration, in the shader file? You can specify different blending modes. These would affect how your rendered objects look like regardless of order, I guess... some of those is probably capable of producing square borders.

"blend function (Values: REPLACE, BLEND, ADD, ADD_BLENDED, MULT) (Default: REPLACE) {optional}"

Author:  lachlanmcdowall [ 20.07.2008, 20:40 ]
Post subject:  Re: Depth sorting

I'm using ADD_BLEND which produces the correct results when depth writing is off but obviously draws over everything so is less than ideal.

Author:  marciano [ 21.07.2008, 22:32 ]
Post subject:  Re: Depth sorting

Depth sorting is working on a per-node basis. Particles are not sorted, this would usually be rather slow.

Author:  DarkAngel [ 22.07.2008, 03:04 ]
Post subject:  Re: Depth sorting

lachlanmcdowall wrote:
I'm using ADD_BLEND which produces the correct results when depth writing is off but obviously draws over everything so is less than ideal.
Can depth-writes be disabled just for the particles (and not for everything else)?

Author:  lachlanmcdowall [ 22.07.2008, 10:10 ]
Post subject:  Re: Depth sorting

DarkAngel wrote:
lachlanmcdowall wrote:
I'm using ADD_BLEND which produces the correct results when depth writing is off but obviously draws over everything so is less than ideal.
Can depth-writes be disabled just for the particles (and not for everything else)?


Yes but doing this obviously cause's particles behind objects to be rendered over everything as no depth testing is carrier out

Author:  lachlanmcdowall [ 22.07.2008, 10:27 ]
Post subject:  Re: Depth sorting

marciano wrote:
Depth sorting is working on a per-node basis. Particles are not sorted, this would usually be rather slow.


can you suggest a method to allow the rendering of particles within a scene then, espeshally with the defered shaders

Author:  marciano [ 22.07.2008, 22:27 ]
Post subject:  Re: Depth sorting

lachlanmcdowall wrote:
marciano wrote:
Depth sorting is working on a per-node basis. Particles are not sorted, this would usually be rather slow.


can you suggest a method to allow the rendering of particles within a scene then, espeshally with the defered shaders

We can discuss this in your dedicated thread in the rendering technique section...

Author:  DarkAngel [ 23.07.2008, 04:58 ]
Post subject:  Re: Depth sorting

lachlanmcdowall wrote:
DarkAngel wrote:
lachlanmcdowall wrote:
I'm using ADD_BLEND which produces the correct results when depth writing is off but obviously draws over everything so is less than ideal.
Can depth-writes be disabled just for the particles (and not for everything else)?
Yes but doing this obviously cause's particles behind objects to be rendered over everything as no depth testing is carrier out
No, it shouldn't - not if testing is still enabled but writes are disabled.

First the scene is rendered with depth writes and depth testing enabled.
Now we have a valid depth buffer for the scene.
Then particles are rendered with depth testing on (so they don't appear in front of objects), but depth writes are disabled, so that they don't modify the existing depth-buffer data (and occlude each other).

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/