Re: Depth Data in the pixel shader



hmm not sure exactly what you mena by this.
I am ignoring refraction etc atm might look at it later we shall see.

There are two reasons I want this effect 1 is the water. While I
could darken the ground surfaces to make them all the same colour as
they get deeper underwater, the effect would have to be base on both
where the camera is as well as how deep underwater the land is.
Because if you are underwater (with a light source) thats going to
have an effect.
Of course I could just use normal fogging under water but then that
doesnt work if you are looking out of the water through the surface.

Basically I want the fogging to only occur while in the water or more
likely a fog bank.
A lot of games I have played fog in the distance so that you dont have
to render so far.

Not interested in that. My current project is actually on a spherical
surface so the horizon effect works quite well for that. But it does
complicate a lot of other stuff :P

But one of the thing i want is Fog as Fog. So that you can see a fog
bank at a distance not just becomming Foggy as you enter it from
nowhere. Now if you are looking through a section of the fog and it
is narrow you should be able to see out the other side with limited
fogging even though objects behind it are in the far distance.

So the effect Im trying to achieve has dual roles. I'll look into
shadow volumes and see what i can get there.

Thanks for your suggestions so far :)

On Thu, 29 Mar 2007 10:07:24 +0200, "Jan Bruns"
<testzugang_janbruns@xxxxxxxx> wrote:

But keep in mind that depth-buffers can't be used as texture-input
(treated as shadow-map for Nvidia).

Also, assuming that you use heavily simplified / no refraction (distortion
of the ground), wouldn't it be enough to "darken" the water depending on
vertex-based ground depth (relative to water-surface, not to camera)?

Gruss

Jan Bruns



<simondhopkin@xxxxxxxxxxx> schrieb im Newsbeitrag news:3qom031d46urkeal8mcche3jepngju49vd@xxxxxxxxxx
Hmm thanks. This sounds a bit like what I am looking for.

So basically your I should render the scenery. Excluding the
transparencies. But keep the z-buffer data it produced somehow (will
look into this).

Then render the transparent object to a temp surface keep their
Z-Buffer too.

Then rerender the transparent object using the two Z-Buffers to
calculate the depth difference and therefore how dark the fogging
needs to be.

There are a fairly mininmal no of triangles to render on the trans
surface so it shouldnt be too computationally expensive but this seems
like the way.

Basically Im trying to get my underwater scenery to fade depending on
how much water you are looking though to see it. So the difference
between the water z-buffer depth and the land z-buffer depth would
determine how "fogged" the land would need to be.

Hopefully it will be a cool effect if i can get it to work.


On Thu, 29 Mar 2007 01:25:38 +0200, "Jan Bruns"
<testzugang_janbruns@xxxxxxxx> wrote:

Sound like you'd want to read the z-value of previously rendered polygons
at a given pixel, to be able to calc color depending on the length of
camera-ray/object-volume intersection.

But in D3D9, it's normally not possible to read and write a surface within
the same pass. Also, there's not an appropriate BLEND-factor to use.

A multipass-solution could look like this:
- render non-transparent geo
- set a temporary RT (Fromat R32F, for example)
- render back-facing polygons
- reset RT to be backbuffer
- render front-facing polygons using the temporary texture to calc deltadepth

Gruss

Jan Bruns
.



Relevant Pages

  • Re: Too Considerate
    ... water, then into the ice water) drain and freeze. ... Woke to fog. ... We only had four GCA setups at the ... airstrips in Australia. ...
    (alt.support.diabetes)
  • Re: Hey Nod troll
    ... The first image is just the Titanic, no water. ... computer with a decent graphics card. ... Completely flat matt finish on everything. ... Any decent piece of rendering software will use all the acceleration the graphics card provides to do a render. ...
    (rec.arts.drwho)
  • Re: Congrats to the Brits! (2012 Olympics)
    ... running on the water, ... coming through the fog, ... your sons and daughters. ...
    (alt.games.mame)
  • Low fog over water (indoors)
    ... A local nightclub wishes to have a constant low fog over their indoor ... The fog would need to hang on the surface of the water for at least ... distros, some chemical foggers and refrigeration units, and ye olde Dry ... the LN2 or dry ice) but if I can get the temp down significantly I ...
    (rec.arts.theatre.stagecraft)
  • Re: Further Proof Of Nodtrolls Incompetence
    ... > | You call that a render? ... You call that water? ... You call that a render and an animation? ... It's not my fault if his useless models won't load properly into the useless software he provided you deranged mentally retarded idiot. ...
    (rec.arts.drwho)

Quantcast