Skip to content

Commit

Permalink
Prepare iron to c port
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 29, 2024
1 parent ca9db11 commit f98e732
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions armorforge/Sources/TabObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,20 @@ class TabObjects {
Context.raw.selectedObject.transform.dirty = true;

if (Context.raw.selectedObject.name == "Scene") {
let p = Scene.active.world.probe;
let p = Scene.active.world;
p.raw.strength = ui.slider(Zui.handle("tabobjects_16", {value: p.raw.strength}), "Environment", 0.0, 5.0, true);
}
else if (Context.raw.selectedObject.constructor == LightObject) {
let light = (Context.raw.selectedObject as LightObject);
let lightHandle = Zui.handle("tabobjects_17");
lightHandle.value = light.data.raw.strength / 10;
light.data.raw.strength = ui.slider(lightHandle, "Strength", 0.0, 5.0, true) * 10;
lightHandle.value = light.data.strength / 10;
light.data.strength = ui.slider(lightHandle, "Strength", 0.0, 5.0, true) * 10;
}
else if (Context.raw.selectedObject.constructor == CameraObject) {
let cam = (Context.raw.selectedObject as CameraObject);
let fovHandle = Zui.handle("tabobjects_18");
fovHandle.value = Math.floor(cam.data.raw.fov * 100) / 100;
cam.data.raw.fov = ui.slider(fovHandle, "FoV", 0.3, 2.0, true);
fovHandle.value = Math.floor(cam.data.fov * 100) / 100;
cam.data.fov = ui.slider(fovHandle, "FoV", 0.3, 2.0, true);
if (fovHandle.changed) {
cam.buildProjection();
}
Expand Down
2 changes: 1 addition & 1 deletion base/Sources/RenderPathRaytrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RenderPathRaytrace {
Context.updateEnvmap();
}

let probe = Scene.active.world.probe;
let probe = Scene.active.world;
let savedEnvmap = Context.raw.showEnvmapBlur ? probe.radianceMipmaps[0] : Context.raw.savedEnvmap;

if (RenderPathRaytrace.lastEnvmap != savedEnvmap) {
Expand Down
4 changes: 2 additions & 2 deletions base/Sources/RenderPathRaytraceBake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class RenderPathRaytraceBake {
Context.loadEnvmap();
Context.updateEnvmap();
}
let probe = Scene.active.world.probe;
let probe = Scene.active.world;
let savedEnvmap = Context.raw.showEnvmapBlur ? probe.radianceMipmaps[0] : Context.raw.savedEnvmap;
if (RenderPathRaytrace.lastEnvmap != savedEnvmap || RenderPathRaytraceBake.lastLayer != Context.raw.layer.texpaint) {
RenderPathRaytrace.lastEnvmap = savedEnvmap;
Expand All @@ -101,7 +101,7 @@ class RenderPathRaytraceBake {
f32a[1] = Context.raw.bakeAoStrength;
f32a[2] = Context.raw.bakeAoRadius;
f32a[3] = Context.raw.bakeAoOffset;
f32a[4] = Scene.active.world.probe.raw.strength;
f32a[4] = Scene.active.world.raw.strength;
f32a[5] = Context.raw.bakeUpAxis;
f32a[6] = Context.raw.envmapAngle;

Expand Down

0 comments on commit f98e732

Please sign in to comment.