浏览代码

Small cleanup (spotAngle part of VisibleLight)

/main
Aras Pranckevicius 8 年前
当前提交
df2b15a6
共有 3 个文件被更改,包括 5 次插入1006 次删除
  1. 2
      Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs
  2. 8
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  3. 1001
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs

2
Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs


var dir = light.localToWorld.GetColumn (2);
lightSpotDirections[i] = new Vector4 (-dir.x, -dir.y, -dir.z, 0);
float radAngle = Mathf.Deg2Rad * light.light.spotAngle;
float radAngle = Mathf.Deg2Rad * light.spotAngle;
float cosTheta = Mathf.Cos (radAngle * 0.25f);
float cosPhi = Mathf.Cos (radAngle * 0.5f);
float cosDiff = cosTheta - cosPhi;

8
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


m_gbufferManager.gbufferCount = m_LitRenderLoop.GetMaterialGBufferCount();
RenderTextureFormat[] RTFormat; RenderTextureReadWrite[] RTReadWrite;
m_LitRenderLoop.GetMaterialGBufferDescription(out RTFormat, out RTReadWrite);
for (int gbufferIndex = 0; gbufferIndex < m_gbufferManager.gbufferCount; ++gbufferIndex)
{
m_gbufferManager.SetBufferDescription(gbufferIndex, "_GBufferTexture" + gbufferIndex, RTFormat[gbufferIndex], RTReadWrite[gbufferIndex]);

void RenderVelocity(CullResults cullResults, Camera camera, RenderLoop renderLoop)
{
// warning CS0162: Unreachable code detected // warning CS0429: Unreachable expression code detected
#pragma warning disable 162, 429
#pragma warning disable 162, 429
// If opaque velocity have been render during GBuffer no need to render it here
if ((ShaderConfig.VelocityInGbuffer == 0) || debugParameters.useForwardRenderingOnly)
return ;

// Only transparent object can render distortion vectors
RenderTransparentRenderList(cullResults, camera, renderLoop, "DistortionVectors");
}
void FinalPass(RenderLoop renderLoop)
{

if (light.lightType == LightType.Spot)
{
var spotAngle = light.light.spotAngle;
var spotAngle = light.spotAngle;
var innerConePercent = additionalData.GetInnerSpotPercent01();
var cosSpotOuterHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * Mathf.Deg2Rad), 0.0f, 1.0f);

1001
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
文件差异内容过多而无法显示
查看文件

正在加载...
取消
保存