Skip to content

Commit

Permalink
u1/ut99/uc2/ut2003/4->ut3/ut4: increased light radius by 10%
Browse files Browse the repository at this point in the history
  • Loading branch information
xtremexp committed Jan 25, 2023
1 parent df260eb commit 3e09ee7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/xtx/ut4converter/t3d/T3DLight.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public void convert() {
this.radius *= 32;

// needs to scale up again to fit correct radius in UE4+
//this.radius *= 1.12;
this.radius *= 1.1;

this.lightFalloffExponent = 3d;
this.intensity = mapConverter.isFrom(UE1) ? 15f : 1f;
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/org/xtx/ut4converter/t3d/T3DLightTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ void testLightConversionU1toUT4() throws IOException, ReflectiveOperationExcepti
Assertions.assertEquals(208, u1Light.brightness);

final String convT3d = u1Light.convertScaleAndToT3D(2d);

System.out.println(convT3d);
Assertions.assertTrue(convT3d.contains("Intensity=15.0"));
Assertions.assertTrue(convT3d.contains("LightColor=(B=68,G=137,R=208,A=255)"));
Assertions.assertTrue(convT3d.contains("bUseInverseSquaredFalloff=false"));
Assertions.assertTrue(convT3d.contains("LightFalloffExponent=3.0"));
Assertions.assertTrue(convT3d.contains("AttenuationRadius=1856.0")); // radius * 32 * {ScaleFactor}
System.out.println(convT3d);
Assertions.assertTrue(convT3d.contains("AttenuationRadius=2041.6")); // radius * 32 * 1.1 * {ScaleFactor}
}

@Test
Expand Down

0 comments on commit 3e09ee7

Please sign in to comment.