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, 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 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 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 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 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 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() { |
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, blend_mix, shadows_disabled; | |
uniform vec4 main_colour:source_color; | |
//calculates depth to the back of a cube behind each 0 to 1 UV face.bool | |
//If you have a cube where each face is 0 to 1 UV then it calculates the distance to each side and the back | |
//based on my earlier depth cube in Unity: https://gist.github.com/partybusiness/b7ec339d16d3f3b7e2b202ac4e5d8686 |
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 cull_disabled, unshaded, depth_draw_opaque; | |
//just something I used to diaply the figure eight | |
uniform sampler2D tex:source_color; | |
uniform float spin_speed = 1.0; | |
void vertex() { | |
UV.y = UV.y + TIME * spin_speed; | |
} |
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
extends Node | |
@export var display_material:Material | |
@export var game_state:PackedByteArray | |
const width:int = 64 | |
const height:int = 64 | |
var rd := RenderingServer.create_local_rendering_device() |
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; | |
uniform uint tilemap[1024]; // up to 128 8-byte 8x8 tiles | |
uniform uint screen[1000];// 40 x 25 screen map, 7 bits index one of the 128 tiles, highest bit inverts | |
uniform uint screenWidth = 40; | |
uniform uint screenHeight = 25; |
NewerOlder