Questions about depth peeling

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Flynd
Gnoblar
Posts: 17
Joined: Wed Jan 21, 2015 11:21 am
Location: Strasbourg
Contact:

Questions about depth peeling

Post by Flynd »

Hi everyone,
I'm about to write a dual depth peeling to implement a good transparency system (http://www.jzy3d.org/documentation/DualDepthPeeling.pdf). I already have some knowledge in computer graphics (OpenGL, glsl) but I am quite a new user of the 3dOgre rendering engine.

I will try to do it using a compositor but I'm wondering if there is a way to manage an iterator through the passes (I need to render 1 pass per 2 peels).
As long as I didn't exactly know how many passes will be achieved (because I didn't know how many peels need to be blended in my scene == the deep of the transparency), is there a way to define a dynamic number of passes with a compositor script ?
Thank you for your help and answer,
If you have any other tips, ideas or advices, thank you for sharing. ;)

Edit : I left dual depth peeling for a simple depth peeling
Last edited by Flynd on Wed Mar 11, 2015 12:30 pm, edited 1 time in total.
User avatar
Flynd
Gnoblar
Posts: 17
Joined: Wed Jan 21, 2015 11:21 am
Location: Strasbourg
Contact:

Re: Questions about dual depth peeling

Post by Flynd »

Hi,
I'm still not sure about the way I have to take for this work.
When I was working with opengl, I used to manage FBO to write into different buffers with my shaders.
I can't find a similar way to do it with Ogre. How can I write in different color buffers with an unique shader, if I can't bind them with a FBO ?
In some tutorials, I found a "HardwarePixelBufferSharedPtr" used for RTT. Do I have to try it for my purpose ?
Thank you for your help !
User avatar
Flynd
Gnoblar
Posts: 17
Joined: Wed Jan 21, 2015 11:21 am
Location: Strasbourg
Contact:

Re: Questions about dual depth peeling

Post by Flynd »

Hi,
I have made some research in Ogre source code to find some examples where a glFragData is used in a shader. I have found nothing but a unused material for a MRT compositor. So, I guess there is no way to draw in other color buffers of a FBO and to reuse them with Ogre. :(
I will try to implement a simplier version of the depth peeling.
I will let you know if I encountered some other problems.
Thank you for reading.
User avatar
Flynd
Gnoblar
Posts: 17
Joined: Wed Jan 21, 2015 11:21 am
Location: Strasbourg
Contact:

Re: Questions about dual depth peeling

Post by Flynd »

Hi,
I have finish a first version of depth peeling, using texture 's GBuffers and a compositor but I still have some questions :
  • Is there a way to use "depth" of/in a compositor texture (using gl_FragDepth in glsl, maybe) ?
    For now, I need 5 RGBA color buffers for my render target, that is pretty heavy :

    Code: Select all

    texture mrt_output target_width target_height PF_FLOAT32_RGBA PF_FLOAT32_RGBA PF_FLOAT32_RGBA PF_FLOAT32_RGBA PF_FLOAT32_RGBA chain_scope
  • I have some artefacts (little square with a bad grey color). I suppose they are coming from utilisation of GBuffer. Do you know some tricks to reduce them ? I have better results augmenting texture resolution (target_height_scale and target_width_scale) but this kind of solution is always more heavy...
Image
You can see multiple depth passes
(I'm using Ghadamon)
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: Questions about depth peeling

Post by dark_sylinc »

Just to be sure... are you aware that depth peeling is an extremely slow technique, right?
May be you're looking into the experience, then that's fine.

But if you want better correctness and/or better performance, transparency via linked lists is far a superior alternative (link 1, link 2).

If you're just looking into performance, Weighted Blended Order-Independent Transparency is a nice fake (link 1, link 2, link 3)

Cheers
Matias
User avatar
Flynd
Gnoblar
Posts: 17
Joined: Wed Jan 21, 2015 11:21 am
Location: Strasbourg
Contact:

Re: Questions about depth peeling

Post by Flynd »

Yes, I'm aware that depth peeling is a depreciated technique. In fact, I would like to make a comparaison between VTK (wich uses a depthpeeling in a fixed-function rendering pipeline) and Ogre.
My first intention was to use advanced order independent transparency but atomic counter aren't supported in Ghadamon.
Weighted Blended Order-Independent Transparency will be my next step, always in Ghadamon.
After that, I will try to implement the Intel adaptive transparency technique in the highest Ogre version (using, I guess, atomic counter and other advanced technologies).
Thank you for your answer !
Post Reply