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 |
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; | |
// draws black dots at corners | |
uniform float dot_size = 30; // size of dots at vertices | |
varying vec2 vertex_uv; // used to pass fake UV since real UV wasn't behaving as expected | |
void vertex() { | |
vertex_uv = COLOR.rg; // using vertex colour because UV array from Polygon2D wasn't working for me? | |
//vertex_uv = UV; |
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
#Based on Procedural Toolkit by Syomus (https://github.com/Syomus/ProceduralToolkit) | |
@tool | |
extends PrimitiveMesh | |
class_name SuperSphere | |
# generates a supersphere | |
## size of the supersphere | |
@export var radius : float = 1.0: | |
get: |
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 sampler2D ground_texture:source_color, repeat_enable, filter_linear_mipmap; | |
uniform float ground_height = -1.0; | |
uniform float scale = 2.0; | |
varying vec3 world_position; | |
varying vec3 cam_pos; |
NewerOlder