浏览代码

get rid of redundant blendmode routines

get rid of redundant blendmode routines and don't use overlay mode by
default
/main
mmikk 8 年前
当前提交
c8549891
共有 2 个文件被更改,包括 12 次插入10 次删除
  1. 16
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
  2. 6
      Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader

16
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


void OnDisable()
{
// RenderLoop.renderLoopDelegate -= ExecuteRenderLoop;
DestroyImmediate(m_DeferredMaterial);
DestroyImmediate(m_DeferredReflectionMaterial);
if(m_DeferredMaterial) DestroyImmediate(m_DeferredMaterial);
if(m_DeferredReflectionMaterial) DestroyImmediate(m_DeferredReflectionMaterial);
m_cookieTexArray.Release();
m_cubeCookieTexArray.Release();
m_cubeReflTexArray.Release();

//Assert(false);
}
++i;
// next light
if (cl.lightType == LightType.Spot || cl.lightType == LightType.Point)
++i;
}

// do anything we need to do upon a new frame.
NewFrame();
m_DeferredMaterial.SetInt("_SrcBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.DstColor);
m_DeferredMaterial.SetInt("_DstBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.Zero);
m_DeferredReflectionMaterial.SetInt("_SrcBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.DstColor);
m_DeferredReflectionMaterial.SetInt("_DstBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.Zero);
//m_DeferredMaterial.SetInt("_SrcBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.DstColor);
//m_DeferredMaterial.SetInt("_DstBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.Zero);
//m_DeferredReflectionMaterial.SetInt("_SrcBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.DstColor);
//m_DeferredReflectionMaterial.SetInt("_DstBlend", camera.hdr ? (int)BlendMode.One : (int)BlendMode.Zero);
loop.SetupCameraProperties(camera);
RenderGBuffer(cullResults, camera, loop);

6
Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader


float3 c = ExecuteLightList(pixCoord, offs);
c = OverlayHeatMap(FetchLightCount(offs), c);
//c = OverlayHeatMap(FetchLightCount(offs), c);
//return float4(c,1.0);
return float4(pow(c,1/2.2),1.0);
return float4(c,1.0);
//return float4(pow(c,1/2.2),1.0);
}
struct UnityStandardData

正在加载...
取消
保存