- reflection probe are now split in two volume, one influence volume
(for culling and fading) and one projection volume (for cubemap
sampling). Mean we can have box porjection with spherical influecne.
- Refletion volume support both cube and sphere (would like to add
ellipse later)
- Change the behavior of blenddistance to inner blend distance instead
of outer blend distance as it is easy for the artists to use.
// CAUTION: localToWorld is the transform for the widget of the reflection probe. i.e the world position of the point use to do the cubemap capture (mean it include the local offset)
l.positionWS=probe.localToWorld.GetColumn(3);
l.shapeType=EnvShapeType.None;
l.projectionShapeType=ProjectionShapeType.None;
// TODO: Support sphere in the interface
l.shapeType=EnvShapeType.Box;
l.projectionShapeType=ProjectionShapeType.Box;
// TODO add influence volume in interface, for now it is coupled with projection volume
// Note that even when there is no projection volume, there is an influence volume.
l.influenceShapeType=InfluenceShapeType.Box;
// remove scale from the matrix (Scale in this matrix is use to scale the widget)
l.right=probe.localToWorld.GetColumn(0);
l.forward=probe.localToWorld.GetColumn(2);
l.forward.Normalize();
l.innerDistance=probe.bounds.extents;
// Artists prefer to have blend distance inside the volume!
// So we let the current UI but we assume blendDistance is an inside factor instead
// Blend distance can't be larger than the max radius
// In this code we redefine a bit the behavior of the reflcetion proble. We separate the projection volume (the proxy of the scene) form the influence volume (what pixel on the screen is affected)
// 1. First determine the projection volume
if (lightData.shapeType == ENVSHAPETYPE_BOX)
// CAUTION: localToWorld is the transform use to convert the cubemap capture point to world space (mean it include the offset)
// the center of the bounding box is thus in locals space: positionLS - offsetLS
// We use this formulation as it is the one of legacy unity that was using only AABB box.
if (lightData.projectionShapeType == PROJECTIONSHAPETYPE_BOX)
// CAUTION: localToWorld is the transform use to convert the cubemap capture point to world space (mean it include the offset)
// the center of the bounding box is thus in locals space: positionLS - offsetLS
// We use this formulation as it is the one of legacy unity that was using only AABB box.