Evgenii Golubev
7 年前
当前提交
7ddb7cdc
共有 6 个文件被更改,包括 22 次插入 和 107 次删除
-
6ScriptableRenderPipeline/Core/ShaderLibrary/ImageBasedLighting.hlsl
-
16ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
-
40ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitReference.hlsl
-
10ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/ComputeGgxEnergyCompensationFactors.shader.meta
-
55ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/ComputeGgxEnergyCompensationFactors.shader
|
|||
fileFormatVersion: 2 |
|||
guid: c7c7d11c211eb5746b7fe3d016ae62e8 |
|||
timeCreated: 1508422200 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/HDRenderPipeline/ComputeGgxEnergyCompensationFactors" |
|||
{ |
|||
SubShader { |
|||
Pass { |
|||
ZTest Always Cull Off ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#pragma vertex Vert |
|||
#pragma fragment Frag |
|||
#pragma target 4.5 |
|||
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go further in dev |
|||
|
|||
#include "../../../../Core/ShaderLibrary/Common.hlsl" |
|||
#include "../../../../Core/ShaderLibrary/ImageBasedLighting.hlsl" |
|||
#include "../../../ShaderVariables.hlsl" |
|||
|
|||
struct Attributes |
|||
{ |
|||
uint vertexID : SV_VertexID; |
|||
}; |
|||
|
|||
struct Varyings |
|||
{ |
|||
float4 positionCS : SV_POSITION; |
|||
float2 texCoord : TEXCOORD0; |
|||
}; |
|||
|
|||
Varyings Vert(Attributes input) |
|||
{ |
|||
Varyings output; |
|||
|
|||
output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID); |
|||
output.texCoord = GetFullScreenTriangleTexCoord(input.vertexID); |
|||
|
|||
return output; |
|||
} |
|||
|
|||
float4 Frag(Varyings input) : SV_Target |
|||
{ |
|||
// These coordinate sampling must match the decoding in GetPreIntegratedDFG in lit.hlsl, i.e here we use perceptualRoughness, must be the same in shader |
|||
float NdotV = input.texCoord.x; |
|||
float roughness = PerceptualRoughnessToRoughness(input.texCoord.y); |
|||
float3 N = float3(0, 0, 1); |
|||
float3 V = float3(sqrt(1 - NdotV * NdotV), 0, NdotV); |
|||
|
|||
float cbsdfInt = IntegrateGgxWithoutFresnel(V, N, roughness); |
|||
|
|||
return cbsdfInt.xxxx; |
|||
} |
|||
|
|||
ENDHLSL |
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue