Skip to content

Commit

Permalink
v1.0.3 - Fluid code release, implementing assets documentation, rende…
Browse files Browse the repository at this point in the history
…r tool improvements, integration tests
  • Loading branch information
pvl-bot committed Aug 15, 2023
1 parent a124321 commit 366836b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v1.0.0 - Beta code release <br>
v1.0.1 - BSD-3 license, expanded ground-truth docs, show line-credits, miscellaneous fixes <br>
v1.0.2 - New documentation, plant improvements, disk and reproducibility improvements
v1.0.2 - New documentation, plant improvements, disk and reproducibility improvements <br>
v1.0.3 - Fluid code release, implementing assets documentation, render tools improvements, integration tests <br>
11 changes: 6 additions & 5 deletions docs/GeneratingFluidSimulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@ 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
```
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
Expand All @@ -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
```


Expand Down
2 changes: 1 addition & 1 deletion docs/GroundTruthAnnotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions docs/ImplementingAssets.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@ 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)

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.

<b>You will need to re-run this script every time you restart Blender. </b>
: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()
Expand Down Expand Up @@ -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)
```
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion worldgen/config/scene_types_fluidsim/simulated_river.gin
Original file line number Diff line number Diff line change
Expand Up @@ -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
make_river.resolution = 400
make_river.simulation_duration = 250
2 changes: 1 addition & 1 deletion worldgen/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 366836b

Please sign in to comment.