This file contains hidden or 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 sky; | |
uniform sampler2D skyTexture:source_color; | |
void sky() { | |
COLOR = textureLod(skyTexture, SKY_COORDS, 0.0).rgb; | |
} |
This file contains hidden or 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
@tool | |
extends EditorScript | |
# converts an equirectangular panoramic texture to a skyamid format | |
var source_panorama:String = "res://skybox_example_pano_left.png" | |
var target_skyamid:String = "res://skyamid.png" | |
func _run() -> void: | |
# load source |
This file contains hidden or 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
@tool | |
extends EditorScript | |
class_name GenerateCubemapEditorScript | |
# collection of helper scripts for generating cubemaps | |
# file you wish to output the generated cubemap to | |
var cubemap_filename:String = "color_test_cubemap.tres" |
This file contains hidden or 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
#[compute] | |
#version 450 | |
// Invocations in the (x, y, z) dimension | |
layout(local_size_x = 8, local_size_y = 1, local_size_z = 1) in; | |
layout(rgba16f, set = 0, binding = 0) uniform restrict image2D distances; //distances to walls along each raycast, as well as data for wall texture | |
layout(rgba16f, set = 0, binding = 1) uniform restrict image2D map; //map to raycast on |
This file contains hidden or 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, blend_mul, depth_draw_never, depth_test_disabled; | |
// creates a silhouette that appears when the mesh is behind something else | |
// you can combine this with another material by assigning this as the Next Pass material | |
// this might need adjustment to work with 4.3 and later, because of the reversed depth | |
uniform vec3 shadow_colour:source_color = vec3(0.7,0.7,0.9); | |
uniform sampler2D depth_texture:hint_depth_texture; |
This file contains hidden or 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
extends Node3D | |
# Sets position of hole that makes character visible through walls | |
func _process(delta): | |
RenderingServer.global_shader_parameter_set("character_position", global_position) | |
This file contains hidden or 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; | |
uniform float _Radius = 1.; | |
//https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html | |
float distance_between_point_and_line(vec3 ls, vec3 le, vec3 point) { | |
//ls = line start | |
//le = line end | |
//point = posiiton of point |
This file contains hidden or 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
#[compute] | |
#version 450 | |
// Invocations in the (x, y, z) dimension | |
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; | |
layout(r32f, set = 0, binding = 0) uniform restrict image2D input_image; | |
layout(push_constant, std430) uniform Params { |
This file contains hidden or 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 canvas_item; | |
render_mode blend_mix; | |
uniform float bulge = 0.1; | |
uniform float scale = 1.0; | |
//used to set curvature of screen crop | |
uniform float n = 5.0; | |
This file contains hidden or 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; | |
//renders vertical gradient that centres on node's position | |
uniform vec4 _TopColour:source_color = vec4(1.0,1.0,1.0,1.0); | |
uniform vec4 _BottomColour:source_color = vec4(0.0,0.0,0.0,1.0); | |
uniform float _Height = 1.0; | |
uniform float _exp = 1.0; | |
void fragment() { |