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
Shader "Skin Clip Alpha" {
Properties {
_MainTex ("Albedo(RGB) , Roughness(A)", 2D) = "white" {}
[HDR]_Color ("BaseColor", Color) = (1,1,1,1)
[HideInInspector]_Specular ("Specular", Range(0, 1)) = 0.28
_Roughness ("Roughness", Range(0, 1)) = 0.5
[NoScaleOffset]_SurfaceTangentMap ("Normal Map", 2D) = "bump" {}
_OcclusionStrength ("Occlusion", Range(0, 1)) = 0.8
_Reflection ("Reflection", Range(0, 5)) = 1
[Header(SKIN BRDF)]
//Propertices related of Tone map.
[Header(TONE MAPPER)]//// Neutral tonemapping (Hable/Hejl/Frostbite)
[Toggle] _toggleToneMapper("Tone Mapper" , FLOAT) = 0
_a("Segment A" , Range(0.1, 1)) = 0.2
_b("Segment B" , Range(0.1, 1)) = 0.29
_c("Segment C" , Range(0.1, 1)) = 0.24
_d("Segment D" , Range(0.1, 1)) = 0.272
_e("Segment E" , Range(0.01, 0.1)) = 0.02
_f("Segment F" , Range(0.1, 1)) = 0.3
_WhiteLevel("ToneMappe White Level" , Range(1.3, 5.3)) = 2.3
#if _USESUBLIGHT
static bool _UseSubLight = true;
#else
static bool _UseSubLight = false;
#endif
uniform half _SubLightScale;
#if USE_SECOND_DIRECTIONAL_LIGHT
@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 / BuildConfiguration.xml
Created April 26, 2020 15:31
UE4 Disable to UnityBuild Configuation
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<bUseUnityBuild>false</bUseUnityBuild>
<bUsePCHFiles>false</bUsePCHFiles>
</BuildConfiguration>
</Configuration>
@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^
Shader "ASE_DualMatcap"
{
Properties
{
_FrontParaboloid ("_FrontParaboloid", 2D) = "white" { }
_RearParaboloid ("_RearParaboloid", 2D) = "white" { }
_Albedo("Albedo", 2D) = "white" {}
_Float0("Float 0", Range( 0 , 2)) = 1
[HideInInspector] _texcoord( "", 2D ) = "white" {}
Shader /*ase_name*/ "Leegoonz/ASETemplateShaders/ParabolicMatcap" /*end*/
{
Properties
{
_FrontParaboloid ("_FrontParaboloid", 2D) = "white" { }
_RearParaboloid ("_RearParaboloid", 2D) = "white" { }
/*ase_props*/
}
SubShader