hum, my spec highlights look something like, imagine a flat plane, now imagine a specular highlight that's totaly spherical (literally).
i've opened 3dmax3 meanwhile and been playing around with lights and the specular should be elipsoidal (or something like that, my english sucks ass a bit).

any thoughts, suggestions are welcome http://www.opengl.org/discussion_boards/ubb/wink.gif

tks
Quasar

davepermen

08-25-2002, 03:14 AM

well, show what you do mathematical/codewise.. something went wrong, we have to find what, and without code thats really uhm.. difficult? http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Quasar

08-25-2002, 03:24 AM

hello again

im computing light and half vector in a vertex shader, then light and half vector's are normalized with a normalization cube map.

the math is something like:
light vector= light pos- vertex pos

half vector= eye pos-vertex pos
half vector+= ligth vector

then stuff is transformed into tangent space and saved in respective output registers.

hm sounds okay.. if you tesselate the geometry to near_to_perpixel triangles, does it get bether? normally, you would need to _calculate_ the halfangle perpixel, means normalizing point_to_light and point_to_eye perpixel, and then summing them up (and normalize again http://www.opengl.org/discussion_boards/ubb/biggrin.gif god bless approx_normalize for pixelshaders.. http://www.opengl.org/discussion_boards/ubb/biggrin.gif)
if you sum them up before, and do the normalization, the direction of the halfangle gets wrong => wrong shading occurs..