I ran into a confusing issue using a Material Builder node and a Bake Texture node. Essentially what I want to do is to have one object mix multiple Principled Shader materials (using a Layer Mix node inside a Material Builder) based on point color (Cd) and other attributes and then bake this out into textures (basecolor, normal, metallic, specrough) for use in a game engine. Baking this out mostly works the way I expect, except for the basecolor texture. The basecolor texture ends up being the alpha-blended result of the two basecolors selected for the Principled Shader materials, but crucially it does not include any influence from the point color (Cd) despite the "Use Point Color" checkbox being checked on the Principled Shader. Just as a sanity check, I tried assigning a simpler material that is a single Principled Shader rather than a Material Builder and this bakes exactly how I expect it to (i.e. with influence of the point color).
I created a minimal example of the problem and attached it here. I understand that I can use nodes to compute my own basecolor and export it but I'd rather not if I can avoid it. This example is simple, but the project I am actually working on has a much more complicated setup with more than two materials being blended based on complex rules.
What I expect to happen: when I bake /obj/bake/baketexture1, I get a basecolor texture that is a blend of the two materials and is influenced by point color (Cd)
What actually happens: while the colors are a blend of the two materials, there is no influence of point color (Cd) on the basecolor texture emitted.
Material Builder + Bake Texture confusion
1664 1 0-
- evelynparenteau
- Member
- 1 posts
- Joined: Feb. 2023
- Offline
-
- jsmack
- Member
- 8173 posts
- Joined: Sept. 2011
- Offline
That's expected. Bound attributes on materials do not tunnel when called with shader calls, i.e. the bind node used in the principled shader is not connected to the outer calling shader when layering multiple shaders together. The bind needs to be explicitly connected to the bound input of each shader layer. Due to the point color pin being hidden it's not possible.
To get the point color again, do not use the texture controls on the principled shader. Create a surface color node and set up the texture and point color settings there and connect this node to the principled shader's basecolor input.
To get the point color again, do not use the texture controls on the principled shader. Create a surface color node and set up the texture and point color settings there and connect this node to the principled shader's basecolor input.
Edited by jsmack - April 10, 2023 18:39:13
-
- Quick Links