Dynamically change base color of existing diffuse texture

You are right. They are different materials. Better said one has limited inheritated options from the other.
The PBRMaterial is the full class PBR (along with custom). The MetallicRoughness is a simpler version with less options (though some exist but are not shown, at least in the inspector). It is still PBR but much easier to handle (but then, it’s more basic).

1 Like

Yes the doc the I linked shows how to use that block to create your own PBR materials and has example NME’s that you could start with for example. :slight_smile:

1 Like

Thanks guys, I need to go over the NME and see if that helps with my issues. Colouring on top of the grayscale is still weird when I can’t control the percentage of each color and etc.

1 Like

I mean I posted a version to you that had the color mixing completely exposed and you could control the colors anyway you want through that. Its the direct shader code, not going to get much more control then that.

1 Like

Hi! Thanks for that reply, I’m still trying to learn how it actually works, as I don’t understand some basic WebGL yet. I don’t know yet how I would come up with the AddUniform and Fragment_Custom_Diffuse, or the custom tintTexture method. You extended the customMaterial, is it PBR? Can I also extend a PBRMaterial? I have no experience with WebGL before this, so I was imagining a difference process.

Yes, when I get a chance today ill whip you something up and add a few “mixing” modes for you so that way you can kind of see how its done.

Sorry if I just post stuff and don’t explain it fully, I have a million things happening at all times it seems like these days XD.

Ill give you a tintTexture, tintColor, and like additive, multiplied, screen modes and leave the rest up for you to figure out.

Give me by the end of today though, I’ve got a lot going on.

1 Like

Thanks a lot! I do appreciate you taking your time for it. I need to get a good understanding of how it all works as I am using it in production and will be having multiple different models and textures in the future. Currently I’m reading about how WebGL and the shaders work.

No need to worry, though, if you don’t have time.

here is a pbr one with a hsl shift.

2 Likes

Thank you! It still seems all very complex to me, mostly because I’ve never wrote any shader before and have very little knowledge of webGL. Are there any documentation or course you recommend me reading to better understand how to use these custom methods? I couldn’t find any docs on PBRCustomMaterial. I’m writing it in JS because of the original code base, would the implementation change?