[Bf-committers] Question about lighting in shaded view.

Jacek Popławski bf-committers@blender.org
Thu, 22 May 2003 11:19:32 +0200


I am trying to understand how lighting in shaded view works.

Mesh draw is in function drawmeshshaded in file drawobject.c.

GL_LIGHTING is disabled, so answer for question "how Blender support more than
8 lights?" is "it doesn't use OpenGL for lighting!".

First argument of drawmeshshaded is Object, then two arrays.

Arrays are used in glColor calls. Second array is used for second size of
faces.

What really is in these arrays? Probably some precalculated color values. But
where exactly is that calculation? I assume that Blender loop in lamp list and
add (blend?) colors for each vertex. But where that operation is located in
source?

PS. My goal is to fix lighting errors - sometime lights are not updated until
you move/rotate object. Try also to add/remove lamp in shaded mode - nothing
changes.

-- 
Free Software - find interesting programs and change them
NetHack - meet interesting creatures, kill them and eat their bodies
Usenet - meet interesting people from all over the world and flame them
Decopter - unrealistic helicopter simulator, get it from http://decopter.sf.net