Skip to content

Instantly share code, notes, and snippets.

View NathoSteveo's full-sized avatar

Nathan Stevenson NathoSteveo

View GitHub Profile
@NathoSteveo
NathoSteveo / GUMDROP.py
Last active October 3, 2024 11:28
[ GUMDROP PANELS ] ADDON FOR BLENDER
bl_info = {
"name": "GUMDROP",
"author": "NathoSteveo",
"version": (1, 0, 0),}
import bpy
import os
import math
import bmesh
using UnityEngine;
using UnityEngine.Events;
[ExecuteInEditMode]
public class SDFTextureGenerator : MonoBehaviour
{
[Header("[ TEXTURE TO SDF ]")]
[SerializeField] Texture _SOURCE_TEXTURE = null;
[SerializeField] Texture _RESULT_TEXTURE = null;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
public class SDFTexture
{
RenderTexture _sdfTexture;
RenderTexture _floodTexture;
ComputeShader _computeShader;
#include "UnityCG.cginc"
#pragma kernel _SeedKernel
#pragma kernel _FloodKernel
#pragma kernel _DistKernel
#pragma kernel _ShowSeedsKernel
#pragma multi_compile_local __ _ADD_BORDERS
#define THREAD_GROUP_WIDTH 8
private MeshFilter filter;
public void CombineGridPointMeshes()
{
combineInstances.Clear();
HashSet<MeshFilter> meshes = new HashSet<MeshFilter>(gridPointMeshes);
foreach (MeshFilter filter in meshes)
{
@tool
extends Node3D
@export var grid_parent: Node3D
var grid_size
var block_size
@export var current_grid_size: int
@export var current_block_size: int
var grid_block = preload("res://assets/open_world/scenes/grid_block.tscn")
var grid_block_mat = preload("res://assets/open_world/shaders/grid_block.tres")
@NathoSteveo
NathoSteveo / ShadowCoord.hlsl
Last active August 23, 2023 14:05
[ Shadow Coord and Shadow Sobel files for Custom Functions in Shader Graph ]
/*
███╗░░██╗░█████╗░████████╗██╗░░██╗░█████╗░  ░██████╗████████╗███████╗██╗░░░██╗███████╗░█████╗░
████╗░██║██╔══██╗╚══██╔══╝██║░░██║██╔══██╗  ██╔════╝╚══██╔══╝██╔════╝██║░░░██║██╔════╝██╔══██╗
██╔██╗██║███████║░░░██║░░░███████║██║░░██║  ╚█████╗░░░░██║░░░█████╗░░╚██╗░██╔╝█████╗░░██║░░██║
██║╚████║██╔══██║░░░██║░░░██╔══██║██║░░██║  ░╚═══██╗░░░██║░░░██╔══╝░░░╚████╔╝░██╔══╝░░██║░░██║
██║░╚███║██║░░██║░░░██║░░░██║░░██║╚█████╔╝  ██████╔╝░░░██║░░░███████╗░░╚██╔╝░░███████╗╚█████╔╝
╚═╝░░╚══╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░  ╚═════╝░░░░╚═╝░░░╚══════╝░░░╚═╝░░░╚══════╝░╚════╝░
*/
//-------------------------------------------------------------------------------[ OPEN WORLD ]
#ifndef SHADOWCOORD_INCLUDED
@NathoSteveo
NathoSteveo / SHADOW_OUTLINE.shader
Last active August 23, 2023 13:50
[ Shadow Outlines and Shadow Colour ]
/*
███╗░░██╗░█████╗░████████╗██╗░░██╗░█████╗░  ░██████╗████████╗███████╗██╗░░░██╗███████╗░█████╗░
████╗░██║██╔══██╗╚══██╔══╝██║░░██║██╔══██╗  ██╔════╝╚══██╔══╝██╔════╝██║░░░██║██╔════╝██╔══██╗
██╔██╗██║███████║░░░██║░░░███████║██║░░██║  ╚█████╗░░░░██║░░░█████╗░░╚██╗░██╔╝█████╗░░██║░░██║
██║╚████║██╔══██║░░░██║░░░██╔══██║██║░░██║  ░╚═══██╗░░░██║░░░██╔══╝░░░╚████╔╝░██╔══╝░░██║░░██║
██║░╚███║██║░░██║░░░██║░░░██║░░██║╚█████╔╝  ██████╔╝░░░██║░░░███████╗░░╚██╔╝░░███████╗╚█████╔╝
╚═╝░░╚══╝╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░  ╚═════╝░░░░╚═╝░░░╚══════╝░░░╚═╝░░░╚══════╝░╚════╝░
*/
//-------------------------------------------------------------------------------[ OPEN WORLD ]
Shader"NATHO/SHADOW_OUTLINE"