reflection scalefix

This commit is contained in:
Azaezel 2019-03-05 00:41:00 -06:00
parent 7eb6f767d0
commit 9ee79bb4fa

View file

@ -88,8 +88,8 @@ float3 boxProject(Surface surface, ProbeData probe)
float3 PositionLS = mul( probe.worldToLocal, float4(surface.P,1.0)).xyz;
float3 unit = probe.boxMax-probe.boxMin;
float3 plane1vec = (unit - PositionLS) / RayLS;
float3 plane2vec = (-unit - PositionLS) / RayLS;
float3 plane1vec = (unit/2 - PositionLS) / RayLS;
float3 plane2vec = (-unit/2 - PositionLS) / RayLS;
float3 furthestPlane = max(plane1vec, plane2vec);
float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z);
float3 posonbox = surface.P + surface.R * dist;