I have a shader material that Id like to add a normal map to. It doesnt have a slot for the normal map, and I assume I need to add it programmatically.
Can anyone link to an example project? Im using Godot 4.
Thanks!
The easiest way is to use a standard material. Add all the feature you want, then convert it to a shader material (there is a button on the drop down).
Add a texture uniform named normalmap, and that is where it would plug into, then in the shaders fragment program you would pipe it into the NORMAL NORMALMAP.
Kendra Add a texture uniform named normalmap, and that is where it would plug into, then in the shaders fragment program you would pipe it into the NORMAL.
If I remember correctly, there is additional logic for the calculations (TANGENT, BINORMAL, etc.) and you'll end up having to rewrite some of these calculations if you do it by hand.
Mcclean If the normalmap is already of correct format then I don't think that's necessary, but in the basic setup you won't have any control for 'bump strength' or any such thing. And the normalmap bake has to be perfectly catered to use in godot. So the TL;DR is that it is indeed best to convert a standard material with all the relevant functions enabled into a shadermaterial and go from there.
edit: ah and I meant to specify NORMALMAP not NORMAL in my previous post, that's likely the source of the confusion. It's what I get for replying before I've even had my morning coffee. 😅
© 2022 - 2024 — McMap. All rights reserved.