Evgenii Golubev
8 年前
当前提交
01f7c4f9
共有 9 个文件被更改,包括 26 次插入 和 127 次删除
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
33Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader
-
11Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader.meta
-
84Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/DrawGaussianProfile.shader
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
|
|||
fileFormatVersion: 2 |
|||
guid: 2e8a76823cb2af944b4b45169f2649f9 |
|||
timeCreated: 1487181006 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/HDRenderPipeline/DrawGaussianProfile" |
|||
{ |
|||
Properties |
|||
{ |
|||
[HideInInspector] _StdDev1("", Color) = (0, 0, 0) |
|||
[HideInInspector] _StdDev2("", Color) = (0, 0, 0) |
|||
[HideInInspector] _LerpWeight("", 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 "../ShaderVariables.hlsl" |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Inputs & outputs |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
float4 _StdDev1, _StdDev2; float _LerpWeight; // 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 dist = length(input.texcoord - 0.5); |
|||
|
|||
float3 var1 = _StdDev1.rgb * _StdDev1.rgb; |
|||
float3 var2 = _StdDev2.rgb * _StdDev2.rgb; |
|||
|
|||
// Evaluate the linear combination of two 2D Gaussians instead of |
|||
// product of a linear combination of two normalized 1D Gaussians |
|||
// since we do not want to bother artists with the lack of radial symmetry. |
|||
|
|||
float3 magnitude = lerp(exp(-dist * dist / (2 * var1)) / (TWO_PI * var1), |
|||
exp(-dist * dist / (2 * var2)) / (TWO_PI * var2), _LerpWeight); |
|||
|
|||
return float4(magnitude, 1); |
|||
} |
|||
ENDHLSL |
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue