@antmelnyk, I see what you are describing from the playground you linked, but I think I need a little more context before I can give you the best advice. You are correct that using an albedoColor
and an albedoTexture
together in one material will multiply the two before returning the final diffuse color before the lighting step. Typically, you would use one or the other in a default PBR material unless you wanted a bit of customization. Say for example you had an albedoTexture
of a racecar number in a black circle with the numbers in white on a white background. You could then use the albedoColor
value to change the color of the car and number at once. But you need to design the system around the two multiplying together unless you want to use a custom shader (node material).
Can you describe what you are trying to achieve (you can be generic about it if your project is still secret) by having both a color and a texture. In this case, the albedoTexture
fills the entire cube so you wouldn’t see any of the albedoColor
at all if they didn’t multiply together. You also show using a lightmap for your texture when the albedoColor
is black so I assume that you want the texture to be affected by lighting in your scene. I am also assuming you want the albedoColor
to be affected by scene lighting as well, so you won’t be able to tap into an emissive texture.
At first glance, I think you would need a custom shader using a node material which uses an alpha channel in your albedoTexture
to determine where the albedoTexture
shows and where the albedoColor
shows in your material. This is a simple lerp of the albedoTexture
and the albedoColor
using the alpha mask as the gradient. This output is then passed into the base color input of the PBRRoughnessMetallic
node in the node material editor (NME).
But I am not sure what your end goal here is so if you can give us a little more context, we can point you in the right direction.