浏览代码

[ReflectionPRobeEditor] fixed sphere shape radius

/feature-ReflectionProbeFit
Frédéric Vauchelles 7 年前
当前提交
a65b08a6
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Drawers.cs
  2. 10
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs

2
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Drawers.cs


foreach (var targetObject in p.so.targetObjects)
{
var rp = (ReflectionProbe)targetObject;
var b = rp.GetComponent<Renderer>().bounds;
var b = rp.bounds;
bounds.Encapsulate(b);
}
return bounds;

10
ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop/LightLoop.cs


public bool GetEnvLightData(CommandBuffer cmd, Camera camera, VisibleReflectionProbe probe)
{
var additionalData = probe.probe.GetComponent<HDAdditionalReflectionData>();
var extents = probe.bounds.extents;
// For now we won't display real time probe when rendering one.
// TODO: We may want to display last frame result but in this case we need to be careful not to update the atlas before all realtime probes are rendered (for frame coherency).

case ReflectionInfluenceShape.Box:
{
envLightData.envShapeType = EnvShapeType.Box;
if (probe.boxProjection != 0)
if (probe.boxProjection == 0)
case ReflectionInfluenceShape.Sphere: envLightData.envShapeType = EnvShapeType.Sphere; break;
case ReflectionInfluenceShape.Sphere:
envLightData.envShapeType = EnvShapeType.Sphere;
extents = Vector3.one * additionalData.influenceSphereRadius;
break;
}
}
else

// probe.bounds.extents is BoxSize / 2
float maxBlendDist = Mathf.Min(probe.bounds.extents.x, Mathf.Min(probe.bounds.extents.y, probe.bounds.extents.z));
float blendDistance = Mathf.Min(maxBlendDist, probe.blendDistance);
envLightData.innerDistance = probe.bounds.extents - new Vector3(blendDistance, blendDistance, blendDistance);
envLightData.innerDistance = extents - new Vector3(blendDistance, blendDistance, blendDistance);
envLightData.envIndex = envIndex;
envLightData.offsetLS = probe.center; // center is misnamed, it is the offset (in local space) from center of the bounding box to the cubemap capture point
envLightData.blendDistance = blendDistance;

正在加载...
取消
保存