Hi All!
After looking around on the forums, I came across this post, which shows how you can use Lighting.j3md to render an Environment Map on your material. This is exactly what I want, so I tried it myself:
[java]
reflectionTexture = assetManager.loadTexture("Textures/EnvMaps/OutputCube.dds");
reflectionMap = new TextureCubeMap( reflectionTexture.getImage());
vehicleMaterial = new Material(aM, "Common/MatDefs/Light/Lighting.j3md");
vehicleMaterial.setFloat("Shininess", 50);
vehicleMaterial.setParam("DiffuseMap", VarType.Texture2D, aM.loadTexture("Models/Vehicles/Tuktuk/baked_tuktuk.png"));
vehicleMaterial.setBoolean("UseMaterialColors",true);
vehicleMaterial.setBoolean("UseAlpha",true);
vehicleMaterial.setColor("Diffuse",ColorRGBA.White);
vehicleMaterial.setColor("Specular",ColorRGBA.White);
vehicleMaterial.setParam("EnvMap", VarType.TextureCubeMap, reflectionMap); // <-- Set the environment map here
vehicleModel.setMaterial(vehicleMaterial);
[/java]
The problem is that the environment map is not visible on the material at all. The diffuse is, and changing other values such as the Specular colour etc. does have an effect, so I’m sure I’m not mixing up materials!
Would you mind telling me what I’m doing wrong?
- Thank you!