I've checked that. It indeed seems to be only on the edge pixels but not due to an error in the UV coordinates. I tried out every example mesh avibale with RenderMonkey. The errors occured on every mesh. Additionally I tested the dx9 parallax occulsion example from RenderMonkey with the same meshes and no error pixels appeared, so there has to be an mistake somewhere in my shader.
Edit: Found out that the error pixels disappear if I disable the second searching step, still trying to find out why...
Edit2: I changed the TraceRay function to
vec4 TraceRay(in float height, in float start, in float stop, in float steps, in vec2 coords, in vec3 dir){ float diff = (start - stop) / steps; vec4 CurrentPoint = vec4(coords.x, coords.y,0.0,0.0); float CurrentHeight = texture2D(heightMap,CurrentPoint.xy).r; float f; //added if(start < CurrentHeight){ CurrentPoint.z = start; CurrentPoint.w = stop; return CurrentPoint; } //added end for(f=start;f>=stop;f-=diff){ CurrentPoint.xy += dir.xy * diff * height; if(f < CurrentHeight) break; CurrentHeight = texture2D(heightMap,CurrentPoint.xy).r; } CurrentPoint.xy -= dir.xy * diff * height; CurrentPoint.z = f + diff; CurrentPoint.w = f; return CurrentPoint;}
Now the error pixels accour on every edge pixel and also already in the first searching step, do I remove the added code no error pixels accour in the first searching step, but in the second. The question is now what exactly happens on the edges that start is always smaller than the starting height?
For me this is not even possible because the higehst value of the texture can be 1.0 and the startvalue of the first search step is also 1.0?
[Edited by - Ingrater on March 24, 2008 4:58:49 PM]