Line Rendering big problem

Juan Lastra

Member
Joined
Jan 13, 2005
Messages
5
Location
Madrid (Spain)
Hello:
I am drawing trimming lines on a surface. To show the lines I put them on the top using the following call:

device.RenderState.ZBufferFunction = Compare.Always;

The lines are rendered on the top of the surface in the right way.
The problem is that the back lines (on the back of the surface) are also
drawn like black shadows. I don
 
They are being draw because youre using Compare.Always. The Normal is just the direction that they reflect light, not the direction they are visable from. Lines are not culled.
 
I would try to get the ZBuffer to work for you. If you cant get that to work then Id suggest a vertex shader to either shift the lines by a small transformed z or to alpha out the obverse lines.
 
Similar results win Compare.Equal

I got similar results when I used the Compare.Equal option.
With this option the lines blinks according to the point of view,
but the genral effect is the same, the back lines appear
as shadows.
 
The default value of LessEqual would be best I think. If you still have broken lines Id try slightly decreasing the z component of the line vertices in view space in a simple vertex shader.
 
Back
Top