Diffuse and Specular based on texture image pixel color


As per my understanding,
When we set an image for Diffuse texture for a material, A material’s diffuse color should depend on the color of the pixel at a given point. If I apply a multi-color image, then the color reflected or diffused is depending on the pixel from the image mapped (UV) for a given 3D point of the mesh.

In that case, simply setting diffuse and specular colors for a material is not proper.

In the below PG, I am expecting proper color reflected on the walls instead of white color.

How to achieve that?

Thanks in advance.


I think the lighting you described (where color is reflected) is global illumination and this in realtime is not supported in babylon. You could used baked lighting to do this but then the light wouldn’t be able to be dynamic.

Baked lighting is coming in Babylon Global illumination baking engine · Issue #6104 · BabylonJS/Babylon.js · GitHub

Or you could manually do this to your assets with a tool like blender

1 Like