Skip to content

Instantly share code, notes, and snippets.

View StagPoint's full-sized avatar

StagPoint Software StagPoint

  • StagPoint Software
  • Seattle, WA
View GitHub Profile
@bgolus
bgolus / PristineMajorMinorGrid.shader
Last active May 12, 2025 11:56
Pristine Grid applied to a grid that has support for major and minor lines and colored axis lines
Shader "Pristine Major Minor Grid"
{
Properties
{
[KeywordEnum(X, Y, Z)] _Axis ("Plane Axis", Float) = 1.0
[IntRange] _MajorGridDiv ("Major Grid Divisions", Range(2,25)) = 10.0
_AxisLineWidth ("Axis Line Width", Range(0,1.0)) = 0.04
_MajorLineWidth ("Major Line Width", Range(0,1.0)) = 0.02
_MinorLineWidth ("Minor Line Width", Range(0,1.0)) = 0.01
@h3r2tic
h3r2tic / raymarch.hlsl
Last active April 29, 2025 19:17
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"
@alexanderameye
alexanderameye / CircularMenu.cs
Last active April 28, 2025 08:27
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Longor1996
Longor1996 / MF_GridLines.T3D
Created November 28, 2022 15:04
Unreal Engine 5 - Material Function - GridLines
Begin Object Class=/Script/Engine.MaterialFunction Name="MF_GridLines"
Begin Object Class=/Script/Engine.Material Name="Material_0"
Begin Object Class=/Script/Engine.MaterialEditorOnlyData Name="Material_0EditorOnlyData"
End Object
End Object
Begin Object Class=/Script/Engine.MaterialExpressionMaterialFunctionCall Name="MaterialExpressionMaterialFunctionCall_14"
End Object
Begin Object Class=/Script/Engine.MaterialExpressionMax Name="MaterialExpressionMax_2"
End Object
Begin Object Class=/Script/Engine.MaterialExpressionFunctionOutput Name="MaterialExpressionFunctionOutput_1"
@alexanderameye
alexanderameye / SceneSwitcherToolbarOverlay.cs
Last active April 28, 2025 09:12
A small scene switcher utility for Unity
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.Overlays;
using UnityEditor.SceneManagement;
using UnityEditor.Toolbars;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UIElements;
@tattyd
tattyd / Shadow.cs
Last active April 1, 2025 08:26
Soft shadow control for Unity UI Toolkit
/* MIT License
Copyright (c) 2022 David Tattersall
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@brihernandez
brihernandez / NavMeshAreaIDs.cs
Last active June 20, 2022 19:07
Simple wrapper classes for handling Navmesh Area related operations in Unity.
using UnityEngine.AI;
/// <summary>
/// Convenience class for handling NavMesh Area related operations and lookups in Unity.
/// </summary>
public readonly struct UnityNavMeshLayer
{
/// <summary>
/// Name of the Area as defined in the Navigation window in Unity.
/// </summary>
@markeahogan
markeahogan / IMGUIRectExtensions.cs
Last active June 16, 2024 18:09
Utility functions for IMGUI Rects, useful for drawing PropertyFields in a single line without lots of Rect boilerplate
using UnityEngine;
namespace PopupAsylum
{
/// <summary>
/// Utility functions for IMGUI Rects, useful for drawing PropertyFields in a single line
/// Works by returning the Rect to draw the contol and filling the out argument with a Rect for the remaining space
/// By passing the same Rect to the out member it can keep eating chunks of the property's Rect
///
/// void ExampleDrawer(SerializedProperty property, Rect rect)
@dwilliamson
dwilliamson / MarchingCubes.js
Last active May 9, 2025 00:46
Marching Cubes Lookup Tables
//
// Lookup Tables for Marching Cubes
//
// These tables differ from the original paper (Marching Cubes: A High Resolution 3D Surface Construction Algorithm)
//
// The co-ordinate system has the more convenient properties:
//
// i = cube index [0, 7]
// x = (i & 1) >> 0
// y = (i & 2) >> 1
@bgolus
bgolus / MatCapTechniques.shader
Created January 29, 2022 00:37
Showing multiple matcap techniques, including a proposed improved method that's no more expensive than the usual fix if you're starting with the world position and world normal.
Shader "Unlit/MatCap Techniques"
{
Properties
{
[NoScaleOffset] _MatCap ("MatCap", 2D) = "white" {}
[KeywordEnum(ViewSpaceNormal, ViewDirectionCross, ViewDirectionAligned)] _MatCapType ("Matcap UV Type", Float) = 2
}
SubShader
{
Tags { "RenderType"="Opaque" }