浏览代码
Merge pull request #1533 from Unity-Technologies/Add-support-for-multiple-PreIntegratedFGD
Merge pull request #1533 from Unity-Technologies/Add-support-for-multiple-PreIntegratedFGD
HDRP: Add support for multiple PreIntegratedFGD + updte hlsl debug nu…/main
GitHub
7 年前
当前提交
5a626b21
共有 25 个文件被更改,包括 413 次插入 和 156 次删除
-
61com.unity.render-pipelines.core/CoreRP/ShaderLibrary/BSDF.hlsl
-
11com.unity.render-pipelines.core/CoreRP/ShaderLibrary/CommonLighting.hlsl
-
68com.unity.render-pipelines.core/CoreRP/ShaderLibrary/ImageBasedLighting.hlsl
-
3com.unity.render-pipelines.high-definition/HDRP/Editor/RenderPipeline/HDAssetFactory.cs
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Builtin/BuiltinData.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Material/Builtin/BuiltinData.cs.hlsl
-
2com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs
-
8com.unity.render-pipelines.high-definition/HDRP/Material/Decal/Decal.cs.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs
-
48com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.cs.hlsl
-
10com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl
-
106com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.cs
-
17com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/PreIntegratedFGD.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/preIntegratedFGD_CharlieClothLambert.shader
-
12com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs
-
114com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.cs.hlsl
-
4com.unity.render-pipelines.high-definition/HDRP/Material/Unlit/Unlit.cs
-
4com.unity.render-pipelines.high-definition/HDRP/Material/Unlit/Unlit.cs.hlsl
-
5com.unity.render-pipelines.high-definition/HDRP/RenderPipeline/HDStringConstants.cs
-
5com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/HDRenderPipelineResources.asset
-
3com.unity.render-pipelines.high-definition/HDRP/RenderPipelineResources/RenderPipelineResources.cs
-
9com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/preIntegratedFGD_CharlieClothLambert.shader.meta
-
59com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader
-
0/com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/preIntegratedFGD_GGXDisneyDiffuse.shader.meta
-
0/com.unity.render-pipelines.high-definition/HDRP/Material/PreIntegratedFGD/preIntegratedFGD_CharlieClothLambert.shader
|
|||
fileFormatVersion: 2 |
|||
guid: 3b3bf235775cf8b4baae7f3306787ab0 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/HDRenderPipeline/preIntegratedFGD_GGXDisneyDiffuse" |
|||
{ |
|||
SubShader |
|||
{ |
|||
Tags{ "RenderPipeline" = "HDRenderPipeline" } |
|||
Pass |
|||
{ |
|||
ZTest Always Cull Off ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#pragma vertex Vert |
|||
#pragma fragment Frag |
|||
#pragma target 4.5 |
|||
#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch |
|||
|
|||
#include "CoreRP/ShaderLibrary/Common.hlsl" |
|||
#include "CoreRP/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 perceptualRoughness = input.texCoord.y; |
|||
float3 V = float3(sqrt(1 - NdotV * NdotV), 0, NdotV); |
|||
float3 N = float3(0.0, 0.0, 1.0); |
|||
|
|||
// Pre integrate GGX with smithJoint visibility as well as DisneyDiffuse |
|||
float4 preFGD = IntegrateGGXAndDisneyDiffuseFGD(V, N, PerceptualRoughnessToRoughness(perceptualRoughness)); |
|||
|
|||
return float4(preFGD.xyz, 1.0); |
|||
} |
|||
|
|||
ENDHLSL |
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue