浏览代码
Merge remote-tracking branch 'refs/remotes/origin/master' into Merge-FPTL
Merge remote-tracking branch 'refs/remotes/origin/master' into Merge-FPTL
# Conflicts: # Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs/main
sebastienlagarde
8 年前
当前提交
1225abd4
共有 16 个文件被更改,包括 480 次插入 和 52 次删除
-
24Assets/ScriptableRenderLoop/HDRenderLoop/Editor/HDRenderLoopInspector.cs
-
2Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset.meta
-
93Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
101Assets/ScriptableRenderLoop/HDRenderLoop/Material/LayeredLit/Editor/LayeredLitUI.cs
-
65Assets/ScriptableRenderLoop/HDRenderLoop/Material/LayeredLit/LayeredLit.shader
-
94Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/LitData.hlsl
-
2Assets/ScriptableRenderLoop/ShaderLibrary/API/D3D11.hlsl
-
21Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl
-
12Assets/TestScenes/HDTest/JulienTest.unity
-
19Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/Layered.mat
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky.meta
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources.meta
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader.meta
-
72Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader
|
|||
fileFormatVersion: 2 |
|||
guid: 2400b74f5ce370c4481e5dc417d03703 |
|||
timeCreated: 1478912125 |
|||
timeCreated: 1479240578 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
userData: |
|
|||
fileFormatVersion: 2 |
|||
guid: d7469c05ebee66f4886264af0ab8bf2a |
|||
folderAsset: yes |
|||
timeCreated: 1479239906 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4cdc45a9a65126a42aca158413a5b089 |
|||
folderAsset: yes |
|||
timeCreated: 1479239906 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 0e7a148852dbc8f47a32e829517574ff |
|||
timeCreated: 1479239909 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
Shader "Hidden/HDRenderLoop/SkyHDRI" |
|||
{ |
|||
SubShader |
|||
{ |
|||
Pass |
|||
{ |
|||
ZWrite Off |
|||
Blend SrcAlpha OneMinusSrcAlpha // We will lerp only the values that are valid |
|||
|
|||
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 "CommonLighting.hlsl" |
|||
|
|||
TEXTURECUBE(_Cubemap); |
|||
SAMPLERCUBE(sampler_Cubemap); |
|||
float4 _SkyParam; // x exposure, y multiplier, z rotation |
|||
|
|||
struct Attributes |
|||
{ |
|||
float3 positionCS : POSITION; |
|||
float3 eyeVector : NORMAL; |
|||
}; |
|||
|
|||
struct Varyings |
|||
{ |
|||
float4 positionCS : SV_POSITION; |
|||
float3 eyeVector : TEXCOORD0; |
|||
}; |
|||
|
|||
Varyings Vert(Attributes input) |
|||
{ |
|||
// TODO: implement SV_vertexID full screen quad |
|||
Varyings output; |
|||
output.positionCS = float4(input.positionCS.xy, UNITY_RAW_FAR_CLIP_VALUE |
|||
#if UNITY_REVERSED_Z |
|||
+ 0.000001 |
|||
#else |
|||
- 0.000001 |
|||
#endif |
|||
, 1.0); |
|||
output.eyeVector = input.eyeVector; |
|||
|
|||
return output; |
|||
} |
|||
|
|||
float4 Frag(Varyings input) : SV_Target |
|||
{ |
|||
float3 dir = normalize(input.eyeVector); |
|||
|
|||
// Rotate direction |
|||
float phi = _SkyParam.z * PI / 180.0; // Convert to radiant |
|||
float cosPhi, sinPhi; |
|||
sincos(phi, cosPhi, sinPhi); |
|||
float3 rotDirX = float3(cosPhi, 0, sinPhi); |
|||
float3 rotDirY = float3(sinPhi, 0, -cosPhi); |
|||
dir = float3(dot(rotDirX, dir), dir.y, dot(rotDirY, dir)); |
|||
|
|||
return ClampToFloat16Max(SAMPLE_TEXTURECUBE_LOD(_Cubemap, sampler_Cubemap, dir, 0) * exp2(_SkyParam.x) * _SkyParam.y); |
|||
} |
|||
|
|||
ENDHLSL |
|||
} |
|||
|
|||
} |
|||
Fallback Off |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue