I am having trouble with orthographic projection and directional light. Everything works as expected except the specular component.
For example if I have a light position (0, 0, 1, 0) (directional) My scene renders correctly but specular component lights the scene as if it is a positional light at (0, 0, 1) (again just for specular component).
My question is simply what am I doing wrong? or
Is there some gotcha with ortho and specular? (should go and read lighting theory again?)
How are you doing the lighting? CG with H vector?
No fancy stuff
Just fixed pipeline.
So youâve got a nice setup for the combiners, I assume, and it works for point lights, but not directional? @_@ I need some coffeeâŚ
I really mean no fancy stuff. Just good ol` 1.1 (ok maybe 1.2).
But for some code and pictures see
http://home.comcast.net/~obirsoy/OrthoLightProblem.htm
I suspect this is something related to GL_LIGHT_MODEL_LOCAL_VIEWER, but its been a long day. I guess, i have something to study for the weekend.
Ahhhhh, I see. Doing great lighting with 1.1 is difficult, especially specular lighting, without tesselating your geometry, alot. That maybe your only problem, subdivision.
Yes, i know but i have to support every possible card out there.
To be more clear my problem is with image 2. I expect the front âwallâ have specular too, but it does not as if the light is positional(image3).
I think I have meshed the âwallsâ quite good.
Note: I added a new picture (Image 4) showing the mesh I have.
You need to enable two sided lighting. Normally, you can only light the âpositiveâ side, the side with the normal. Iâd have to lookup the details on that, as I never use two sided lighting myself⌠I think maybe thereâs a simple enable for that, not sure.
@@
Oh yeah, plenty of tess there!
@@
light model: GL_LIGHT_MODEL_TWO_SIDE
@@ Oops, you have the two side.
Hmmm, not sure I see the problem.
@@ make sure the model matrix is what you expect when you set the light position.