Sign in to follow this  
chrisendymion

Texture2D from volumetrics effects, missing depth

Recommended Posts

chrisendymion    411
Hello ;)
 
For my little graphical engine, I'm trying to add some volumetrics effects (like clouds). 
For that, I filled all the viewing frustum with a 3D Texture (with 128 slices at low res).
Noise is applied on every slice and a final pass is used for compute all the slices into one texture 2D.
The final texture is applied on top of the scene (full screen quad) with alpha blending.
 
Volumetric clouds are working very well ! I'm happy for that ;)
 
But now, I have an another problem. As the final texture 2d didn't have depth informations, my clouds are overlapping the world.
Don't know how to say (and my english is bad). Imagine far away clouds, but close mountains appear behind the clouds (must be inversed).
Some clouds need to be between mountains and camera, and some other, behind mountains, depending on their distances.
I tested with a depth map (from camera) of the world, used when the noise is applied, but cannot get it to works.. 
 
Any idea how to achieve this or the depth map is my only solution ?
 
I'm working with DirectX 11 (C++).
 
Thank you and a happy new year !
 
Chris
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this