Evgenii Golubev
8 年前
当前提交
e2501e62
共有 4 个文件被更改,包括 133 次插入 和 12 次删除
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawGaussianProfile.shader
-
50Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs
-
84Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader.meta
|
|||
Shader "Hidden/HDRenderPipeline/DrawTransmittanceGraph" |
|||
{ |
|||
Properties |
|||
{ |
|||
[HideInInspector] _StdDev1("", Color) = (0, 0, 0) |
|||
[HideInInspector] _StdDev2("", Color) = (0, 0, 0) |
|||
[HideInInspector] _LerpWeight("", Float) = 0 |
|||
[HideInInspector] _ThicknessScale("", Float) = 0 |
|||
} |
|||
|
|||
SubShader |
|||
{ |
|||
Pass |
|||
{ |
|||
Cull Off |
|||
ZTest Off |
|||
ZWrite Off |
|||
Blend Off |
|||
|
|||
HLSLPROGRAM |
|||
#pragma target 4.5 |
|||
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev |
|||
|
|||
#pragma vertex Vert |
|||
#pragma fragment Frag |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#include "ShaderLibrary/Common.hlsl" |
|||
#include "ShaderLibrary/Color.hlsl" |
|||
#include "HDRenderPipeline/ShaderVariables.hlsl" |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Inputs & outputs |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
float4 _StdDev1, _StdDev2; |
|||
float _LerpWeight, _ThicknessScale; // See 'SubsurfaceScatteringParameters' |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Implementation |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
struct Attributes |
|||
{ |
|||
float3 vertex : POSITION; |
|||
float2 texcoord : TEXCOORD0; |
|||
}; |
|||
|
|||
struct Varyings |
|||
{ |
|||
float4 vertex : SV_POSITION; |
|||
float2 texcoord : TEXCOORD0; |
|||
}; |
|||
|
|||
Varyings Vert(Attributes input) |
|||
{ |
|||
Varyings output; |
|||
output.vertex = TransformWorldToHClip(input.vertex); |
|||
output.texcoord = input.texcoord.xy; |
|||
return output; |
|||
} |
|||
|
|||
float4 Frag(Varyings input) : SV_Target |
|||
{ |
|||
float thickness = input.texcoord.x * _ThicknessScale; |
|||
float t2 = thickness * thickness; |
|||
|
|||
float3 var1 = _StdDev1.rgb * _StdDev1.rgb; |
|||
float3 var2 = _StdDev2.rgb * _StdDev2.rgb; |
|||
|
|||
// See ComputeTransmittance() in Lit.hlsl for more details. |
|||
float3 transmittance = lerp(exp(-t2 * 0.5 * rcp(var1)), |
|||
exp(-t2 * 0.5 * rcp(var2)), _LerpWeight); |
|||
|
|||
return float4(transmittance, 1); |
|||
} |
|||
ENDHLSL |
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4517edda0467bb14489d5eccc9973ba2 |
|||
timeCreated: 1487326565 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue