Julien Ignace
8 年前
当前提交
0813f11a
共有 2 个文件被更改,包括 77 次插入 和 0 次删除
-
68Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/GGXConvolve.shader.meta
|
|||
Shader "Hidden/HDRenderLoop/GGXConvolve" |
|||
{ |
|||
SubShader |
|||
{ |
|||
Pass |
|||
{ |
|||
ZWrite Off |
|||
ZTest LEqual |
|||
Blend One Zero |
|||
|
|||
HLSLPROGRAM |
|||
#pragma target 5.0 |
|||
#pragma only_renderers d3d11 // TEMP: unitl we go futher in dev |
|||
|
|||
#pragma vertex Vert |
|||
#pragma fragment Frag |
|||
|
|||
#include "Common.hlsl" |
|||
#include "ImageBasedLighting.hlsl" |
|||
|
|||
struct Attributes |
|||
{ |
|||
float3 positionCS : POSITION; |
|||
float3 eyeVector : NORMAL; |
|||
}; |
|||
|
|||
struct Varyings |
|||
{ |
|||
float4 positionCS : SV_POSITION; |
|||
float3 eyeVector : TEXCOORD0; |
|||
}; |
|||
|
|||
Varyings Vert(Attributes input) |
|||
{ |
|||
Varyings output; |
|||
output.positionCS = float4(input.positionCS.xy, UNITY_RAW_FAR_CLIP_VALUE, 1.0); |
|||
output.eyeVector = input.eyeVector; |
|||
return output; |
|||
} |
|||
|
|||
TEXTURECUBE(_MainTex); |
|||
SAMPLERCUBE(sampler_MainTex); |
|||
float _Level; |
|||
float _MipMapCount; |
|||
float _InvOmegaP; |
|||
|
|||
half4 Frag(Varyings input) : SV_Target |
|||
{ |
|||
float3 N = input.eyeVector; |
|||
float3 V = N; |
|||
|
|||
float perceptualRoughness = 0.1;// mipmapLevelToPerceptualRoughness(_Level); |
|||
// We approximate the pre-integration with V == N |
|||
float4 val = IntegrateLD( TEXTURECUBE_PARAM(_MainTex, sampler_MainTex), |
|||
V, |
|||
N, |
|||
PerceptualRoughnessToRoughness(perceptualRoughness), |
|||
_MipMapCount, |
|||
_InvOmegaP, |
|||
1, |
|||
false); |
|||
|
|||
return val; |
|||
} |
|||
ENDHLSL |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 123ed592ad5c2494b8aed301fd609e7b |
|||
timeCreated: 1479994507 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue