Hi gunn,
I made some modifications to the software backend and it now acknowledges the lightingEnabled attribute. To do this I just had to do some minor changes:
in de.jreality.shader.DefaultPolygonShader (trunk/src-core/de/jreality/shader) I added this field
final static boolean LIGHTING_ENABLED_DEFAULT = true;
and these two methods
void setLightingEnabled(Boolean light);
Boolean getLightingEnabled();
and in DefaultVertexShader.java (trunk/soft-new/de/jreality/softviewer/shader)
I changed the constructor from:
public DefaultVertexShader(Color c, double phong, double phongSize, double transparency) {
to
public DefaultVertexShader(Color c, double phong,
double phongSize,
double transparency,
boolean lighting)
added a new field
private boolean useLighting = true;
and set that in the new constructor above
then in its shadeVertex method I check on the state of the field and jump over the whole lighting calculation if useLighting is false. Better would be to refactor that function into several functional blocks.
And finally I changed the call to the constructor of DefaultVertexShader in DefaultPolygonShader (trunk\src-soft-new\de\jreality\softviewer\shader) from
vertexShader = new DefaultVertexShader(ps.getDiffuseColor()(),ps.getSpecularColor(),ps.getSpecularCoefficient(),ps.getSpecularExponent(),ps.getTransparency()) to
vertexShader = new DefaultVertexShader(ps.getDiffuseColor()(),ps.getSpecularColor(),ps.getSpecularCoefficient(),ps.getSpecularExponent(),ps.getTransparency(),ps.getLightingEnabled())
and that's all. It works! :D
Btw I noticed that the line intending on a lot of the source files is totally inconsistent which makes it a very awkward to read the code.