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 cull_disabled; | |
uniform float threshold = 0.0; | |
uniform vec3 direction = vec3(0.0, 1.0, 0.0); | |
// normal of dividing plane in model space | |
varying vec3 local_plane_normal; |
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; | |
uniform sampler2D textureA:source_color; | |
uniform sampler2D textureB:source_color; | |
uniform float blend:hint_range(0.0, 1.0, 0.01) = 0.5; | |
// lowers saturation for colours that pass through the centre of hue space | |
uniform float pow_comp:hint_range(0.0, 10.0, 0.01) = 1.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; | |
// example shader that uses the light pattern to flicker brightness on and off | |
// other possible ways to use this is give it render_mode additive have lights_on and lights_off versions of a texture and mix between them | |
uniform sampler2D light_texture:source_color; | |
uniform float fps:hint_range(1.0, 60.0, 1.0) = 10.0; | |
// temporal light pattern |
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 Resource | |
class_name Stat | |
# keeps track a a numerical stat and connected buffs / debuffs | |
# name of stat, also used as a matching ID for buffs | |
@export var name:String = "" | |
# whether value needs to be recalculated | |
var dirty:bool = false |
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 unshaded; | |
// iris shader, apply to a ColorRect that overlays the screen and set iris_size to iris in and out | |
// this one allows you to use a texture to shape the iris | |
// 0.0 = fully close, 1.0 = fully open | |
uniform float iris_size:hint_range(0.0, 1.0, 0.01) = 0.5; | |
// multiply the size of the texture beyond centre | |
uniform float max_size_mult:hint_range(1.0, 10.0, 0.1) = 2.5; |
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
# create 3x3 tic tac toe board | |
board = matrix(0, nrow=3, ncol=3, byrow=TRUE) | |
# each square can be 0 = empty, 1 = X, 2 = O | |
# returns index of board state | |
board_index <- function(board) { | |
index = 1 | |
x = 1 |
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; | |
uniform samplerCube sky_cube:source_color; | |
uniform sampler2D shadow_texture:source_color, repeat_disable, hint_default_white; | |
uniform vec2 shadow_scale = vec2(2.0, 1.0); | |
uniform vec2 shadow_offset = vec2(0.5,0.2); |
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; | |
// quick test for how large a texel in on-screen in pixels | |
uniform sampler2D test_texture:filter_nearest; | |
void fragment() { | |
vec2 uv_per_texel = vec2(1.0, 1.0) / vec2(textureSize(test_texture, 0)); | |
vec2 dfx = dFdx(UV); | |
vec2 dfy = dFdy(UV); | |
vec2 uv_per_pixel = vec2(length(vec2(dfx.x, dfy.x)), length(vec2(dfx.y, dfy.y))); |
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 moon_texture:source_color, repeat_disable; | |
// updirection of moon texture will try to align with this | |
uniform vec3 north = vec3(0, 0, -1); | |
void sky() { | |
vec3 light_dir = normalize(-LIGHT0_DIRECTION); | |
vec3 side_dir = normalize(cross(light_dir, north)); |
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
start | end | |
---|---|---|
73 | 1 | |
46 | 5 | |
55 | 7 | |
8 | 26 | |
48 | 9 | |
52 | 11 | |
59 | 17 | |
83 | 19 | |
21 | 82 |
NewerOlder