mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 16:25:36 +00:00
Time procedural bakes in the studio with a median-of-five meter
Authors could not see what a procedural object costs generation. The Procedural view now bakes the chosen entry five times in the background, keeps the median run, and rates it Light, Moderate or Heavy against a server tick, with each stage's time in the tooltip. SceneView gains isBaked and timeBake (one run, a BakeRun); the studio asks five times so a newer choice stops the rest. No pins moved: generation bakes with BakeProfile.NONE and nothing in packs changed. v3: 9e30508e3 7d240ddf8
This commit is contained in:
1 parent
f3bf0aea4b
commit
76dcab175b
14 files changed
+448
-6
No files matched your search
@@ -18,12 +18,14 @@
|
||||
|
||||
package art.arcane.iris.modules.objects;
|
||||
|
||||
import art.arcane.iris.engine.procedural.BakeProfile;
|
||||
import art.arcane.iris.engine.procedural.ProceduralObjectCatalog;
|
||||
import art.arcane.iris.engine.procedural.ProceduralVariants;
|
||||
import art.arcane.iris.engine.procedural.part.ProceduralObject;
|
||||
import com.volmit.object.GeneratedObject;
|
||||
import com.volmit.object.PlaceableObject;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.tooling.BakeRun;
|
||||
import com.volmit.tooling.EditableSceneView;
|
||||
import com.volmit.tooling.JsonText;
|
||||
import com.volmit.tooling.NodeGraph;
|
||||
@@ -31,6 +33,7 @@ import com.volmit.tooling.SceneEntry;
|
||||
import com.volmit.tooling.SceneFile;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -73,6 +76,18 @@ public final class ProceduralObjectScenes implements EditableSceneView {
|
||||
.map(PlaceableObject::geometry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBaked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<BakeRun> timeBake(PackWorld world, String key) {
|
||||
return ProceduralObjectCatalog.of(world).variants(ProceduralObjectCatalog.KEY_PREFIX + key)
|
||||
.map(ProceduralVariants::profileBake)
|
||||
.map(ProceduralObjectScenes::runOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<SceneFile> fileOf(PackWorld world, String key) {
|
||||
ResourceId id = world.resources().idOf(key);
|
||||
@@ -89,6 +104,13 @@ public final class ProceduralObjectScenes implements EditableSceneView {
|
||||
return ProceduralObjectGraph.of(key.substring(key.lastIndexOf(FOLDER_SEPARATOR) + 1), text, read);
|
||||
}
|
||||
|
||||
private static BakeRun runOf(BakeProfile profile) {
|
||||
List<BakeRun.Stage> stages = Arrays.stream(BakeProfile.Stage.values())
|
||||
.map(stage -> new BakeRun.Stage(stage.label(), profile.nanos(stage)))
|
||||
.toList();
|
||||
return new BakeRun(profile.variantCount(), stages);
|
||||
}
|
||||
|
||||
private static SceneEntry entryOf(ProceduralVariants variants) {
|
||||
String path = variants.path();
|
||||
int lastSeparator = path.lastIndexOf(FOLDER_SEPARATOR);
|
||||
|
||||
Reference in new issue
Block a user