what exactly does "hint_normal" in shaders do? what do other hints do?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By thenegativehunter

i want to know what “hint_normal” mathematically does. hints have been put in the documentaiton as a list but what they do is never clarified.

sometimes they do something like srgb conversion, sometimes they trigger reimport.

:bust_in_silhouette: Reply From: Wakatta

Feel free to disregard the following as it is based solely on my observations

hints are most likely a combination of export and type conversion so in gdscrip it might look something like this

export(Texture) var texture
export(TextureNormalMap) var normal #hint_normal since only the red and green channels are needed for normal maps

The question may be
What type of resource is being loaded? … hint normal, albedo, color

Then the internal working probably does

var input = (Type) input
:bust_in_silhouette: Reply From: Calinou

hint_normal triggers the reimport of a texture as a normal map when a texture is supplied using the inspector. This is done because normal maps only need the red and green channels to function (Godot reconstructs the blue channel in the shader). This makes it possible to use more better-looking and efficient RGTC compression for VRAM texture compression.

hint_albdo triggers the reimport of a texture to perform sRGB conversion. When using the GLES3 renderer, Godot performs rendering in linear space to allow for gamma-correct, HDR rendering.