Derive native volume texture scale from viewport
This commit is contained in:
parent
9799dbe9fe
commit
3c8d127ef8
4 changed files with 68 additions and 3 deletions
|
|
@ -73,6 +73,25 @@ namespace GameCult.Eve.UnityScene.Tests
|
|||
Assert.That(error, Does.Contain("history port"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VolumeRendererDerivesViewportTextureScaleFromNativeDimensions()
|
||||
{
|
||||
var texture = new Texture2D(128, 64, TextureFormat.RGBA32, false);
|
||||
try
|
||||
{
|
||||
Assert.That(EveUnityFieldsVolumeRenderer.TryComputeViewportTextureScale(
|
||||
640,
|
||||
360,
|
||||
texture,
|
||||
out var scale), Is.True);
|
||||
Assert.That(scale, Is.EqualTo(new Vector4(5f, 5.625f, 0f, 0f)));
|
||||
}
|
||||
finally
|
||||
{
|
||||
UnityEngine.Object.DestroyImmediate(texture);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PackageContainsGenericFieldsShader()
|
||||
{
|
||||
|
|
|
|||
Reference in a new issue