Sebastien Lagarde
8 年前
当前提交
d8f13193
共有 11 个文件被更改,包括 229 次插入 和 4 次删除
-
22Assets/ScriptableRenderLoop/HDRenderLoop/Editor/HDRenderLoopInspector.cs
-
2Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset.meta
-
88Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
-
2Assets/ScriptableRenderLoop/ShaderLibrary/API/D3D11.hlsl
-
21Assets/ScriptableRenderLoop/ShaderLibrary/CommonLighting.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky.meta
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources.meta
-
71Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Sky/Resources/SkyHDRI.shader.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 2400b74f5ce370c4481e5dc417d03703 |
|||
timeCreated: 1479232893 |
|||
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: |
|
|||
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" |
|||
|
|||
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 |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0e7a148852dbc8f47a32e829517574ff |
|||
timeCreated: 1479239909 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue