diff options
| author | hachem <im@hachem.wtf> | 2025-08-22 12:24:05 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-22 12:24:05 +0200 |
| commit | 0d819f2b9a71e862bce8799c6b0c1304e62219b3 (patch) | |
| tree | a3011c8f5b04c98de5a8a24bc2b4ded312de958e /Assets/Shaders/Skybox.glsl | |
| parent | c20a400e620154f0c334fe0a37d547625b6ee65b (diff) | |
[add]: add HDRI
Diffstat (limited to 'Assets/Shaders/Skybox.glsl')
| -rw-r--r-- | Assets/Shaders/Skybox.glsl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Assets/Shaders/Skybox.glsl b/Assets/Shaders/Skybox.glsl new file mode 100644 index 0000000..654bed1 --- /dev/null +++ b/Assets/Shaders/Skybox.glsl @@ -0,0 +1,31 @@ +#type vertex + +#version 330 core + +layout (location = 0) in vec3 aPos; + +out vec3 TexCoords; + +uniform mat4 u_Projection; +uniform mat4 u_View; + +void main() +{ + TexCoords = aPos; + vec4 pos = u_Projection * u_View * vec4(aPos, 1.0); + gl_Position = pos.xyww; +} + +#type fragment + +#version 330 core + +out vec4 FragColor; +in vec3 TexCoords; + +uniform samplerCube u_Skybox; + +void main() +{ + FragColor = texture(u_Skybox, TexCoords); +} |
