Skip to content

Instantly share code, notes, and snippets.

View HungryProton's full-sized avatar

HungryProton HungryProton

View GitHub Profile
@h3r2tic
h3r2tic / raymarch.hlsl
Last active May 3, 2024 19:26
Depth buffer raymarching for contact shadows, SSGI, SSR, etc.
// Copyright (c) 2023 Tomasz Stachowiak
//
// This contribution is dual licensed under EITHER OF
//
// Apache License, Version 2.0, (http://www.apache.org/licenses/LICENSE-2.0)
// MIT license (http://opensource.org/licenses/MIT)
//
// at your option.
#include "/inc/frame_constants.hlsl"
@YuriSizov
YuriSizov / DrawUtils.gd
Last active June 7, 2021 09:13
GraphEdit Minimap GDScript implementation
extends Object
class_name DrawUtils
# Extracted from graph_node.cpp
static func draw_cos_line(node : Node, from_position : Vector2, to_position : Vector2, from_color : Color, to_color : Color, bezier_len_pos : int, bezier_len_neg : int, line_width : float = 1.0, shadow : bool = false) -> void:
var diff = to_position.x - from_position.x
var cp_offset
var cp_len = bezier_len_pos
var cp_neg_len = bezier_len_neg
@YuriSizov
YuriSizov / NodeUtils.gd
Last active December 19, 2021 19:50
A sample code for Godot Editor plugin to play an arbitrary scene from GDScript
extends Object
class_name NodeUtils
static func get_child_by_class(node : Node, child_class : String, counter : int = 1) -> Node:
var match_counter = 0
var node_children = node.get_children()
for child in node_children:
if (child.get_class() == child_class):
match_counter += 1