how to use .hdr format file in shader

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

Engine: 3.0.6
shader:
uniform sampler2D tex1;
uniform samplerCube tex2;

Hi, all !
In The shader param Inspector Panel,
There is no selection for .hdr,
so, how to use .hdr format file in shader?
Thanks !

If you load in a HDR image it will automatically be HDR. The Godot shaders use HDR as standard and you actually have to manually set it lower if you want less prepossession.

Shading language — Godot Engine (3.0) documentation in English

MysteryGM | 2018-11-24 16:42

Can I bind a HDR image to “uniform sampler2D” or “uniform samplerCube” ?
commonly, use “texture(samplerCube, vec3)” to get reflection color,
but, I dont know how to do in godot.
Thanks !

StudyPerDay | 2018-11-28 09:22

Can I bind a HDR image to “uniform sampler2D” or “uniform samplerCube” ?

Godot has samplerCube

commonly, use “texture(samplerCube, vec3)” to get reflection color,

[vec4_type texture ( samplerCube s, vec3 uv [, float bias] )][2]
Meaning you will get a vec4 value using: texture(MyCubeMap, UV, 0.15);

I don’t know what you are trying to do, but if you want HDR rendering there is a Godot demo project.
2D HDR Demo - Godot Asset Library

I hope some of this helps you.

MysteryGM | 2018-11-28 22:33