Skip to content

Instantly share code, notes, and snippets.

@WiggleWizard
Created July 27, 2018 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WiggleWizard/a4768fcd4aac82b0a36d722ca9fceb8d to your computer and use it in GitHub Desktop.
Save WiggleWizard/a4768fcd4aac82b0a36d722ca9fceb8d to your computer and use it in GitHub Desktop.
Godot Skybox Shader
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