View depth_override_shader.gdshader
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
// A Godot 4 shader to make things appear on top of other things within a range. | |
// Initially, this was made so my characters' facial features would be rendered on top of their hair. | |
shader_type spatial; | |
render_mode unshaded; | |
uniform sampler2D depth_texture : hint_depth_texture, repeat_disable, filter_nearest; | |
// Maximum depth we can overdraw relative to the object original depth, in ENGINE UNITS. |
View box_gizmo_plugin.gd
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 EditorSpatialGizmoPlugin | |
var editor_plugin: EditorPlugin | |
var _previous_size | |
func _init(): | |
create_material("lines", Color(1, 1, 1)) | |
create_material("box", Color(1.0, 1.0, 1.0, 0.1)) |
View shader_cache.gd
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
class_name ShaderCache | |
extends Spatial | |
signal stage_completed | |
signal all_shaders_compiled | |
export var shaders_folder := "res://material/shaders/" | |
export var particles_folder := "res://vfx/" |
View grid_shape.gd
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
tool | |
extends Resource | |
class_name GridShape | |
export var size := Vector2.ONE | |
export var grid := [] | |
func _init() -> void: |
View box.gd
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
tool | |
class_name ConceptBoxInput | |
extends Spatial | |
signal input_changed | |
signal property_changed | |
export var size := Vector3.ONE setget set_size |
View smoke_shader.shader
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; | |
uniform sampler2D mask; | |
uniform float min_scale = 0.0; | |
uniform float max_scale = 1.0; | |
varying float scale; | |
float range_lerp(float value, float istart, float istop, float ostart, float oend) { |
View color_space_conversion.shader
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
float lts(float L) { | |
if (abs(L) < 0.0031308) { | |
return 12.92 * L; | |
} | |
return 1.055 * pow(L, (1.0 / 2.4)) - 0.055; | |
} | |
vec3 rgb_to_srgb(vec3 color) { | |
return vec3(lts(color.r), lts(color.g), lts(color.b)); | |
} |
View ui_scaling.gd
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
static func get_scaled_theme(theme: Theme) -> Theme: | |
var scale = get_editor_scale() | |
var res: Theme = theme.duplicate(true) | |
res.default_font.size *= scale | |
for font_name in res.get_font_list("EditorFonts"): | |
var font = res.get_font(font_name, "EditorFonts") | |
font.size *= scale | |
View component.gd
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
""" | |
This is the base Component class. Every component should inherit from this. | |
It only stores data. Its only responsibility is to notify the parent Entity when its | |
created. (Or we could setup something in the Entity to monitor new components | |
but I just find it easier this way) | |
""" | |
extends Node | |
class_name Component |
View node_pool.gd
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
tool | |
extends Node | |
class_name NodePool | |
var _pools := {} | |
func _exit_tree() -> void: | |
clear() |
NewerOlder