sergi.gonzalez
Newcomer
Hi,
I'm implementing a multilayered clouds system and I am having integration problems because of clipping issues.
My idea is to render an infinite cloud plane for each cloud layer. The layers should be rendered fully behind of the main scene.
In order to achieve this, I would like to raster all pixels of the clouds plane using Zscreen = 1. I make the following steps:
1 Clear color buffer
2 Render main scene using near and far 0.1 and 4000
3 Render sky dome with Zscreen = 1.0 (using vertex shader trick Z = W), zwrite off
4 For each cloud layer
4.1 Render a plane (1 quad of 10.000x10.000 centered arround the eye point) using skydome trick
I've been searching methods to cheat Z buffer values and I've found the following methods:
1. change scene depth range (0.1 - 10000): it works but zbuffer artifacts in the main scene are noticeable
2. vertex shader trick (Z = W): it works with skydome but it doesn't work with cloud plane
3. change viewport depth range [1,1]: same problem as 2
4. write z in pixel shader: it works but it is very expensive and it works only with SM3 cards
I could also try to tesselate the plane in order to minimize artifacts, but I would prefer to use a smarter method.
Any idea?
Cheers,
s.
I'm implementing a multilayered clouds system and I am having integration problems because of clipping issues.
My idea is to render an infinite cloud plane for each cloud layer. The layers should be rendered fully behind of the main scene.
In order to achieve this, I would like to raster all pixels of the clouds plane using Zscreen = 1. I make the following steps:
1 Clear color buffer
2 Render main scene using near and far 0.1 and 4000
3 Render sky dome with Zscreen = 1.0 (using vertex shader trick Z = W), zwrite off
4 For each cloud layer
4.1 Render a plane (1 quad of 10.000x10.000 centered arround the eye point) using skydome trick
I've been searching methods to cheat Z buffer values and I've found the following methods:
1. change scene depth range (0.1 - 10000): it works but zbuffer artifacts in the main scene are noticeable
2. vertex shader trick (Z = W): it works with skydome but it doesn't work with cloud plane
3. change viewport depth range [1,1]: same problem as 2
4. write z in pixel shader: it works but it is very expensive and it works only with SM3 cards
I could also try to tesselate the plane in order to minimize artifacts, but I would prefer to use a smarter method.
Any idea?
Cheers,
s.