Added new Shadow SSS Lut;
Fixed the issue that SSGI and SSAO weight not works properly;
This commit is contained in:
@@ -37,7 +37,9 @@ namespace Misaki.HdrpToon.Editor
|
||||
private RenderTexture _previewTexture;
|
||||
private RenderTextureDescriptor _previewDescriptor;
|
||||
|
||||
public bool isShadowLut;
|
||||
public float scatterRadius = 1.0f;
|
||||
public float positionShift = 0.0f;
|
||||
public float intensity = 1.0f;
|
||||
public Quality sampleCount = Quality.Low;
|
||||
public bool applyTonemap = true;
|
||||
@@ -78,7 +80,10 @@ namespace Misaki.HdrpToon.Editor
|
||||
return false;
|
||||
}
|
||||
|
||||
var kernelIndex = isShadowLut ? 1 : 0;
|
||||
|
||||
_bakerShader.SetFloat("_ScatterRadius", scatterRadius);
|
||||
_bakerShader.SetFloat("_PositionShift", positionShift);
|
||||
_bakerShader.SetFloat("_Intensity", intensity);
|
||||
_bakerShader.SetInt("_SampleCount", (int)sampleCount);
|
||||
_bakerShader.SetInt("_ApplyTonemap", applyTonemap ? 1 : 0);
|
||||
@@ -86,13 +91,13 @@ namespace Misaki.HdrpToon.Editor
|
||||
|
||||
_bakerShader.SetKeyword(new LocalKeyword(_bakerShader, "_PRODUCTION"), production);
|
||||
|
||||
_bakerShader.SetTexture(0, "_SSSLut", texture);
|
||||
_bakerShader.SetTexture(kernelIndex, "_SSSLut", texture);
|
||||
|
||||
const int groupSizeX = 8;
|
||||
const int groupSizeY = 8;
|
||||
var threadGroupX = (textureSize + (groupSizeX - 1)) / groupSizeX;
|
||||
var threadGroupY = (textureSize + (groupSizeY - 1)) / groupSizeY;
|
||||
_bakerShader.Dispatch(0, threadGroupX, threadGroupY, 1);
|
||||
_bakerShader.Dispatch(kernelIndex, threadGroupX, threadGroupY, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user