This commit is contained in:
2026-07-07 20:51:18 -07:00
parent d2203c8aa1
commit cc2e7ad95e
20 changed files with 794 additions and 35 deletions
+5 -4
View File
@@ -28,15 +28,16 @@ Material:
- _Brightness: 1.1
- _ColorLevels: 12
- _Contrast: 1.05
- _DepthEdgesEnabled: 1
- _DepthEdgesEnabled: 0
- _DepthThreshold: 0.08
- _EdgeStrength: 1
- _NormalEdgesEnabled: 1
- _MasterEnabled: 1
- _NormalEdgesEnabled: 0
- _NormalThreshold: 1
- _OutlineThickness: 1
- _PixelHeight: 200
- _PixelateEnabled: 1
- _PosterizeEnabled: 1
- _PixelateEnabled: 0
- _PosterizeEnabled: 0
- _Saturation: 1.35
m_Colors:
- _OutlineColorInner: {r: 0, g: 0, b: 0, a: 1}
@@ -2,6 +2,7 @@ Shader "Hidden/ProjectM/PixelOutline"
{
Properties
{
[ToggleUI] _MasterEnabled ("Master (whole effect)", Float) = 1
_PixelHeight ("Pixel Grid Height", Float) = 200
[ToggleUI] _PosterizeEnabled ("Posterize (banded color)", Float) = 1
_ColorLevels ("Posterize Levels / channel", Range(2,64)) = 12
@@ -39,6 +40,7 @@ Shader "Hidden/ProjectM/PixelOutline"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
CBUFFER_START(UnityPerMaterial)
float _MasterEnabled;
float _PixelHeight;
float _PosterizeEnabled;
float _ColorLevels;
@@ -65,6 +67,10 @@ Shader "Hidden/ProjectM/PixelOutline"
{
float2 uv = input.texcoord;
// Master bypass: return the untouched scene (dev on/off for the whole style).
if (_MasterEnabled < 0.5)
return half4(SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_PointClamp, uv).rgb, 1.0);
// Fixed, square-pixel low-res grid derived from a target grid height.
float aspect = _ScreenParams.x / max(_ScreenParams.y, 1.0);
float2 res = float2(max(_PixelHeight * aspect, 1.0), max(_PixelHeight, 1.0));