Skip to content

Instantly share code, notes, and snippets.

View leegoonz's full-sized avatar

jplee leegoonz

View GitHub Profile
@leegoonz
leegoonz / ShaderStripper.cs
Created March 4, 2024 09:40 — forked from yasirkula/ShaderStripper.cs
Stripping commonly unused shader variants in Unity's built-in render pipeline
//#define SHADER_COMPILATION_LOGGING
//#define SKIP_SHADER_COMPILATION
using System.Collections.Generic;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
public class ShaderStripper : IPreprocessShaders
@leegoonz
leegoonz / dishonored2_cvars.txt
Created November 16, 2021 08:54 — forked from fakuivan/dishonored2_cvars.txt
All cvars for Dishonored 2 as of version ``1.77.9.0``, in the format: <cvar struct address> | <cvar name> = <cvar default value> | <cvar int value address> -> <current int value>\n<cvar description>
Dishonored2.exe+3BFC7F0 | aas_subdivisionSize = 64 | Dishonored2.exe+3BFC818 -> 64
the size of subdivisions to use for debug drawing
Dishonored2.exe+340CC20 | achievements_Verbose = 0 | Dishonored2.exe+340CC48 -> 0
debug spam for achievements
Dishonored2.exe+3BFA570 | ai_debugCam = 0 | Dishonored2.exe+3BFA598 -> 0
enable debug camera
Dishonored2.exe+3BFA470 | ai_debugScript = -1 | Dishonored2.exe+3BFA498 -> 4294967295
using System;
using UnityEngine;
[AttributeUsage(AttributeTargets.Field)]
public class MinMaxSliderAttribute : PropertyAttribute
{
public readonly float max;
public readonly float min;
@leegoonz
leegoonz / UE4-build.bat
Created April 26, 2020 15:19 — forked from drewsberry/UE4-build.bat
UE4 Windows command line building
:: Build client
RunUAT BuildCookRun -project="full_path.uproject"^
-noP4 -platform=Win64^
-clientconfig=Development -serverconfig=Development^
-cook -allmaps -build -stage^
-pak -archive -archivedirectory="Output Directory"
:: Cook client
RunUAT BuildCookRun -project="full_project_path_and_project_name".uproject^
-noP4 -platform=Win64^
@leegoonz
leegoonz / Standard-2Sided.shader
Created May 13, 2019 20:53 — forked from unitycoder/Standard-2Sided-FixNormals.shader
Standard Shader - 2 Sided (cull off)
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Standard 2-Sided"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
@leegoonz
leegoonz / XRay2017.shader
Created May 13, 2019 20:50 — forked from unitycoder/XRay2017.shader
XRay Shader 2017
// xray mouse pos shader test v2.0 - mgear - http://unitycoder.com/blog
Shader "UnityLibrary/Effects/XRay2017"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_ObjPos ("ObjPos", Vector) = (1,1,1,1)
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
_Radius ("HoleRadius", Range(0.1,5)) = 2
@leegoonz
leegoonz / Terrain_FirstPass.shader
Created January 18, 2017 13:19 — forked from radiatoryang/Terrain_FirstPass.shader
A masked-blend terrain shader hack for Unity.
Shader "Nature/Terrain/Diffuse" {
Properties {
[HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {}
[HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {}
[HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {}
[HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {}
[HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {}
// used in fallback on old cards & base map
[HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
[HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
@leegoonz
leegoonz / SkinnedMeshObjectPreviewExample.cs
Created January 18, 2017 13:18 — forked from radiatoryang/SkinnedMeshObjectPreviewExample.cs
An example of a custom ObjectPreview rendering out a SkinnedMesh for Unity Editor C#... I used it for facial expressions and blendshape editing, you might want to use it for something else. I hereby place it under MIT License. Full write-up here: http://www.blog.radiator.debacle.us/2016/06/working-with-custom-objectpreviews-and.html
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
[CustomPreview(typeof(YourCustomScriptableObject))] // THIS IS VERY IMPORTANT, this is so the editor knows what this is supposed to be previewing at all
public class SkinnedMeshObjectPreviewExample : ObjectPreview {
PreviewRenderUtility m_PreviewUtility;
@leegoonz
leegoonz / ComputeOcclusionFromDepth.shader
Created October 31, 2016 13:18 — forked from aras-p/ComputeOcclusionFromDepth.shader
Unity command buffer that modifies screenspace shadow mask
Shader "Hidden/ComputeOcclusion"
{
Properties
{
_MainTex ("", 2D) = "white" {}
}
SubShader
{
Pass
{
@leegoonz
leegoonz / Debug.cs
Created August 31, 2016 17:50 — forked from kimsama/Debug.cs
It overrides UnityEngine.Debug to mute debug messages completely on a platform-specific basis. [Edit] Added isDebugBuild property.
//#if UNITY_EDITOR
//#define DEBUG
//#endif
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngineInternal;