Commit 9e11c7c5 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Need to adjust voxValue by texZero so comparison works e.g. when neg cmap

is activate
parent 96589195
......@@ -281,9 +281,11 @@ MAD tempColour, tempVar.x, colour, finalColour;
# tempVar.x, such that it is == 0 if we should
# take the depth value from this sample, < 0
# otherwise.
SLT tempVar.x, skipTest.x, 0; # set if should skip
SLT tempVar.y, depth.w, 0; # set if already have depth
SLT tempVar.z, voxValue.x, 0.1; # set if below threshold
SLT tempVar.x, skipTest.x, 0; # set x if should skip
SLT tempVar.y, depth.w, 0; # set y if already have depth
SUB tempVar.z, voxValue.x, {{ param_negCmap }}.y; # set z if below threshold
SLT tempVar.z, voxValue.x, 0.1;
ADD tempVar.z, tempVar.z, {{ param_screenSize }}.z; # and blending by intensity
SGE tempVar.z, tempVar.z, 2;
ADD tempVar.x, tempVar.x, tempVar.y;
......
......@@ -414,7 +414,7 @@ void main(void) {
* current display range). The 0.1 threshold is
* completely arbitrary, but seems to work well.
*/
if (depth == 0 && voxValue >= 0.1) {
if (depth == 0 && (voxValue - texZero) >= 0.1) {
depth = (tex2ScreenXform * vec4(texCoord, 1.0)).z;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment