Compare commits

..

No commits in common. "be959073520705336fc12ea9f8ad0ba5c2d42b5b" and "9bf80b1b5fa97c6f0219aeca34bf47d84fb652d7" have entirely different histories.

1 changed files with 4 additions and 6 deletions

View File

@ -636,11 +636,10 @@ public class LightMapper
var planeMapper = new MathUtils.PlanePointMapper(plane.Normal, vs[0], vs[1]); var planeMapper = new MathUtils.PlanePointMapper(plane.Normal, vs[0], vs[1]);
var v2ds = planeMapper.MapTo2d(vs); var v2ds = planeMapper.MapTo2d(vs);
// TODO: Only need to generate quadweights if there's any quadlights in the mission
var (texU, texV) = renderPoly.TextureVectors; var (texU, texV) = renderPoly.TextureVectors;
var (offsets, weights) = var (offsets, weights) =
GetTraceOffsetsAndWeights(settings.MultiSampling, texU, texV, settings.MultiSamplingCenterWeight); GetTraceOffsetsAndWeights(settings.MultiSampling, texU, texV, settings.MultiSamplingCenterWeight);
var (quadOffsets, quadWeights) = settings.MultiSampling != SoftnessMode.Standard var (quadOffsets, quadWeights) = settings.MultiSampling == SoftnessMode.HighFourPoint
? (offsets, weights) ? (offsets, weights)
: GetTraceOffsetsAndWeights(SoftnessMode.HighFourPoint, texU, texV, settings.MultiSamplingCenterWeight); : GetTraceOffsetsAndWeights(SoftnessMode.HighFourPoint, texU, texV, settings.MultiSamplingCenterWeight);
@ -655,7 +654,7 @@ public class LightMapper
// TODO: Handle quad lit lights better. Right now we're computing two sets of points for every // TODO: Handle quad lit lights better. Right now we're computing two sets of points for every
// luxel. Maybe it's better to only compute if we encounter a quadlit light? // luxel. Maybe it's better to only compute if we encounter a quadlit light?
var tracePoints = GetTracePoints(pos, offsets, renderPoly.Center, planeMapper, v2ds); var tracePoints = GetTracePoints(pos, offsets, renderPoly.Center, planeMapper, v2ds);
var quadTracePoints = settings.MultiSampling != SoftnessMode.Standard var quadTracePoints = settings.MultiSampling == SoftnessMode.HighFourPoint
? tracePoints ? tracePoints
: GetTracePoints(pos, quadOffsets, renderPoly.Center, planeMapper, v2ds); : GetTracePoints(pos, quadOffsets, renderPoly.Center, planeMapper, v2ds);
@ -800,7 +799,7 @@ public class LightMapper
return mode switch return mode switch
{ {
SoftnessMode.LowFourPoint or SoftnessMode.MediumFourPoint or SoftnessMode.HighFourPoint => ( SoftnessMode.LowFourPoint or SoftnessMode.MediumFourPoint or SoftnessMode.HighFourPoint => (
[-texU - texV, texU - texV, -texU + texV, texU + texV], [-texU - texV, -texU - texV, -texU + texV, texU + texV],
[0.25f, 0.25f, 0.25f, 0.25f]), [0.25f, 0.25f, 0.25f, 0.25f]),
SoftnessMode.MediumFivePoint or SoftnessMode.HighFivePoint => ( SoftnessMode.MediumFivePoint or SoftnessMode.HighFivePoint => (
[Vector3.Zero, -texU - texV, texU - texV, -texU + texV, texU + texV], [Vector3.Zero, -texU - texV, texU - texV, -texU + texV, texU + texV],
@ -877,8 +876,7 @@ public class LightMapper
origin = hitResult.Position += direction * MathUtils.Epsilon; origin = hitResult.Position += direction * MathUtils.Epsilon;
} }
// A large epsilon is used here to fix shadow acne on sloped surfaces :) return Math.Abs(hitDistanceFromTarget) < MathUtils.Epsilon;
return Math.Abs(hitDistanceFromTarget) < 10 * MathUtils.Epsilon;
} }
// TODO: Can this be merged with the above? // TODO: Can this be merged with the above?