浏览代码

API change: rename inputCullingOptions -> inputFilter

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

4
Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs


// Draw opaque objects using BasicPass shader pass
var settings = new DrawRendererSettings (cull, camera, shaderPassBasic);
settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh;
settings.inputCullingOptions.SetQueuesOpaque ();
settings.inputFilter.SetQueuesOpaque ();
loop.DrawRenderers (ref settings);
// Draw skybox

settings.sorting.sortOptions = SortOptions.BackToFront; // sort back to front
settings.inputCullingOptions.SetQueuesTransparent ();
settings.inputFilter.SetQueuesTransparent ();
loop.DrawRenderers (ref settings);
loop.Submit ();

12
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


DrawRendererSettings settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName));
settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh;
settings.inputCullingOptions.SetQueuesOpaque();
settings.inputFilter.SetQueuesOpaque();
renderLoop.DrawRenderers(ref settings);
}

rendererConfiguration = RendererConfiguration.PerObjectLightProbe | RendererConfiguration.PerObjectReflectionProbes,
sorting = { sortOptions = SortOptions.SortByMaterialThenMesh }
};
settings.inputCullingOptions.SetQueuesTransparent();
settings.inputFilter.SetQueuesTransparent();
renderLoop.DrawRenderers(ref settings);
}

RenderOpaqueRenderList(cullResults, camera, renderLoop, "ForwardUnlit");
RenderTransparentRenderList(cullResults, camera, renderLoop, "ForwardUnlit");
}
}
void FinalPass(RenderLoop renderLoop)
{

if (light.lightType == LightType.Spot)
{
var spotAngle = light.light.spotAngle;
var innerConePercent = AdditionalLightData.GetInnerSpotPercent01(additionalLightData);
var cosSpotOuterHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * Mathf.Deg2Rad), 0.0f, 1.0f);
var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone

s.bias = light.light.shadowBias;
shadows.Add(s);
shadows.Add(s);
}
}

Shader.SetGlobalBuffer("_PunctualLightList", s_punctualLightList);
Shader.SetGlobalInt("_PunctualLightCount", lights.Count);
Shader.SetGlobalBuffer("_PunctualShadowList", s_punctualShadowList);
Shader.SetGlobalBuffer("_PunctualShadowList", s_punctualShadowList);
}
void UpdateReflectionProbes(VisibleReflectionProbe[] activeReflectionProbes)

8
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


};
//@TODO: need to get light probes + LPPV too?
settings.inputCullingOptions.SetQueuesOpaque();
settings.inputFilter.SetQueuesOpaque();
settings.rendererConfiguration = RendererConfiguration.PerObjectLightmaps | RendererConfiguration.PerObjectLightProbe;
loop.DrawRenderers(ref settings);
}

sorting = { sortOptions = SortOptions.SortByMaterialThenMesh }
};
settings.rendererConfiguration = RendererConfiguration.PerObjectLightmaps | RendererConfiguration.PerObjectLightProbe;
if (opaquesOnly) settings.inputCullingOptions.SetQueuesOpaque();
else settings.inputCullingOptions.SetQueuesTransparent();
if (opaquesOnly) settings.inputFilter.SetQueuesOpaque();
else settings.inputFilter.SetQueuesTransparent();
loop.DrawRenderers(ref settings);
}

{
sorting = { sortOptions = SortOptions.SortByMaterialThenMesh }
};
settings.inputCullingOptions.SetQueuesOpaque();
settings.inputFilter.SetQueuesOpaque();
loop.DrawRenderers(ref settings);
}

正在加载...
取消
保存