PDA

View Full Version : Clip when Wc is negative



IG
04-23-2006, 05:21 AM
Is clipping done for negative Wc?
What does it mean when Wc<0?

memfr0b
04-23-2006, 05:50 AM
Technically, negative homogenous components would negate/mirror the vector. (x, y, z, -w) = (-x, -y, -z, w). You should avoid negative homogenous components (both for texture coordinates and vertex positions) as OpenGL might not clip and interpolate those correctly.

IG
04-23-2006, 06:01 AM
Can you pleas direct me where it says that "OpenGL might not clip and interpolate those correctly"

IG
04-23-2006, 06:02 AM
Can Wc be Zero??

memfr0b
04-23-2006, 06:23 AM
Appendix H of the OpenGL Programming Guide (http://fly.srk.fer.hr/~unreal/theredbook/appendixh.html) under "OpenGL Correctness Tips":

Avoid using negative w vertex coordinates and negative q texture coordinates. OpenGL might not clip such coordinates correctly and might make interpolation errors when shading primitives defined by such coordinates.A zero homogenous component is allowed and refers to a vertex at infinity.