浏览代码

Add EnvShapeType.Sky

/main
Evgenii Golubev 8 年前
当前提交
8c87a8f3
共有 3 个文件被更改,包括 7 次插入4 次删除
  1. 7
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs
  2. 1
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs.hlsl
  3. 3
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl

7
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs


[GenerateHLSL]
public enum EnvShapeType
{
None,
Box,
Sphere
None,
Box,
Sphere,
Sky
};
[GenerateHLSL]

1
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightDefinition.cs.hlsl


#define ENVSHAPETYPE_NONE (0)
#define ENVSHAPETYPE_BOX (1)
#define ENVSHAPETYPE_SPHERE (2)
#define ENVSHAPETYPE_SKY (3)
//
// UnityEngine.Experimental.ScriptableRenderLoop.EnvConstants: static fields

3
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


float distFade = max(length(positionLS) - lightData.innerDistance.x, 0.0);
weight.y = saturate(1.0 - distFade / max(lightData.blendDistance, 0.0001)); // avoid divide by zero
}
else // ENVSHAPETYPE_BOX or ENVSHAPETYPE_NONE
else if (lightData.envShapeType == ENVSHAPETYPE_BOX ||
lightData.envShapeType == ENVSHAPETYPE_NONE)
{
// Calculate falloff value, so reflections on the edges of the volume would gradually blend to previous reflection.
float distFade = DistancePointBox(positionLS, -lightData.innerDistance, lightData.innerDistance);

正在加载...
取消
保存