浏览代码

Move InitSkyEnvLightData() to LightUtilities.hlsl

/main
Evgenii Golubev 8 年前
当前提交
8535f07e
共有 4 个文件被更改,包括 29 次插入15 次删除
  1. 1
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/Lighting.hlsl
  2. 15
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl
  3. 19
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl
  4. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl.meta

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


#ifdef LIGHTLOOP_SINGLE_PASS
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl"
#elif defined(LIGHTLOOP_TILE_PASS)
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/TilePass/TilePass.hlsl"
#endif

15
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl


int sampleReflection;
};
// The EnvLightData of the sky light contains a bunch of compile-time constants.
// This function sets them directly to allow the compiler to propagate them and optimize the code.
void InitSkyEnvLightData(int index)
{
_EnvLightSky.envShapeType = ENVSHAPETYPE_SKY;
_EnvLightSky.envIndex = index;
_EnvLightSky.forward = float3(0.0, 0.0, 1.0);
_EnvLightSky.up = float3(0.0, 1.0, 0.0);
_EnvLightSky.right = float3(1.0, 0.0, 0.0);
_EnvLightSky.positionWS = float3(0.0, 0.0, 0.0);
_EnvLightSky.offsetLS = float3(0.0, 0.0, 0.0);
_EnvLightSky.innerDistance = float3(0.0, 0.0, 0.0);
_EnvLightSky.blendDistance = 1.0;
}
//-----------------------------------------------------------------------------
// Shadow sampling function
// ----------------------------------------------------------------------------

19
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl


#ifndef UNITY_LIGHT_UTILITIES_INCLUDED
#define UNITY_LIGHT_UTILITIES_INCLUDED
// The EnvLightData of the sky light contains a bunch of compile-time constants.
// This function sets them directly to allow the compiler to propagate them and optimize the code.
void InitSkyEnvLightData(int index)
{
_EnvLightSky.envShapeType = ENVSHAPETYPE_SKY;
_EnvLightSky.envIndex = index;
_EnvLightSky.forward = float3(0.0, 0.0, 1.0);
_EnvLightSky.up = float3(0.0, 1.0, 0.0);
_EnvLightSky.right = float3(1.0, 0.0, 0.0);
_EnvLightSky.positionWS = float3(0.0, 0.0, 0.0);
_EnvLightSky.offsetLS = float3(0.0, 0.0, 0.0);
_EnvLightSky.innerDistance = float3(0.0, 0.0, 0.0);
_EnvLightSky.blendDistance = 1.0;
}
#endif // UNITY_LIGHT_UTILITIES_INCLUDED

9
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/LightUtilities.hlsl.meta


fileFormatVersion: 2
guid: be2a44d9e57c5b943ab80fa5fc334d99
timeCreated: 1480423337
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存