Created
July 27, 2018 14:09
-
-
Save WiggleWizard/a4768fcd4aac82b0a36d722ca9fceb8d to your computer and use it in GitHub Desktop.
Godot Skybox Shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type spatial; | |
render_mode unshaded, cull_disabled, cull_front; | |
uniform samplerCube cubemap; | |
varying vec3 viewDir; | |
void vertex() | |
{ | |
viewDir = (WORLD_MATRIX * vec4(VERTEX, 1.0)).xyz - (CAMERA_MATRIX * vec4(0.0, 0.0, 0.0, 1.0)).xyz; | |
} | |
void fragment() | |
{ | |
ALBEDO = texture(cubemap, viewDir).xyz; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment