PDA

View Full Version : Avoid Z-fighting same way as SGIX_reference_plane?



RobertCWebb
03-16-2015, 07:18 AM
SGIX_reference_plane looks like a simple and clever extension. Set a reference plane, then draw all the coplanar geometry you want in a single pass, no stencil buffer, with no Z-fighting. But it's only available on SGIs.

Can the same be achieved in a shader? Looks like gl_FragCoord and pixel_center_integer could be used for this somehow, but I don't know how.

Any ideas?
Thanks,
Rob.