add AutoExposure
This commit is contained in:
parent
e9583e6fdc
commit
d694bdc43b
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22bff87638890aa4c9ea2a933d910433
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace X.Rendering.Feature
|
||||
{
|
||||
public class AutoExposure : ScriptableRendererFeature
|
||||
{
|
||||
[Serializable]
|
||||
public class Settings
|
||||
{
|
||||
public RenderPassEvent renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
|
||||
public Material BlitMat;
|
||||
public ComputeShader Compute;
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
Settings settings;
|
||||
AutoExposurePass autoExposurePass;
|
||||
|
||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||
{
|
||||
renderer.EnqueuePass(autoExposurePass);
|
||||
}
|
||||
|
||||
public override void Create()
|
||||
{
|
||||
autoExposurePass = new(settings);
|
||||
}
|
||||
|
||||
class AutoExposurePass : ScriptableRenderPass
|
||||
{
|
||||
private Settings settings;
|
||||
private int computeCounter;
|
||||
private ProfilingSampler profiler;
|
||||
private ComputeBuffer outputBuffer;
|
||||
|
||||
private static readonly int Dims = Shader.PropertyToID("_Dims");
|
||||
private static readonly int Source = Shader.PropertyToID("_Source");
|
||||
private static readonly int TempOut = Shader.PropertyToID("_OutBuffer");
|
||||
private static readonly int ScreenExposureProp = Shader.PropertyToID("_Exposure");
|
||||
private static readonly int ExposureRangeProp = Shader.PropertyToID("_Range");
|
||||
private static readonly int WhitePointProp = Shader.PropertyToID("_WhitePoint");
|
||||
private static readonly int MaxBrightness = Shader.PropertyToID("_MaxBrightness");
|
||||
private static readonly int BlitTextureId = Shader.PropertyToID("_BlitTexture");
|
||||
|
||||
|
||||
private const int ThreadGroupSize = 32;
|
||||
|
||||
private Vector2Int lastSize = Vector2Int.zero;
|
||||
|
||||
private static float targetExposure = 0.1f;
|
||||
private static float currentExposure = 0.1f;
|
||||
private static AutoExposureVolumeProfile autoExposureVolume = null;
|
||||
private static float lastTime = 0.0f;
|
||||
private static bool autoExposureing = false;
|
||||
|
||||
public AutoExposurePass(Settings settings)
|
||||
{
|
||||
this.settings = settings;
|
||||
renderPassEvent = settings.renderPassEvent;
|
||||
profiler = new(nameof(AutoExposurePass));
|
||||
}
|
||||
|
||||
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
|
||||
{
|
||||
var stack = VolumeManager.instance.stack;
|
||||
autoExposureVolume = stack.GetComponent<AutoExposureVolumeProfile>();
|
||||
if (!autoExposureVolume || !autoExposureVolume.IsActive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var cmd = renderingData.commandBuffer;
|
||||
using var scp = new ProfilingScope(cmd, profiler);
|
||||
if (computeCounter % Mathf.Max(autoExposureVolume.framesPerCompute.value, 1.0f) == 0)
|
||||
{
|
||||
computeCounter = 0;
|
||||
var textureDesc = renderingData.cameraData.cameraTargetDescriptor;
|
||||
|
||||
Vector2Int size = new(textureDesc.width, textureDesc.height);
|
||||
if(outputBuffer == null || lastSize != size)
|
||||
{
|
||||
lastSize = size;
|
||||
outputBuffer?.Dispose();
|
||||
outputBuffer = new ComputeBuffer(Mathf.CeilToInt((float)size.y / ThreadGroupSize * 2), 4, ComputeBufferType.Structured)
|
||||
{
|
||||
name = "Auto Exposure Output Buffer"
|
||||
};
|
||||
}
|
||||
cmd.SetComputeIntParams(settings.Compute, Dims, size.x, size.y);
|
||||
|
||||
cmd.SetComputeTextureParam(settings.Compute, 0, Source, renderingData.cameraData.renderer.cameraColorTargetHandle);
|
||||
cmd.SetComputeBufferParam(settings.Compute, 0, TempOut, outputBuffer);
|
||||
cmd.DispatchCompute(settings.Compute, 0, size.y, 1, 1);
|
||||
AsyncGPUReadback.Request(outputBuffer, OnCompleteReadBack);
|
||||
}
|
||||
++computeCounter;
|
||||
if (!autoExposureing)
|
||||
{
|
||||
//return;
|
||||
}
|
||||
UpdateExposure();
|
||||
settings.BlitMat.SetFloat(ScreenExposureProp, currentExposure);
|
||||
settings.BlitMat.SetVector(ExposureRangeProp, autoExposureVolume.exposureRange.value);
|
||||
settings.BlitMat.SetFloat(WhitePointProp, autoExposureVolume.whitePoint.value);
|
||||
settings.BlitMat.SetFloat(MaxBrightness, autoExposureVolume.brightnessLimit.value);
|
||||
var renderer = renderingData.cameraData.renderer;
|
||||
settings.BlitMat.SetTexture(BlitTextureId, renderer.cameraColorTargetHandle);
|
||||
var destination = renderer.GetCameraColorFrontBuffer(cmd);
|
||||
cmd.SetRenderTarget(destination, loadAction: RenderBufferLoadAction.DontCare, storeAction: RenderBufferStoreAction.Store);
|
||||
cmd.DrawProcedural(Matrix4x4.identity, settings.BlitMat, 0, MeshTopology.Triangles, 3);
|
||||
renderer.SwapColorBuffer(cmd);
|
||||
}
|
||||
|
||||
private static void OnCompleteReadBack(AsyncGPUReadbackRequest request)
|
||||
{
|
||||
if (request.hasError)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Compute result
|
||||
float[] groupValues = request.GetData<float>().ToArray();
|
||||
|
||||
// Add up all the workgroup's results
|
||||
double pixelLumTotal = 0;
|
||||
uint pixels = 0;
|
||||
for (int i = 0; i < groupValues.Length / 2; i++)
|
||||
{
|
||||
pixelLumTotal += groupValues[i * 2];
|
||||
pixels += (uint)Mathf.CeilToInt(groupValues[i * 2 + 1]);
|
||||
}
|
||||
|
||||
// Average the results and set as the target exposure
|
||||
targetExposure = (float)(pixelLumTotal / pixels);
|
||||
autoExposureing = true;
|
||||
}
|
||||
|
||||
public static float ExpDecay(float a, float b, float decay, float deltaTime) => b + (a - b) * Mathf.Exp(-decay * deltaTime);
|
||||
|
||||
private static void UpdateExposure()
|
||||
{
|
||||
// Delta time, using the built-in one seems to flicker a lot, weird
|
||||
float deltaTime = Time.time - lastTime;
|
||||
lastTime = Time.time;
|
||||
|
||||
// Exposure difference, skip if zero
|
||||
float diff = targetExposure - currentExposure;
|
||||
if (Mathf.Approximately(diff,0))
|
||||
{
|
||||
autoExposureing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
float decay = diff > 0 ? autoExposureVolume.increaseSpeed.value : autoExposureVolume.decreaseSpeed.value;
|
||||
currentExposure = ExpDecay(currentExposure, targetExposure, decay, deltaTime);
|
||||
|
||||
if (float.IsNaN(currentExposure))
|
||||
{
|
||||
currentExposure = 0.1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d34dacd53c1ace84a8c6ac5ff4afb555
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace X.Rendering.Feature
|
||||
{
|
||||
public class AutoExposureVolumeProfile : VolumeComponent, IPostProcessComponent
|
||||
{
|
||||
[Tooltip("How many frames it takes to recalculate the average brightness. Decreasing this value can affect performance.")]
|
||||
public ClampedIntParameter framesPerCompute = new(5, 1, 20);
|
||||
|
||||
[Space]
|
||||
[Tooltip("Limits the maximum brightness for very bright objects to work properly with bloom and other effects")]
|
||||
public FloatParameter brightnessLimit = new(15f);
|
||||
|
||||
[Tooltip("For reinhard tonemapping")]
|
||||
public FloatParameter whitePoint = new(3f);
|
||||
|
||||
[Tooltip("How much an individual pixel's exposure can vary from the original value.")]
|
||||
public FloatRangeParameter exposureRange = new(new Vector2(-2.5f, 0.6f), -6.0f, 6.0f);
|
||||
|
||||
[Space]
|
||||
[Tooltip("How quickly the exposure increases")]
|
||||
public FloatParameter increaseSpeed = new(5f);
|
||||
|
||||
[Tooltip("How quickly the exposure decreases")]
|
||||
public FloatParameter decreaseSpeed = new(5f);
|
||||
|
||||
public bool IsActive() => framesPerCompute.overrideState;
|
||||
|
||||
public bool IsTileCompatible()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af08f034e95c2d246b0cbaf4305dfbc4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e293ab2d371d5a04c941cba0a04a7ecc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,116 @@
|
||||
Shader "XRP/AutoExposure"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType"="Opaque"
|
||||
}
|
||||
ZWrite Off Cull Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Auto Exposure Pass"
|
||||
|
||||
HLSLPROGRAM
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
|
||||
|
||||
// #pragma enable_d3d11_debug_symbols
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
SamplerState sampler_BlitTexture; // Screen texture
|
||||
|
||||
float _MaxBrightness; // Limit the final brightness to this value
|
||||
float _Exposure; // The average exposure to work with
|
||||
float _WhitePoint; // White point for reinhard tonemapping
|
||||
float2 _Range;
|
||||
// Min and Max luminosity change, how much can each pixel be offset from it's original luminosity
|
||||
|
||||
// Converts from RGB space to Yxy (float3.x is Luminance)
|
||||
float3 convert_rgb_to_Yxy(float3 rgb)
|
||||
{
|
||||
float3 xyz;
|
||||
xyz.x = dot(rgb, float3(0.4124f, 0.3576f, 0.1805f));
|
||||
xyz.y = dot(rgb, float3(0.2126f, 0.7152f, 0.0722f));
|
||||
xyz.z = dot(rgb, float3(0.0193f, 0.1192f, 0.9505f));
|
||||
|
||||
float sum = xyz.x + xyz.y + xyz.z;
|
||||
|
||||
float x = (sum > 0.0) ? (xyz.x / sum) : 0.0;
|
||||
float y = (sum > 0.0) ? (xyz.y / sum) : 0.0;
|
||||
|
||||
return float3(xyz.y, x, y); // Y, x, y
|
||||
}
|
||||
|
||||
// Converts from Yxy (float3.x is Luminance) space to RGB
|
||||
float3 convert_Yxy_to_rgb(float3 Yxy)
|
||||
{
|
||||
float Y = Yxy.x;
|
||||
float x = Yxy.y;
|
||||
float y = Yxy.z;
|
||||
|
||||
float X = y > 0.0 ? x * Y / y : 0.0;
|
||||
float Z = y > 0.0 ? (1.0 - x - y) * Y / y : 0.0;
|
||||
|
||||
float3 XYZ = float3(X, Y, Z);
|
||||
|
||||
float3x3 M_XYZ2RGB = float3x3(
|
||||
3.2406f, -1.5372f, -0.4986f,
|
||||
-0.9689f, 1.8758f, 0.0415f,
|
||||
0.0557f, -0.2040f, 1.0570f
|
||||
);
|
||||
|
||||
return mul(M_XYZ2RGB, XYZ);
|
||||
}
|
||||
|
||||
// Tone Mapping function
|
||||
float reinhard2(float lp, float wp)
|
||||
{
|
||||
return lp * (1.0f + lp / (wp * wp)) / (1.0f + lp);
|
||||
}
|
||||
|
||||
// Sample texture and return RGB and A in separate variables
|
||||
void sample_split(float2 uv, out float3 rgb, out float alpha)
|
||||
{
|
||||
float4 color = _BlitTexture.SampleBias(sampler_BlitTexture, uv, _GlobalMipBias.x);;
|
||||
rgb = color.rgb;
|
||||
alpha = color.a;
|
||||
}
|
||||
|
||||
|
||||
Varyings vert(uint vertexID: SV_VertexID)
|
||||
{
|
||||
Varyings o;
|
||||
o.positionCS = GetFullScreenTriangleVertexPosition(vertexID);
|
||||
o.texcoord = GetFullScreenTriangleTexCoord(vertexID);
|
||||
return o;
|
||||
}
|
||||
|
||||
// Fragment shader, adaptation of: https://bruop.github.io/tonemapping/
|
||||
float4 frag(Varyings input) : SV_Target
|
||||
{
|
||||
float3 rgb;
|
||||
float alpha;
|
||||
sample_split(input.texcoord, rgb, alpha);
|
||||
|
||||
// Yxy.x is Y, the luminance
|
||||
float3 Yxy = convert_rgb_to_Yxy(rgb);
|
||||
Yxy.x = min(Yxy.x, _MaxBrightness);
|
||||
|
||||
// Tone mapping
|
||||
float lp = Yxy.x / (9.6f * _Exposure + 0.0001f);
|
||||
float new_lum = reinhard2(lp, _WhitePoint);
|
||||
|
||||
// Clamp the added luminosity and convert back to RGB
|
||||
Yxy.x += clamp(new_lum - Yxy.x, _Range.x, _Range.y);
|
||||
rgb = convert_Yxy_to_rgb(Yxy);
|
||||
|
||||
return float4(rgb, alpha);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86423a03f0e6a0441b2b00ff89b6c753
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,68 @@
|
||||
#pragma kernel Main KERNEL_SCAN
|
||||
|
||||
// 32 or 64 should be ok
|
||||
#define THREAD_COUNT 32
|
||||
|
||||
// I/O
|
||||
uint2 _Dims; // Screen Dimensions
|
||||
Texture2D _Source; // Screen Texture
|
||||
RWStructuredBuffer<float> _OutBuffer; // Compute Group Output
|
||||
|
||||
// Shared row values
|
||||
groupshared float rows_lum[THREAD_COUNT];
|
||||
groupshared uint rows_pixels[THREAD_COUNT];
|
||||
|
||||
// Weird ass function for doing things with the luminosity, looks great on desmos
|
||||
float weird_ass_function(float x)
|
||||
{
|
||||
x += 0.1f;
|
||||
float w = 32.0f;
|
||||
return x * (x + w) / (w * x + 0.154f) - 0.137f;
|
||||
}
|
||||
|
||||
// Convert screen coordinates to the pixel's luminosity
|
||||
float get_screen_lum(uint x, uint y)
|
||||
{
|
||||
return dot(_Source[uint2(x, y)].rgb, float3(0.21267291f, 0.7151522f, 0.0721750f));
|
||||
}
|
||||
|
||||
// Each thread corresponds to a Y coordinate on the screen and is in charge of the whole row
|
||||
[numthreads(THREAD_COUNT, 1, 1)]
|
||||
void Main(uint group : SV_GroupID, uint thread : SV_GroupThreadID, uint y : SV_DispatchThreadID)
|
||||
{
|
||||
float lum_row = 0;
|
||||
uint pixels = 0;
|
||||
|
||||
// Get the total pixels and luminosity of each row
|
||||
if (y < _Dims.y)
|
||||
{
|
||||
for (uint x = 0; x < _Dims.x; x++)
|
||||
{
|
||||
pixels++;
|
||||
lum_row += get_screen_lum(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
// Store the results in the shared arrays
|
||||
rows_lum[thread] = lum_row;
|
||||
rows_pixels[thread] = pixels;
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
|
||||
// The thread id:0 of each workgroup is in charge of adding upp all the values of the threads in its group
|
||||
if (thread == 0)
|
||||
{
|
||||
float groupLumAvg = 0;
|
||||
uint groupPixels = 0;
|
||||
|
||||
// Add upp everything
|
||||
for (int row = 0; row < THREAD_COUNT; row++)
|
||||
{
|
||||
groupLumAvg += rows_lum[row];
|
||||
groupPixels += rows_pixels[row];
|
||||
}
|
||||
|
||||
// Store the group's luminosity and pixel count in the output buffer
|
||||
_OutBuffer[group * 2] = groupLumAvg;
|
||||
_OutBuffer[group * 2 + 1] = groupPixels;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6febb5a945f3510429c58ed4a45c1846
|
||||
ComputeShaderImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,29 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: XRP_AutoExposure
|
||||
m_Shader: {fileID: 4800000, guid: 86423a03f0e6a0441b2b00ff89b6c753, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs: []
|
||||
m_Ints: []
|
||||
m_Floats: []
|
||||
m_Colors: []
|
||||
m_BuildTextureStacks: []
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b04591ed716b35e41857f554d491ef4b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "Unlit/Blur"
|
||||
Shader "XRP/Blur"
|
||||
{
|
||||
|
||||
SubShader
|
||||
@ -87,5 +87,58 @@ Shader "Unlit/Blur"
|
||||
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
||||
Pass
|
||||
{
|
||||
NAME "KawaseBlu"
|
||||
|
||||
HLSLPROGRAM
|
||||
|
||||
#pragma vertex KawaseBlurVert
|
||||
#pragma fragment KawaseBlurFrag
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionHCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float2 uvTopRight : TEXCOORD1;
|
||||
float2 uvTopLeft : TEXCOORD2;
|
||||
float2 uvBottomRight : TEXCOORD3;
|
||||
float2 uvBottomLeft : TEXCOORD4;
|
||||
};
|
||||
|
||||
float _KawaseBlurOffset;
|
||||
TEXTURE2D(_BlitTexture);
|
||||
SAMPLER(sampler_LinearClamp);
|
||||
float4 _BlitTexture_TexelSize;
|
||||
|
||||
Varyings KawaseBlurVert(uint vertexID: SV_VertexID)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionHCS = GetFullScreenTriangleVertexPosition(vertexID);
|
||||
float2 uv = GetFullScreenTriangleTexCoord(vertexID);
|
||||
output.uv = uv;
|
||||
output.uvTopRight = output.uv + float2( _KawaseBlurOffset, _KawaseBlurOffset) * _BlitTexture_TexelSize.xy;
|
||||
output.uvTopLeft = output.uv + float2(-_KawaseBlurOffset, _KawaseBlurOffset) * _BlitTexture_TexelSize.xy;
|
||||
output.uvBottomRight = output.uv + float2( _KawaseBlurOffset, -_KawaseBlurOffset) * _BlitTexture_TexelSize.xy;
|
||||
output.uvBottomLeft = output.uv + float2(-_KawaseBlurOffset, -_KawaseBlurOffset) * _BlitTexture_TexelSize.xy;
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 KawaseBlurFrag(Varyings input) : SV_Target
|
||||
{
|
||||
float4 color = SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, input.uv) * 0.2;
|
||||
color += SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, input.uvTopRight) * 0.2;
|
||||
color += SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, input.uvTopLeft) * 0.2;
|
||||
color += SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, input.uvBottomRight) * 0.2;
|
||||
color += SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, input.uvBottomLeft) * 0.2;
|
||||
return float4(color.rgb, 1.0);
|
||||
}
|
||||
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "Unlit/PlanarShadow"
|
||||
Shader "XRP/PlanarShadow"
|
||||
{
|
||||
|
||||
SubShader
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "Unlit/SoftShadowMask"
|
||||
Shader "XRP/SoftShadowMask"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "MRP/SR/GSR1"
|
||||
Shader "XRP/SR/GSR1"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "MRP/SR/GSR2"
|
||||
Shader "XRP/SR/GSR2"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Shader "Unlit/XessRcas"
|
||||
Shader "XRP/XessRcas"
|
||||
{
|
||||
|
||||
SubShader
|
||||
|
||||
@ -170,7 +170,7 @@ Shader "Universal Render Pipeline/Lit"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
#pragma multi_compile_vertex _ ENABLE_VS_SKINNING
|
||||
#pragma enable_d3d11_debug_symbols
|
||||
// #pragma enable_d3d11_debug_symbols
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl"
|
||||
ENDHLSL
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user