Skip to content

Instantly share code, notes, and snippets.

@zmarcos
zmarcos / XRay3D.tscn
Last active August 13, 2020 18:24
Godot XRay 3D
[gd_scene load_steps=13 format=2]
[ext_resource path="res://xray_material.tres" type="Material" id=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Spatial
func _ready():
#($Spatial2/CSGBox.material as SpatialMaterial).albedo_color = Color(1.0,1.0,1.0)
pass
@zmarcos
zmarcos / Overlay2D-2.tscn
Created February 19, 2020 03:43
Godot 2D overlay shader (version 2)
[gd_scene load_steps=27 format=2]
[sub_resource type="VisualShaderNodeInput" id=1]
input_name = "light_pass"
[sub_resource type="VisualShaderNodeSwitch" id=2]
[sub_resource type="VisualShaderNodeTexture" id=3]
source = 1
@zmarcos
zmarcos / Overlay2D-1.tscn
Last active February 19, 2020 03:42
Godot 2D overlay shader (version 1)
[gd_scene load_steps=31 format=2]
[sub_resource type="VisualShaderNodeInput" id=1]
input_name = "light_pass"
[sub_resource type="VisualShaderNodeSwitch" id=2]
[sub_resource type="VisualShaderNodeTexture" id=3]
source = 1
@zmarcos
zmarcos / material_checker.tres
Last active July 24, 2024 05:11
Checkers Shadow Material
[gd_resource type="ShaderMaterial" load_steps=7 format=2]
[sub_resource type="VisualShaderNodeGlobalExpression" id=1]
size = Vector2( 690, 490 )
expression = "float checker(vec3 uva){
vec3 c = uva;
c *= 40.0;//square modifier, recommended values (20,40,80,160)
c = mod(trunc(c), 2.0);
float r = 0.0;
if(c.x > 0.0 && c.y < 1.0){
@zmarcos
zmarcos / flipper.gd
Created January 13, 2020 19:38
Godot Flipper
extends Node
func _ready():
# To flip the viewport on Windows (USED FOR TESTING)
if ("Windows" == OS.get_name()) and OS.is_debug_build():
var vp: Viewport = get_tree().get_root()
vp.render_target_v_flip = true