hey,
another question about glsl program, when one try to disable a previously setted shader :
sky/sun is made thanks to a lamp rig, controlled by python and some prop.
object shader is the simple red on the dome at the end of the vid.
I switch back to the blender material the objet is not enlighted as it was before the shader is applied : it seems the lights follow the camera transformations, and not the object transformations.
here the glsl toggle code I did :
[...]
mesh = ob.meshes[meshid]
mat = mesh.materials[matid]
matname = mesh.getMaterialName(matid)
shader = mat.getShader()
if shader != None:
if not shader.isValid() :
#doc says to use it before set but works without it ?
#shader.delSource()
shader.setSource(VertexShader, FragmentShader, 1) # this undocumented third arg (boolean it seems) seems to act as a set/unset toggle
print('shader %s set on %s (%s)'%(shadername,matname,matid))
else :
shader.delSource()
# this one works too
#shader.setSource(VertexShader, FragmentShader, 0)
print('shader %s not set on %s (%s)'%(shadername,matname,matid))
[...]
how can I retrieve the ‘normal’ enlightment setup ?