[BUG 1.0] Water surface shader blends pixels from objects - LOGGED
by Brett Williams · in Torque 3D Professional · 09/30/2009 (12:09 am) · 6 replies
The surface of the water appears to be sampling the outer edge pixels from objects that are in view in front of the water.
Repro:
- Create Terrain with a light color
- Drop in a water plane
- Stand next to the water in the shallow depth
- Observe lines forming around the edge of the gun or player model

GeForce GTX 280
Repro:
- Create Terrain with a light color
- Drop in a water plane
- Stand next to the water in the shallow depth
- Observe lines forming around the edge of the gun or player model

GeForce GTX 280
About the author
#2
I'll try to look at a way of cleaning this up.
09/30/2009 (3:30 am)
This is AL. I guess I see this in the old betas too. I'll try to look at a way of cleaning this up.
#3
Using a refract texture that is half/quarter the size of the back/depth buffers saves you fillrate and shader cache consistency, but also means an above water object changes resolution as it is submerged, and underwater we don't have a 1-1 map of color pixel to depth pixel anymore.
But, I do still think there is a bug or something to improve here.
A few ideas...
1. We might be using a linear clamp somewhere we need to do a point clamp.
2. Maybe we need to get a downsampled depth buffer that matches the size of the refract texture and do this downsample in some "smart" way like keep the min/max of its prior 4 pixels.
3. Maybe we are just off by a half pixel somewhere we look up into the refract texture.
09/30/2009 (4:26 pm)
In ReflectionManager.cpp in its constructor you can change mRefractTexScale to be 1.0f instead of 0.5f. In 1.1 this can be set from script as a $pref variable. Using a refract texture that is half/quarter the size of the back/depth buffers saves you fillrate and shader cache consistency, but also means an above water object changes resolution as it is submerged, and underwater we don't have a 1-1 map of color pixel to depth pixel anymore.
But, I do still think there is a bug or something to improve here.
A few ideas...
1. We might be using a linear clamp somewhere we need to do a point clamp.
2. Maybe we need to get a downsampled depth buffer that matches the size of the refract texture and do this downsample in some "smart" way like keep the min/max of its prior 4 pixels.
3. Maybe we are just off by a half pixel somewhere we look up into the refract texture.
#4
I don't recall getting much difference from changing the RefractTexScale. I have to admit it's been a while since I looked at it, but I just was working with some water and it reminded me about this.
10/27/2009 (12:52 am)
Still having issues trying to improve this. I looked at it for a while, but couldn't find anything that would really be causing the issue.I don't recall getting much difference from changing the RefractTexScale. I have to admit it's been a while since I looked at it, but I just was working with some water and it reminded me about this.
#5
06/17/2010 (7:10 pm)
Logged: TQA-412
Associate Tom Spilman
Sickhead Games
We use the depth difference to remove the geometry above the water plane from the refraction, but there is sometimes a little bit of a ghost outline left.
Now in BL it cannot filter it out because i doesn't have per-pixel depth... so you get a bad refraction effect like that. Not too much you can do there.
THREED-754