Material turning to red - Base on camera location and rotation

It’s kind of a funny bug, depending on the direction of my camera, the material seem to turn red. It only seem to happen to 1 of my model at a time. Anyone as an idea why it happen?
It only seem to happen on the backFace of the leaves.

What material? Which version of JME? What is your lighting setup? What is your material setup?

Lighting material, Jme 3.1 - alpha, Lighting is 3 light, 1 ambiant, 1 directional(sun), and one from the player(Radial light).

Material settings,

Material PineLeaves : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
        DiffuseMap : Models/Environment/Trees/PineTree2/Plane.png
        HardwareShadows : true
        AlphaDiscardThreshold : 0.1
        VertexLighting : true
        UseMaterialColors : false
        UseVertexColor : true
    AdditionalRenderState {
      Blend Alpha
      DepthWrite On
      DepthTest On
      FaceCull Off
      ColorWrite On
      AlphaTestFalloff 0.0

Does your mesh have vertex colors?

Show us the code for the lighting setup.

I don’t think so :open_mouth: , Actually i have no idea what it s mean haha… (vertex colors)
And for the lighting it would be hard to show, It s kind of mess up and i don’t see what would be wrong about it (the only moving part of the lighting is the this code:

pl = new PointLight();
pl.setColor(new ColorRGBA(0.4f, 0.25f, 0.18f, 1.0f));
pl.setPosition(new Vector3f(0, 0, 100));

Never mind about the vertex color, i do not use this technique at the moment, but i don’t think it would affect the color of the material depending on the location of the camera. By the way, there is one thing i should clarify. The material Switch instantly, And if i turn the camera it stop instantly too, it s not progressif.

If you don’t use vertex colors then you should turn it off in your material. Else the material might be picking up whatever random garbage happens to be in memory right then… ie: red vertex colors.

Alright i will give it a try!

There was an issue in jME 3.0 where it would not shut off unused attributes correctly for meshes. So e.g. if you rendered a mesh with vertex colors followed by a mesh which did not have vertex colors (but the material had “VertexColor” enabled), then the vertex colors from the first mesh would leak onto the second. This is actually fixed in one of the recent commits I made in master.