[Bf-committers] BGE: Local or Infinite viewpoint for specular calculation?

Dalai Felinto dfelinto at gmail.com
Sun Jan 25 06:24:57 CET 2009


 (Brecht I found the problem I was having, so this email is specially for you :)

Hello,
BGE is using infinite viewpoint for specular light calculation.
This is the openGL default option, and is supposed to be fast than the
other option (local viewpoint).

(this is where I got the clue:
http://gregs-blog.com/2007/12/21/theres-nothing-wrong-with-opengls-specular-lighting/)

However, if you rotate the camera (keeping the position) the specular
will be different for each angle of the camera.
In order to make a fisheye camera, I need 4 renders from the same
camera position and diferent orientations.
For I will obviously need a consistent specular calculation. Otherwise
I get this kind of result: http://imagebin.org/36685

The openGL call for that is:
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);

As an example, if I call this method in
KX_BlenderRenderTools::applyLights it solves the problem for Texture
Face and Blender Multitexture Material.

So I would to know:
1) Does it worth to use infinite viewpoint instead of local one? This
problem is already (partially at least) solved in GLSL mode. I don't
know if there the light calculation is different
2) Where would be the proper place for this command?
3) There is another solution that doesn't affect performance?

I create a bug report to put an example file:
https://projects.blender.org/tracker/?func=detail&aid=18228&group_id=9&atid=125
, although I'm not sure if this is a bug or by-design.

Thanks, and glad that I finally found this problem.
It was driving me insane :)

Dalai
http://blenderecia.orgfree.com


More information about the Bf-committers mailing list