蜃気楼の像を揺らす項目を追加する
このコミットが含まれているのは:
7ファイル変更
+120
-11
検索条件に一致するファイルはありません
+22
-5
@@ -13,6 +13,8 @@ cbuffer Constants : register(b0)
|
||||
float mapStart : packoffset(c2.x);
|
||||
float mapSpan : packoffset(c2.y);
|
||||
float mapWidth : packoffset(c2.z);
|
||||
float4 shimmerPhase : packoffset(c3);
|
||||
float shimmerAmplitude : packoffset(c4.x);
|
||||
};
|
||||
|
||||
static const float HalfTexel = 0.5;
|
||||
@@ -23,6 +25,10 @@ static const float FillRadiusFraction = 0.006;
|
||||
static const int FillHalfTaps = 4;
|
||||
static const float FillTaps = 9.0;
|
||||
static const float FillThreshold = 0.5;
|
||||
static const float4 ShimmerAzimuthFrequency = float4(400.0, 170.0, 650.0, 95.0);
|
||||
static const float4 ShimmerElevationFrequency = float4(2570.0, 1330.0, 4000.0, 720.0);
|
||||
static const float4 ShimmerWeight = float4(1.0, 0.7, 0.5, 0.35);
|
||||
static const float ShimmerWeightSum = 2.55;
|
||||
static const float MaximumSine = 0.1;
|
||||
|
||||
float ArcSine(float value)
|
||||
@@ -51,6 +57,12 @@ float ReadFill(float elevation)
|
||||
return MapTexture.SampleLevel(MapSampler, mapUv, 0).y;
|
||||
}
|
||||
|
||||
float Wobble(float elevation, float azimuth)
|
||||
{
|
||||
float4 phase = shimmerPhase + ShimmerAzimuthFrequency * azimuth + ShimmerElevationFrequency * elevation;
|
||||
return shimmerAmplitude * dot(sin(phase), ShimmerWeight) / ShimmerWeightSum;
|
||||
}
|
||||
|
||||
float4 main(
|
||||
float4 position : SV_POSITION,
|
||||
float4 scenePosition : SCENE_POSITION,
|
||||
@@ -77,9 +89,13 @@ float4 main(
|
||||
float pixelAngle = 1.0 / focalLength;
|
||||
float fillStep = FillRadiusFraction * (inputBounds.z - inputBounds.x) / FillHalfTaps;
|
||||
|
||||
float lowShift = ReadShift(elevation - 0.5 * pixelAngle);
|
||||
float highShift = ReadShift(elevation + 0.5 * pixelAngle);
|
||||
if (abs(lowShift) <= MinimumShift && abs(highShift) <= MinimumShift && abs(ReadShift(elevation)) <= MinimumShift)
|
||||
float shake = 0.0;
|
||||
if (shimmerAmplitude > 0.0)
|
||||
shake = Wobble(elevation, sinAzimuth);
|
||||
|
||||
float lowShift = ReadShift(elevation - 0.5 * pixelAngle + shake);
|
||||
float highShift = ReadShift(elevation + 0.5 * pixelAngle + shake);
|
||||
if (abs(lowShift) <= MinimumShift && abs(highShift) <= MinimumShift && abs(ReadShift(elevation + shake)) <= MinimumShift)
|
||||
return source;
|
||||
|
||||
float stretch = abs(pixelAngle + highShift - lowShift) / pixelAngle;
|
||||
@@ -92,7 +108,8 @@ float4 main(
|
||||
break;
|
||||
|
||||
float sampled = elevation + ((tap + 0.5) / taps - 0.5) * pixelAngle;
|
||||
float seen = sampled + ReadShift(sampled);
|
||||
float lookup = sampled + shake;
|
||||
float seen = sampled + ReadShift(lookup);
|
||||
float sinSeen;
|
||||
float cosSeen;
|
||||
sincos(seen, sinSeen, cosSeen);
|
||||
@@ -102,7 +119,7 @@ float4 main(
|
||||
float2 seenPosition = center + focalLength * seenDirection.xy / max(seenDirection.z, MinimumDepth);
|
||||
float2 lowerBound = inputBounds.xy + HalfTexel;
|
||||
float2 upperBound = inputBounds.zw - HalfTexel;
|
||||
if (ReadFill(sampled) > FillThreshold)
|
||||
if (ReadFill(lookup) > FillThreshold)
|
||||
{
|
||||
float4 blurred = float4(0.0, 0.0, 0.0, 0.0);
|
||||
[unroll]
|
||||
|
||||
@@ -18,7 +18,7 @@ public sealed class MirageEffectTests
|
||||
static T Attribute<T>(string property) where T : Attribute => Property(property).GetCustomAttribute<T>()!;
|
||||
|
||||
static Animation[] Animations(MirageEffect effect)
|
||||
=> [effect.Amount, effect.EyeHeight, effect.HeatDifference, effect.HeatThickness, effect.InversionDifference, effect.InversionHeight, effect.InversionThickness, effect.Distance, effect.FieldOfView, effect.CameraPitch];
|
||||
=> [effect.Amount, effect.EyeHeight, effect.HeatDifference, effect.HeatThickness, effect.InversionDifference, effect.InversionHeight, effect.InversionThickness, effect.Distance, effect.FieldOfView, effect.CameraPitch, effect.Shimmer, effect.ShimmerSpeed];
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MirageEffect.Amount), 100d, 0d, 100d)]
|
||||
@@ -31,6 +31,8 @@ public sealed class MirageEffectTests
|
||||
[InlineData(nameof(MirageEffect.Distance), 40d, 5d, 100d)]
|
||||
[InlineData(nameof(MirageEffect.FieldOfView), 3d, 0.2d, 60d)]
|
||||
[InlineData(nameof(MirageEffect.CameraPitch), 0d, -20d, 20d)]
|
||||
[InlineData(nameof(MirageEffect.Shimmer), 0d, 0d, 100d)]
|
||||
[InlineData(nameof(MirageEffect.ShimmerSpeed), 1d, 0d, 5d)]
|
||||
public void AnimatedParametersStartFromTheirDefaultsWithinTheirRange(string name, double defaultValue, double minimum, double maximum)
|
||||
{
|
||||
var effect = new MirageEffect();
|
||||
@@ -66,6 +68,11 @@ public sealed class MirageEffectTests
|
||||
Assert.Equal(MirageSettings.MaximumFieldOfViewDegrees, effect.FieldOfView.MaxValue);
|
||||
Assert.Equal(MirageSettings.MinimumCameraPitchDegrees, effect.CameraPitch.MinValue);
|
||||
Assert.Equal(MirageSettings.MaximumCameraPitchDegrees, effect.CameraPitch.MaxValue);
|
||||
Assert.Equal(MirageSettings.MinimumShimmerPercent, effect.Shimmer.MinValue);
|
||||
Assert.Equal(MirageSettings.MaximumShimmerPercent, effect.Shimmer.MaxValue);
|
||||
Assert.Equal(MirageSettings.MinimumShimmerSpeed, effect.ShimmerSpeed.MinValue);
|
||||
Assert.Equal(MirageSettings.MaximumShimmerSpeed, effect.ShimmerSpeed.MaxValue);
|
||||
Assert.Equal(MirageSettings.DefaultShimmerSpeed, effect.ShimmerSpeed.DefaultValue);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -103,7 +110,7 @@ public sealed class MirageEffectTests
|
||||
|
||||
effect.SetAnimationParameters(120, EffectDescriptions.Fps);
|
||||
|
||||
Assert.Equal(10, Animations(effect).Length);
|
||||
Assert.Equal(12, Animations(effect).Length);
|
||||
Assert.All(Animations(effect), animation => Assert.Equal(120, animation.Length));
|
||||
}
|
||||
|
||||
@@ -153,6 +160,8 @@ public sealed class MirageEffectTests
|
||||
[InlineData(nameof(MirageEffect.InversionThickness), nameof(Texts.AtmosphereGroup), nameof(Texts.InversionThickness), nameof(Texts.InversionThicknessDescription), 16)]
|
||||
[InlineData(nameof(MirageEffect.Distance), nameof(Texts.AtmosphereGroup), nameof(Texts.Distance), nameof(Texts.DistanceDescription), 17)]
|
||||
[InlineData(nameof(MirageEffect.Source), nameof(Texts.AtmosphereGroup), nameof(Texts.Source), nameof(Texts.SourceDescription), 18)]
|
||||
[InlineData(nameof(MirageEffect.Shimmer), nameof(Texts.AtmosphereGroup), nameof(Texts.Shimmer), nameof(Texts.ShimmerDescription), 19)]
|
||||
[InlineData(nameof(MirageEffect.ShimmerSpeed), nameof(Texts.AtmosphereGroup), nameof(Texts.ShimmerSpeed), nameof(Texts.ShimmerSpeedDescription), 20)]
|
||||
[InlineData(nameof(MirageEffect.FieldOfView), nameof(Texts.CameraGroup), nameof(Texts.FieldOfView), nameof(Texts.FieldOfViewDescription), 20)]
|
||||
[InlineData(nameof(MirageEffect.CameraPitch), nameof(Texts.CameraGroup), nameof(Texts.CameraPitch), nameof(Texts.CameraPitchDescription), 21)]
|
||||
public void EveryParameterIsDisplayedInItsGroupInOrder(string property, string group, string name, string description, int order)
|
||||
@@ -177,6 +186,8 @@ public sealed class MirageEffectTests
|
||||
[InlineData(nameof(MirageEffect.Distance), "F1", "km", 5d, 100d)]
|
||||
[InlineData(nameof(MirageEffect.FieldOfView), "F2", "°", 0.2d, 60d)]
|
||||
[InlineData(nameof(MirageEffect.CameraPitch), "F2", "°", -20d, 20d)]
|
||||
[InlineData(nameof(MirageEffect.Shimmer), "F1", "%", 0d, 100d)]
|
||||
[InlineData(nameof(MirageEffect.ShimmerSpeed), "F2", "×", 0d, 5d)]
|
||||
public void AnimatedParametersAreEditedWithAnimationSliders(string property, string format, string unit, double minimum, double maximum)
|
||||
{
|
||||
var slider = Attribute<AnimationSliderAttribute>(property);
|
||||
@@ -209,6 +220,8 @@ public sealed class MirageEffectTests
|
||||
[InlineData(nameof(MirageEffect.EyeHeight))]
|
||||
[InlineData(nameof(MirageEffect.FieldOfView))]
|
||||
[InlineData(nameof(MirageEffect.CameraPitch))]
|
||||
[InlineData(nameof(MirageEffect.Shimmer))]
|
||||
[InlineData(nameof(MirageEffect.ShimmerSpeed))]
|
||||
public void TheCommonParametersAreAlwaysShown(string property)
|
||||
{
|
||||
Assert.Null(Property(property).GetCustomAttribute<ShowPropertyEditorWhenAttribute>());
|
||||
@@ -218,7 +231,7 @@ public sealed class MirageEffectTests
|
||||
public void EverySettingSurvivesAProjectRoundTrip()
|
||||
{
|
||||
var effect = new MirageEffect { Kind = MirageKind.Superior, Source = MirageSource.Scene };
|
||||
var values = new[] { 55d, 7d, 31d, 1.25d, 9d, 120d, 14d, 63d, 2.5d, -3.5d };
|
||||
var values = new[] { 55d, 7d, 31d, 1.25d, 9d, 120d, 14d, 63d, 2.5d, -3.5d, 45d, 2.5d };
|
||||
foreach (var (animation, value) in Animations(effect).Zip(values))
|
||||
animation.Values[0].Value = value;
|
||||
|
||||
|
||||
@@ -16,14 +16,26 @@ internal sealed class MirageCustomEffect(IGraphicsDevicesAndContext devices)
|
||||
HalfFieldTangent,
|
||||
PitchCosine,
|
||||
PitchSine,
|
||||
ShimmerAmplitude,
|
||||
ShimmerPhase0,
|
||||
ShimmerPhase1,
|
||||
ShimmerPhase2,
|
||||
ShimmerPhase3,
|
||||
}
|
||||
|
||||
public float Amount { set => SetValue((int)PropertyIndex.Amount, value); }
|
||||
public float HalfFieldTangent { set => SetValue((int)PropertyIndex.HalfFieldTangent, value); }
|
||||
public float PitchCosine { set => SetValue((int)PropertyIndex.PitchCosine, value); }
|
||||
public float PitchSine { set => SetValue((int)PropertyIndex.PitchSine, value); }
|
||||
public float ShimmerAmplitude { set => SetValue((int)PropertyIndex.ShimmerAmplitude, value); }
|
||||
public float ShimmerPhase0 { set => SetValue((int)PropertyIndex.ShimmerPhase0, value); }
|
||||
public float ShimmerPhase1 { set => SetValue((int)PropertyIndex.ShimmerPhase1, value); }
|
||||
public float ShimmerPhase2 { set => SetValue((int)PropertyIndex.ShimmerPhase2, value); }
|
||||
public float ShimmerPhase3 { set => SetValue((int)PropertyIndex.ShimmerPhase3, value); }
|
||||
|
||||
private const float DefaultHalfFieldTangent = 1f;
|
||||
private const float MaximumShimmerAmplitude = 0.01f;
|
||||
private const float MaximumShimmerPhase = 1e4f;
|
||||
|
||||
[CustomEffect(2)]
|
||||
internal sealed class EffectImpl : D2D1CustomShaderEffectImplBase<EffectImpl>
|
||||
@@ -43,6 +55,21 @@ internal sealed class MirageCustomEffect(IGraphicsDevicesAndContext devices)
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.PitchSine)]
|
||||
public float PitchSine { get => _cb.PitchSine; set { _cb.PitchSine = Sanitize(value, -1f, 1f); UpdateConstants(); } }
|
||||
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.ShimmerAmplitude)]
|
||||
public float ShimmerAmplitude { get => _cb.ShimmerAmplitude; set { _cb.ShimmerAmplitude = Sanitize(value, 0f, MaximumShimmerAmplitude); UpdateConstants(); } }
|
||||
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.ShimmerPhase0)]
|
||||
public float ShimmerPhase0 { get => _cb.ShimmerPhase.X; set { _cb.ShimmerPhase.X = Sanitize(value, -MaximumShimmerPhase, MaximumShimmerPhase); UpdateConstants(); } }
|
||||
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.ShimmerPhase1)]
|
||||
public float ShimmerPhase1 { get => _cb.ShimmerPhase.Y; set { _cb.ShimmerPhase.Y = Sanitize(value, -MaximumShimmerPhase, MaximumShimmerPhase); UpdateConstants(); } }
|
||||
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.ShimmerPhase2)]
|
||||
public float ShimmerPhase2 { get => _cb.ShimmerPhase.Z; set { _cb.ShimmerPhase.Z = Sanitize(value, -MaximumShimmerPhase, MaximumShimmerPhase); UpdateConstants(); } }
|
||||
|
||||
[CustomEffectProperty(PropertyType.Float, (int)PropertyIndex.ShimmerPhase3)]
|
||||
public float ShimmerPhase3 { get => _cb.ShimmerPhase.W; set { _cb.ShimmerPhase.W = Sanitize(value, -MaximumShimmerPhase, MaximumShimmerPhase); UpdateConstants(); } }
|
||||
|
||||
public EffectImpl() : base(ShaderResourceUri.Get("Mirage"))
|
||||
{
|
||||
_cb.HalfFieldTangent = DefaultHalfFieldTangent;
|
||||
@@ -109,6 +136,11 @@ internal sealed class MirageCustomEffect(IGraphicsDevicesAndContext devices)
|
||||
public float MapSpan;
|
||||
public float MapWidth;
|
||||
public float Padding;
|
||||
public Vector4 ShimmerPhase;
|
||||
public float ShimmerAmplitude;
|
||||
public float Padding0;
|
||||
public float Padding1;
|
||||
public float Padding2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,14 @@ public sealed class MirageEffect : VideoEffectBase
|
||||
public MirageSource Source { get => _source; set => Set(ref _source, value); }
|
||||
private MirageSource _source = MirageSource.Photo;
|
||||
|
||||
[Display(GroupName = nameof(Texts.AtmosphereGroup), Name = nameof(Texts.Shimmer), Description = nameof(Texts.ShimmerDescription), Order = 19, ResourceType = typeof(Texts))]
|
||||
[AnimationSlider("F1", "%", MirageSettings.MinimumShimmerPercent, MirageSettings.MaximumShimmerPercent)]
|
||||
public Animation Shimmer { get; } = new Animation(0, MirageSettings.MinimumShimmerPercent, MirageSettings.MaximumShimmerPercent);
|
||||
|
||||
[Display(GroupName = nameof(Texts.AtmosphereGroup), Name = nameof(Texts.ShimmerSpeed), Description = nameof(Texts.ShimmerSpeedDescription), Order = 20, ResourceType = typeof(Texts))]
|
||||
[AnimationSlider("F2", "×", MirageSettings.MinimumShimmerSpeed, MirageSettings.MaximumShimmerSpeed)]
|
||||
public Animation ShimmerSpeed { get; } = new Animation(MirageSettings.DefaultShimmerSpeed, MirageSettings.MinimumShimmerSpeed, MirageSettings.MaximumShimmerSpeed);
|
||||
|
||||
[Display(GroupName = nameof(Texts.CameraGroup), Name = nameof(Texts.FieldOfView), Description = nameof(Texts.FieldOfViewDescription), Order = 20, ResourceType = typeof(Texts))]
|
||||
[AnimationSlider("F2", "°", MirageSettings.MinimumFieldOfViewDegrees, MirageSettings.MaximumFieldOfViewDegrees)]
|
||||
public Animation FieldOfView { get; } = new Animation(3, MirageSettings.MinimumFieldOfViewDegrees, MirageSettings.MaximumFieldOfViewDegrees);
|
||||
@@ -96,5 +104,5 @@ public sealed class MirageEffect : VideoEffectBase
|
||||
}
|
||||
|
||||
protected override IEnumerable<IAnimatable> GetAnimatables()
|
||||
=> _animatables ??= [Amount, EyeHeight, HeatDifference, HeatThickness, InversionDifference, InversionHeight, InversionThickness, Distance, FieldOfView, CameraPitch];
|
||||
=> _animatables ??= [Amount, EyeHeight, HeatDifference, HeatThickness, InversionDifference, InversionHeight, InversionThickness, Distance, FieldOfView, CameraPitch, Shimmer, ShimmerSpeed];
|
||||
}
|
||||
@@ -62,19 +62,35 @@ internal sealed class MirageEffectProcessor(IGraphicsDevicesAndContext devices,
|
||||
}
|
||||
|
||||
var pitch = Math.Clamp(_item.CameraPitch.GetValue(frame, length, fps), MirageSettings.MinimumCameraPitchDegrees, MirageSettings.MaximumCameraPitchDegrees) * MirageSettings.RadiansPerDegree;
|
||||
var constantKey = new ConstantKey(amount, MirageSettings.GetHalfFieldOfViewTangent(_item.FieldOfView.GetValue(frame, length, fps)), (float)Math.Cos(pitch), (float)Math.Sin(pitch));
|
||||
var shimmer = Math.Clamp(_item.Shimmer.GetValue(frame, length, fps), MirageSettings.MinimumShimmerPercent, MirageSettings.MaximumShimmerPercent) / 100.0;
|
||||
var amplitude = (float)(shimmer * MirageSettings.ShimmerAmplitudeRadians);
|
||||
var cycles = Math.Clamp(_item.ShimmerSpeed.GetValue(frame, length, fps), MirageSettings.MinimumShimmerSpeed, MirageSettings.MaximumShimmerSpeed) * frame / fps;
|
||||
var constantKey = new ConstantKey(amount, MirageSettings.GetHalfFieldOfViewTangent(_item.FieldOfView.GetValue(frame, length, fps)), (float)Math.Cos(pitch), (float)Math.Sin(pitch), amplitude, GetPhase(amplitude, 0, cycles), GetPhase(amplitude, 1, cycles), GetPhase(amplitude, 2, cycles), GetPhase(amplitude, 3, cycles));
|
||||
if (_isFirst || _constantKey.HalfFieldTangent != constantKey.HalfFieldTangent)
|
||||
_effect.HalfFieldTangent = constantKey.HalfFieldTangent;
|
||||
if (_isFirst || _constantKey.PitchCosine != constantKey.PitchCosine)
|
||||
_effect.PitchCosine = constantKey.PitchCosine;
|
||||
if (_isFirst || _constantKey.PitchSine != constantKey.PitchSine)
|
||||
_effect.PitchSine = constantKey.PitchSine;
|
||||
if (_isFirst || _constantKey.ShimmerAmplitude != constantKey.ShimmerAmplitude)
|
||||
_effect.ShimmerAmplitude = constantKey.ShimmerAmplitude;
|
||||
if (_isFirst || _constantKey.ShimmerPhase0 != constantKey.ShimmerPhase0)
|
||||
_effect.ShimmerPhase0 = constantKey.ShimmerPhase0;
|
||||
if (_isFirst || _constantKey.ShimmerPhase1 != constantKey.ShimmerPhase1)
|
||||
_effect.ShimmerPhase1 = constantKey.ShimmerPhase1;
|
||||
if (_isFirst || _constantKey.ShimmerPhase2 != constantKey.ShimmerPhase2)
|
||||
_effect.ShimmerPhase2 = constantKey.ShimmerPhase2;
|
||||
if (_isFirst || _constantKey.ShimmerPhase3 != constantKey.ShimmerPhase3)
|
||||
_effect.ShimmerPhase3 = constantKey.ShimmerPhase3;
|
||||
|
||||
_constantKey = constantKey;
|
||||
_isFirst = false;
|
||||
return effectDescription.DrawDescription;
|
||||
}
|
||||
|
||||
private static float GetPhase(float amplitude, int component, double cycles)
|
||||
=> amplitude > 0f ? MirageSettings.GetShimmerPhase(component, cycles) : 0f;
|
||||
|
||||
private float[] Build(MapKey key)
|
||||
{
|
||||
if (key.Kind == MirageKind.Inferior)
|
||||
@@ -162,5 +178,5 @@ internal sealed class MirageEffectProcessor(IGraphicsDevicesAndContext devices,
|
||||
|
||||
private readonly record struct MapKey(MirageKind Kind, double EyeHeight, double HeatDifference, double HeatThickness, double InversionDifference, double InversionHeight, double InversionThickness, double Distance, MirageSource Source);
|
||||
|
||||
private readonly record struct ConstantKey(float Amount, float HalfFieldTangent, float PitchCosine, float PitchSine);
|
||||
private readonly record struct ConstantKey(float Amount, float HalfFieldTangent, float PitchCosine, float PitchSine, float ShimmerAmplitude, float ShimmerPhase0, float ShimmerPhase1, float ShimmerPhase2, float ShimmerPhase3);
|
||||
}
|
||||
@@ -35,6 +35,11 @@ internal static class MirageSettings
|
||||
public const double MaximumFieldOfViewDegrees = 60.0;
|
||||
public const double MinimumCameraPitchDegrees = -20.0;
|
||||
public const double MaximumCameraPitchDegrees = 20.0;
|
||||
public const double MinimumShimmerPercent = 0.0;
|
||||
public const double MaximumShimmerPercent = 100.0;
|
||||
public const double MinimumShimmerSpeed = 0.0;
|
||||
public const double MaximumShimmerSpeed = 5.0;
|
||||
public const double DefaultShimmerSpeed = 1.0;
|
||||
|
||||
public const double MetersPerKilometer = 1000.0;
|
||||
public const double StandardLayerScaleMeters = 100.0;
|
||||
@@ -48,6 +53,14 @@ internal static class MirageSettings
|
||||
public const int MaximumTaps = 16;
|
||||
public const double FillRadiusFraction = 0.006;
|
||||
public const int FillTaps = 9;
|
||||
public const double ShimmerAmplitudeDegrees = 0.02;
|
||||
public const double ShimmerAmplitudeRadians = ShimmerAmplitudeDegrees * RadiansPerDegree;
|
||||
|
||||
public static readonly float[] ShimmerAzimuthFrequencies = [400f, 170f, 650f, 95f];
|
||||
public static readonly float[] ShimmerElevationFrequencies = [2570f, 1330f, 4000f, 720f];
|
||||
public static readonly float[] ShimmerWeights = [1f, 0.7f, 0.5f, 0.35f];
|
||||
public static readonly double[] ShimmerCyclesPerSecond = [1.1, 1.7, 2.9, 0.6];
|
||||
public static readonly double[] ShimmerOffsetCycles = [0.13, 0.57, 0.81, 0.35];
|
||||
|
||||
public static readonly float MinimumHalfFieldTangent = GetHalfFieldOfViewTangent(MinimumFieldOfViewDegrees);
|
||||
public static readonly float MaximumHalfFieldTangent = GetHalfFieldOfViewTangent(MaximumFieldOfViewDegrees);
|
||||
@@ -61,6 +74,12 @@ internal static class MirageSettings
|
||||
public static double GetMapAngleRadians(int index)
|
||||
=> GetMapStartRadians() + index * GetMapSpanRadians() / (MapWidth - 1);
|
||||
|
||||
public static float GetShimmerPhase(int component, double cycles)
|
||||
{
|
||||
var turns = ShimmerOffsetCycles[component] - ShimmerCyclesPerSecond[component] * cycles;
|
||||
return (float)((turns - Math.Floor(turns)) * 2.0 * Math.PI);
|
||||
}
|
||||
|
||||
public static float GetHalfFieldOfViewTangent(double fieldOfViewDegrees)
|
||||
{
|
||||
var field = Math.Clamp(fieldOfViewDegrees, MinimumFieldOfViewDegrees, MaximumFieldOfViewDegrees);
|
||||
|
||||
@@ -31,6 +31,10 @@ SourcePhoto,,写真,Photo,照片,照片,사진,Foto,صورة,Foto
|
||||
SourcePhotoDescription,,標準の大気で撮った写真として扱います。水平線の陰に隠れた部分は使えません,Treated as a photo taken in a standard atmosphere. Parts hidden below the horizon cannot be used,视为在标准大气中拍摄的照片。隐藏在地平线之下的部分无法使用,視為在標準大氣中拍攝的照片。隱藏在地平線之下的部分無法使用,표준 대기에서 찍은 사진으로 다룹니다. 수평선 아래에 가려진 부분은 쓸 수 없습니다,Se trata como una foto tomada en una atmósfera estándar. No se pueden usar las partes ocultas bajo el horizonte,يُعامل كصورة التُقطت في غلاف جوي قياسي. لا يمكن استخدام الأجزاء المختفية تحت الأفق,Diperlakukan sebagai foto yang diambil di atmosfer standar. Bagian yang tersembunyi di bawah cakrawala tidak dapat dipakai
|
||||
SourceScene,,景色,Scenery,景物,景物,풍경,Paisaje,منظر,Pemandangan
|
||||
SourceSceneDescription,,大気の屈折を受けない景色として扱います。水平線の陰に隠れた部分も、映像にあれば使います,Treated as scenery unaffected by refraction. Parts hidden below the horizon are used if the image has them,视为不受大气折射影响的景物。若影像中有隐藏在地平线之下的部分,也会使用,視為不受大氣折射影響的景物。若影像中有隱藏在地平線之下的部分,也會使用,대기 굴절을 받지 않은 풍경으로 다룹니다. 수평선 아래에 가려진 부분도 영상에 있으면 씁니다,Se trata como un paisaje sin refracción. Las partes ocultas bajo el horizonte se usan si la imagen las tiene,يُعامل كمنظر لا يتأثر بالانكسار. تُستخدم الأجزاء المختفية تحت الأفق إن وُجدت في الصورة,Diperlakukan sebagai pemandangan tanpa refraksi. Bagian yang tersembunyi di bawah cakrawala dipakai jika ada pada gambar
|
||||
Shimmer,,揺らぎ,Shimmer,摇曳,搖曳,아지랑이,Ondulación,التموج,Getaran
|
||||
ShimmerDescription,,蜃気楼の像が揺れる量です。0%では揺れません。空気の乱れを計算するものではなく、見かけの仰角に決まった波を足して像を揺らします,Amount by which the mirage image wavers. At 0% it does not move. It does not calculate air turbulence and instead adds fixed waves to the apparent elevation to shake the image,海市蜃楼的像摇曳的程度。为0%时不摇曳。它不计算空气的湍流,而是在视仰角上叠加固定的波来使像摇曳,海市蜃樓的像搖曳的程度。為0%時不搖曳。它不計算空氣的亂流,而是在視仰角上疊加固定的波來使像搖曳,신기루의 상이 흔들리는 정도입니다. 0%이면 흔들리지 않습니다. 공기의 난류를 계산하는 것이 아니라 겉보기 고도각에 정해진 파동을 더해 상을 흔듭니다,Cantidad con la que tiembla la imagen del espejismo. Con 0% no se mueve. No calcula la turbulencia del aire sino que suma ondas fijas a la elevación aparente para agitar la imagen,مقدار اهتزاز صورة السراب. عند 0% لا تهتز. لا يحسب الاضطراب في الهواء بل يضيف موجات ثابتة إلى الارتفاع الظاهري لتهتز الصورة,Seberapa besar bayangan fatamorgana bergoyang. Pada 0% tidak bergoyang. Ini tidak menghitung turbulensi udara melainkan menambahkan gelombang tetap pada elevasi semu untuk menggoyangkan bayangan
|
||||
ShimmerSpeed,,揺らぎの速さ,Shimmer Speed,摇曳速度,搖曳速度,아지랑이 속도,Velocidad de ondulación,سرعة التموج,Kecepatan Getaran
|
||||
ShimmerSpeedDescription,,揺らぎが動く速さです。1が標準の速さで、0では止まります。動きはフレームの位置から決まります,Speed at which the shimmer moves. 1 is the standard speed and 0 stops it. The motion is determined by the frame position,摇曳变化的速度。1为标准速度,0时停止。动作由帧的位置决定,搖曳變化的速度。1為標準速度,0時停止。動作由影格的位置決定,흔들림이 움직이는 속도입니다. 1이 표준 속도이며 0이면 멈춥니다. 움직임은 프레임 위치로 정해집니다,Velocidad con la que se mueve la ondulación. 1 es la velocidad estándar y 0 la detiene. El movimiento depende de la posición del fotograma,سرعة حركة التموج. القيمة 1 هي السرعة القياسية والقيمة 0 توقفه. تتحدد الحركة بموضع الإطار,Kecepatan gerak getaran. 1 adalah kecepatan standar dan 0 menghentikannya. Gerakan ditentukan oleh posisi bingkai
|
||||
FieldOfView,,画角,Field of View,视角,視角,화각,Campo visual,مجال الرؤية,Bidang Pandang
|
||||
FieldOfViewDescription,,カメラの横方向の画角です。小さいほど、同じ蜃気楼が画面で大きく見えます,Horizontal field of view of the camera. Smaller values make the same mirage look larger on screen,相机的水平视角。数值越小,同样的海市蜃楼在画面中越大,相機的水平視角。數值越小,同樣的海市蜃樓在畫面中越大,카메라의 가로 화각입니다. 작을수록 같은 신기루가 화면에서 더 크게 보입니다,Campo visual horizontal de la cámara. Los valores menores hacen que el mismo espejismo se vea más grande en pantalla,مجال الرؤية الأفقي للكاميرا. كلما قلت القيمة بدا السراب نفسه أكبر على الشاشة,Bidang pandang horizontal kamera. Nilai yang lebih kecil membuat fatamorgana yang sama tampak lebih besar di layar
|
||||
CameraPitch,,チルト,Tilt,相机俯仰角,相機俯仰角,틸트,Inclinación,ميل الكاميرا,Kemiringan
|
||||
|
||||
|
新しいイシューから参照
ユーザーをブロックする