diff --git a/Dockerfile b/Dockerfile index 462741744..7b460e293 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ fi RUN mkdir /opt/infinigen WORKDIR /opt/infinigen COPY . . -RUN chmod +x worldgen/tools/compile_opengl.sh +RUN chmod +x worldgen/tools/install/compile_opengl.sh RUN conda init bash \ && . ~/.bashrc \ && conda create --name infinigen python=3.10 \ diff --git a/Makefile b/Makefile index 131c521a6..70ead5f4a 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ docker-run: -v /etc/group:/etc/group:ro \ "$(DOCKER_TAG)" bash - docker exec infinigen /bin/bash -c worldgen/tools/compile_opengl.sh + docker exec infinigen /bin/bash -c worldgen/tools/install/compile_opengl.sh docker-run-no-opengl: echo "Launching Docker image without OpenGL ground truth" @@ -91,7 +91,7 @@ docker-run-no-gpu: -v /etc/group:/etc/group:ro \ "$(DOCKER_TAG)" /bin/bash \ - docker exec infinigen /bin/bash -c worldgen/tools/compile_opengl.sh + docker exec infinigen /bin/bash -c worldgen/tools/install/compile_opengl.sh docker-run-no-gpu-opengl: echo "Launching Docker image without GPU passthrough or OpenGL" diff --git a/README.md b/README.md index e3606d42a..b2116d05d 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Please post this repository's Github Issues page for help. Please run your comma Infinigen wouldn't be possible without the fantastic work of the [Blender Foundation](https://www.blender.org/) and it's open-source contributors. Infinigen uses many open source projects, with special thanks to [Land-Lab](https://github.com/landlab/landlab), [BlenderProc](https://github.com/DLR-RM/BlenderProc) [Blender-FLIP-Fluids](https://github.com/rlguy/Blender-FLIP-Fluids) and [Blender-Differential-Growth](https://github.com/inca/blender-differential-growth). -We thank [Thomas Kole](https://blenderartists.org/u/ThomasKole) for providing procedural clouds (which are more photorealistic than our original version) and [Pedro P. Lopes](https://blendswap.com/blend/30728) for the autoexposure nodegraph. +We thank [Thomas Kole](https://blenderartists.org/u/ThomasKole) for providing procedural clouds and [Pedro P. Lopes](https://blendswap.com/blend/30728) for the autoexposure nodegraph. We learned tremendously from online tutorials of [Andrew Price](https://www.youtube.com/channel/UCOKHwx1VCdgnxwbjyb9Iu1g), diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7d4193631..fdc2c0b08 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,4 @@ v1.0.0 - Beta code release
v1.0.1 - BSD-3 license, expanded ground-truth docs, show line-credits, miscellaneous fixes
-v1.0.2 - New documentation, plant improvements, disk and reproducibility improvements \ No newline at end of file +v1.0.2 - New documentation, plant improvements, disk and reproducibility improvements
+v1.0.3 - Fluid code release, implementing assets documentation, render tools improvements, integration tests
diff --git a/docs/GeneratingFluidSimulations.md b/docs/GeneratingFluidSimulations.md index e6e4d6f4d..d04517427 100644 --- a/docs/GeneratingFluidSimulations.md +++ b/docs/GeneratingFluidSimulations.md @@ -10,15 +10,16 @@ To generate fluids, you run install.sh with the optional FLIP-Fluids setup step #### Generate a video of a single scene with simulated fire generated on the fly ``` -python -m tools.manage_datagen_jobs --specific_seed 3930249d --output_folder outputs/fire --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin --wandb_mode online --cleanup none --config plain.gin fast_terrain_assets.gin use_on_the_fly_fire.gin +python -m tools.manage_datagen_jobs --specific_seed 3930249d --output_folder outputs/fire --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin --cleanup none --config plain.gin fast_terrain_assets.gin use_on_the_fly_fire.gin ``` Because fluid simulation takes a long time, the fire resolution can be reduced in use_on_the_fly_fire.gin, by setting `set_obj_on_fire.resolution = {resolution}`. This will reduce the fire quality but speed up the simulation. #### Generate a video of a single valley scene with simulated river ``` -python -m tools.manage_datagen_jobs --specific_seed 61fc881a --output_folder outputs/river --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin opengl_gt.gin cuda_terrain.gin --pipeline_overrides iterate_scene_tasks.frame_range=[100,244] --config river.gin simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin --wandb_mode online --cleanup none +python -m tools.manage_datagen_jobs --specific_seed 1c95bb72 --output_folder outputs/river --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin opengl_gt.gin cuda_terrain.gin --pipeline_overrides iterate_scene_tasks.frame_range=[150,200] --config river.gin simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin --cleanup none ``` -Similar to fire, the simulation can be sped up by reducing the resolution. In simulated_river.gin, the resolution can be modified by setting `make_river.resolution = {resolution}`. +Similar to fire, the simulation can be sped up by reducing the resolution. In simulated_river.gin, the resolution can be modified by setting `make_river.resolution = {resolution}`. The simulation can also be sped up by reducing the simulation duration in simulated_river.gin by setting `make_river.simulation_duration = {duration}`. For instance, before running the command above, the duration can be reduced to a number greater than 200 since that is the last frame of the video. + Also, note that this command will produce a scene without assets to speed up the process. However, the liquids generally interact with the objects by splashing on them, and a scene like this can be produced by removing the `no_assets.gin` option in the above command. #### Generate videos of random scene types, with simulated fire generated on the fly when needed @@ -26,7 +27,7 @@ Also, note that this command will produce a scene without assets to speed up the python -m tools.manage_datagen_jobs --output_folder outputs/onthefly --num_scenes 10 \ --pipeline_config slurm_high_memory.gin monocular_video.gin \ --config fast_terrain_assets.gin use_on_the_fly_fire.gin \ - --wandb_mode online --cleanup none --warmup_sec 12000 + --cleanup none --warmup_sec 12000 ``` #### Generate videos of valley scenes with simulated rivers @@ -35,7 +36,7 @@ python -m tools.manage_datagen_jobs --output_folder /n/fs/pvl-renders/kkayan/riv --pipeline_config slurm_high_memory.gin monocular_video.gin opengl_gt.gin cuda_terrain.gin \ --pipeline_overrides iterate_scene_tasks.frame_range=[100,244] \ --config simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin \ - --wandb_mode online --cleanup none --warmup_sec 12000 + --cleanup none --warmup_sec 12000 ``` diff --git a/docs/GroundTruthAnnotations.md b/docs/GroundTruthAnnotations.md index a458bb1c8..f5f6a1494 100644 --- a/docs/GroundTruthAnnotations.md +++ b/docs/GroundTruthAnnotations.md @@ -61,7 +61,7 @@ bash install.sh opengl ``` Or, if you have already run `install.sh` earlier, you can just run ``` -bash worldgen/tools/compile_opengl.sh +bash worldgen/tools/install/compile_opengl.sh ``` ### Extended Hello-World diff --git a/docs/ImplementingAssets.md b/docs/ImplementingAssets.md index 9a2cac045..55a7602b8 100644 --- a/docs/ImplementingAssets.md +++ b/docs/ImplementingAssets.md @@ -14,21 +14,21 @@ This guide does not cover how to add new elements to the terrain marching cubes ## Setting up the Blender UI for interactive development -Unless you intend to work solely on python/other code (and dont intend to interact much with Blender APIs) it will help you to have easy access to Infinigen via the Blender UI. +Unless you intend to work solely on python/other code (and don't intend to interact much with Blender APIs) it will help you to have easy access to Infinigen via the Blender UI. To open the Blender UI, run the following in a terminal: ``` cd infinigen/worldgen $BLENDER dev_scene.blend ``` -:warning: You must use $BLENDER, which refers to the blender installation located in infinigen/blender, as it has additional dependencies installed. Using another blender installation is fine to open or inspect files, but it will not be able to run any of Blender's code or tools. +:warning: You must use $BLENDER, which refers to the blender installation located in infinigen/blender, as it has additional dependencies installed. Using another blender installation is fine to open or inspect files, but it will not be able to run any of Infinigen's code or tools. We recommend you set your Blender UI up so you can see a Text Editor, Python Console, 3D Viewport, Geometry Nodes and a Shader Nodes window. The easiest way to do this is to complete the following steps (UI locations also marked in red in the screenshot below): 1. Click the "Geometry Nodes" tab -1. Use the dropdown in the topleft of the spreadsheet window (marked in #1 red) to change it to a Text Editor. -1. Drag up from the bottom right of the window (marked in #2 red) to split it in half vertically. Convert this new window to a Python console using the dropdown in it's top-left corner, similarly to step 2. +1. Use the dropdown in the top left of the spreadsheet window (marked in #1 red) to change it to a Text Editor. +1. Drag up from the bottom right of the window (marked in #2 red) to split it in half vertically. Convert this new window to a Python console using the dropdown in its top-left corner, similarly to step 2. 1. Click the New button (marked #4 in red) to add a geometry node group to the cube -1. Drag left from the bottom right corner of the geometry nodes window (similarly as in step 3) to split the window in half, and use the dropdown in the topleft of the new window to convert it into a Shader Editor. +1. Drag left from the bottom right corner of the geometry nodes window (similarly as in step 3) to split the window in half, and use the dropdown in the top left of the new window to convert it into a Shader Editor. ![Arranging Blender UI Panels](images/implementing_assets/setting_up_blender_ui_1.png) @@ -36,19 +36,19 @@ Once these steps are complete, you should see something similar to the following ![Completed result after arranging](images/implementing_assets/setting_up_blender_ui_2.png) -You do not have to use this UI configuration all the time, but the following steps assume you have these three windows (Text Editor, 3D Viewport, Geometry Nodes) visible to you. +You do not have to use this UI configuration all the time, but the following steps assume you know how to access these windows when needed. ## Importing Infinigen's dependencies into the Blender UI Finally, to import Infinigen into your Blender UI, click the 'Open' button on your `Text Editor` panel, then navigate to and open `worldgen/tools/blendscript_import_infinigen.py`. Click the play button to execute the script. -You will need to re-run this script every time you restart Blender. +:warning: You will need to re-run this script every time you restart Blender. ## Generating assets/materials via Blender Python Commandline -Now that you have imported Infinigen into Blender, you can easily access all it's assets and materials via the commandline. +Now that you have imported Infinigen into Blender, you can easily access all its assets and materials via the commandline. -To start, we reccomend using Infinigen's sky lighting while you make your asset, so you can get a better sense of what the asset will look like in full scenes. To sample a random sky lighting, run the following two steps in your Blender console: +To start, we recommend using Infinigen's sky lighting while you make your asset, so you can get a better sense of what the asset will look like in full scenes. To sample a random sky lighting, run the following two steps in your Blender console: ``` from lighting import lighting lighting.add_lighting() @@ -184,5 +184,5 @@ from assets import myasset importlib.reload(myasset) seed = 0 -obj = myasset.MyAssetFactory(seed).spawn_asset() +obj = myasset.MyAssetFactory(seed).spawn_asset(0) ``` \ No newline at end of file diff --git a/install.sh b/install.sh index 2f49f2cb0..012f1e3c1 100755 --- a/install.sh +++ b/install.sh @@ -125,6 +125,6 @@ fi # Build Flip Fluids addon -if [ "$1" = "flip_fluids" ] || if [ "$2" = "flip_fluids" ]; then +if [ "$1" = "flip_fluids" ] || [ "$2" = "flip_fluids" ]; then bash ./worldgen/tools/install/compile_flip_fluids.sh fi \ No newline at end of file diff --git a/worldgen/config/scene_types_fluidsim/simulated_river.gin b/worldgen/config/scene_types_fluidsim/simulated_river.gin index 8e3dfdeeb..6c81ae815 100644 --- a/worldgen/config/scene_types_fluidsim/simulated_river.gin +++ b/worldgen/config/scene_types_fluidsim/simulated_river.gin @@ -27,4 +27,5 @@ core.render.hide_water = True compute_base_views.min_candidates_ratio = 1 walk_same_altitude.ignore_missed_rays = True -make_river.resolution = 400 \ No newline at end of file +make_river.resolution = 400 +make_river.simulation_duration = 250 \ No newline at end of file diff --git a/worldgen/core.py b/worldgen/core.py index ed34e2075..66f613e78 100644 --- a/worldgen/core.py +++ b/worldgen/core.py @@ -73,7 +73,7 @@ from assets.utils.tag import tag_system -VERSION = '1.0.2' +VERSION = '1.0.3' def sanitize_gin_override(overrides: list): if len(overrides) > 0: