I feel like I’m missing something obvious, but, I want to apply a color to a lightmap. Basically the equivalent of material.emissiveColor
e.g. material.lightmapColor.
More details, we have a flat shaded mesh, and a lightmap texture with a gradient. I want to pulse the base material color and the highlights through a range of colors.
I don’t understand which result you want to get. On your example above, your lightmap is tinted, isn’t it? (here just the same but with the animation from nasimiasl code).
And by the way, it seems your talking about emissive texture, and not lightmap right? (anyway, it’s the same logic but using ambientColor)
A is the mesh with Standard Material and diffuse texture:
B is the lightmap:
When I apply the light map as either:
emissiveTexture + useEmissiveAsIllumination
lightMapTexture
It looks like d (c is just lighmap as emissive)
This is great, I and change the level to make a nice effect, but, I want to change the color of the lightmap. Just changing emissiveColor (in this case to Color3(1,0,0) ) gives me E.
Instead of just the lightmap changing color, the whole mesh gets changed. What I want to see is just the areas affected by the lightmap change color.
But you maybe spot a bug, I’m not sure, but it seems strange to me that an emissiveTexture generate emissiveColor with black pixels (even multiplied by white emissiveColor) : https://playground.babylonjs.com/#XJANGB#2 (is it @Deltakosh we have to ping here? ) I think here we should just have white & red emissiveColor where emissiveTexture is white isn’t it? (even in stable BJS version it acts the same, so maybe I miss something basic here )
emissive channel works exactly how it needs, both useEmissiveAsIllumination true or false ; all is well in the best of all worlds, sorry for the ping I was just not getting why this doesn’t work with rjewson playground.