Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scenes/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
*.exr
42 changes: 42 additions & 0 deletions scenes/StandardShaderBall/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# StandardShaderBall for Mitsuba

[StandardShaderBall](https://github.com/usd-wg/assets/tree/main/full_assets/StandardShaderBall) exported for Mitsuba, including materials from [Physically Based](https://github.com/AntonPalmqvist/physically-based-api), and standard illuminants from [Colour](https://github.com/colour-science/colour/blob/develop/colour/colorimetry/datasets/illuminants/sds.py).
Configured for spectral rendering.

![StandardShaderBall](render.png "StandardShaderBall")

## How to use

### Via Command Line

1. Install Mitsuba, for example via PyPI with `pip install mitsuba`
2. Run `mitsuba ShaderBall.xml -Dmaterial="glass" -Dspp=64 -o render.exr`
- Variables available for use with the -D flag:
- `material` Full list of available materials can be found under [StandardShaderBall/materials](materials) (default `"gold"`)
- `illuminant` Full list of available illuminants can be found under [StandardShaderBall/illuminants](illuminants) (default `"d65"`)
- `integrator` Choose between "path" or "volpath" depending on if the material needs to render effects such as absorption (default `"path"`)
- `spp` Samples Per Pixel (default `64`)
- `max_depth` Specifies the longest path depth (default `32`)
- `resx` X resolution of the rendered image (default `600`)
- `resy` Y resolution of the rendered image (default `600`)

### Via Python Script

Your Python environment can be set up as you like, but here's a guide for [UV](https://docs.astral.sh/uv/):
1. Install uv from https://docs.astral.sh/uv/#installation
2. Create virtual environment `uv venv`
3. Activate virtual environment: `source .venv/bin/activate`
4. Install Mitsuba `uv pip install mitsuba`
5. Run `uv run render.py`
- Variables can be set in [StandardShaderBall.xml](StandardShaderBall.xml)

# License

[StandardShaderBall](https://github.com/usd-wg/assets/tree/main/full_assets/StandardShaderBall) [![CC BY 4.0][cc-by-shield]][cc-by]
[Physically Based](https://github.com/AntonPalmqvist/physically-based-api) <a href="https://github.com/AntonPalmqvist/physically-based-api?tab=CC0-1.0-1-ov-file"><img alt="GitHub License" src="https://img.shields.io/github/license/AntonPalmqvist/physically-based-api"/></a>
[Colour](https://github.com/colour-science/colour/blob/develop/colour/colorimetry/datasets/illuminants/sds.py) <a href="https://github.com/colour-science/colour?tab=BSD-3-Clause-1-ov-file#readme"><img alt="GitHub License" src="https://img.shields.io/github/license/colour-science/colour"/></a>



[cc-by]: http://creativecommons.org/licenses/by/4.0/
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
18 changes: 18 additions & 0 deletions scenes/StandardShaderBall/StandardShaderBall.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<scene version="3.0.0">

<!-- These variables can be set via the command line, like: mitsuba ShaderBall.xml -Dmaterial="glass" -Dilluminant="d55" -Dspp=64 -Dresx=300 -Dresy=300 -o render.exr -->
<default name="material" value="gold"/> <!-- Full library of materials can be found under StandardShaderBall/materials -->
<default name="illuminant" value="d65"/> <!-- Full library of illuminants can be found under StandardShaderBall/illuminants -->
<default name="integrator" value="path"/> <!-- Choose between "path" or "volpath" depending on if the material needs to render volumetric effects such as absorption -->
<default name="spp" value="64"/> <!-- Samples per pixel -->
<default name="max_depth" value="32" /> <!-- Specifies the longest path depth -->
<default name="resx" value="600"/> <!-- Horizontal resolution -->
<default name="resy" value="600"/> <!-- Vertical resolution -->

<include filename="fragments/render.xml"/>
<include filename="fragments/materials.xml"/>
<include filename="illuminants/$illuminant.xml"/>
<include filename="fragments/geometry.xml"/>

</scene>
50 changes: 50 additions & 0 deletions scenes/StandardShaderBall/fragments/geometry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<scene version="3.0.0">
<shape type="ply" id="mesh-back" name="mesh-back">
<string name="filename" value="meshes/back.ply"/>
<ref id="mat-back.001"/>
</shape>
<shape type="ply" id="mesh-base" name="mesh-base">
<string name="filename" value="meshes/base.ply"/>
<ref id="mat-neutral.001"/>
</shape>
<shape type="ply" id="mesh-core" name="mesh-core">
<string name="filename" value="meshes/core.ply"/>
<ref id="mat-neutral.001"/>
</shape>
<shape type="ply" id="mesh-front" name="mesh-front">
<string name="filename" value="meshes/front.ply"/>
<ref id="mat-front.001"/>
</shape>
<shape type="ply" id="mesh-grid" name="mesh-grid">
<string name="filename" value="meshes/grid.ply"/>
<ref id="mat-ground.001"/>
</shape>
<shape type="ply" id="mesh-left" name="mesh-left">
<string name="filename" value="meshes/left.ply"/>
<ref id="mat-left.001"/>
</shape>
<shape type="ply" id="mesh-material_surface" name="mesh-material_surface">
<string name="filename" value="meshes/material_surface.ply"/>
<ref id="mat-material_surface"/>
</shape>
<shape type="ply" id="mesh-right" name="mesh-right">
<string name="filename" value="meshes/right.ply"/>
<ref id="mat-right.001"/>
</shape>
<shape type="ply" id="mesh-sss_bars" name="mesh-sss_bars">
<string name="filename" value="meshes/sss_bars.ply"/>
<ref id="mat-sss_bars.001"/>
</shape>
<shape type="ply" id="mesh-top" name="mesh-top">
<string name="filename" value="meshes/top.ply"/>
<ref id="mat-top.001"/>
</shape>
<shape type="ply" id="mesh-backplane" name="mesh-backplane">
<string name="filename" value="meshes/backplane.ply"/>
<ref id="default-bsdf"/>
</shape>
<shape type="ply" id="mesh-backplane_001" name="mesh-backplane_001">
<string name="filename" value="meshes/backplane_001.ply"/>
<ref id="default-bsdf"/>
</shape>
</scene>
47 changes: 47 additions & 0 deletions scenes/StandardShaderBall/fragments/materials.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<scene version="3.0.0">
<include filename="materials/$material.xml"/>
<bsdf type="diffuse" id="mat-back.001" name="mat-back.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/wall_back.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-neutral.001" name="mat-neutral.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/neutral.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-front.001" name="mat-front.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/wall_front.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-ground.001" name="mat-ground.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/ground.ACEScg.4096.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-left.001" name="mat-left.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/wall_left.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-right.001" name="mat-right.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/wall_right.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-sss_bars.001" name="mat-sss_bars.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/sss_bars.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="diffuse" id="mat-top.001" name="mat-top.001">
<texture type="bitmap" name="reflectance">
<string name="filename" value="textures/wall_top.ACEScg.exr"/>
</texture>
</bsdf>
<bsdf type="twosided" id="default-bsdf" name="default-bsdf">
<bsdf type="diffuse">
</bsdf>
</bsdf>
</scene>
26 changes: 26 additions & 0 deletions scenes/StandardShaderBall/fragments/render.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<scene version="3.0.0">
<integrator type="$integrator" id="elm__0" name="elm__0">
<integer name="max_depth" value="$max_depth"/>
</integrator>
<sensor type="perspective" id="camera" name="camera">
<string name="fov_axis" value="x"/>
<float name="fov" value="23.670166"/>
<float name="principal_point_offset_x" value="0.000000"/>
<float name="principal_point_offset_y" value="-0.000000"/>
<float name="near_clip" value="0.100000"/>
<float name="far_clip" value="1000.000000"/>
<transform name="to_world">
<rotate x="1" angle="-139.9"/>
<rotate y="1" angle="-20"/>
<rotate z="1" angle="-180"/>
<translate value="6.531538 19.500002 17.948521"/>
</transform>
<sampler type="independent" name="sampler">
<integer name="sample_count" value="$spp"/>
</sampler>
<film type="hdrfilm" name="film">
<integer name="width" value="$resx"/>
<integer name="height" value="$resy"/>
</film>
</sensor>
</scene>
58 changes: 58 additions & 0 deletions scenes/StandardShaderBall/illuminants/a.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!-- Illuminant data from: https://github.com/colour-science/colour/blob/develop/colour/colorimetry/datasets/illuminants/sds.py -->
<scene version="3.0.0">
<shape type="rectangle" id="emit-light" name="emit-light">
<boolean name="flip_normals" value="true"/>
<transform name="to_world">
<matrix value="0.000001 0.000000 -0.500000 -41.366695 0.000001 7.480000 0.000000 19.882002 7.480000 -0.000001 0.000000 20.304798 0.000000 0.000000 0.000000 1.000000"/>
</transform>
<emitter type="area" name="emitter">
<!-- <rgb value="7.068584 7.068584 7.068584" name="radiance"/> -->
<spectrum name="radiance" value="300:0.07, 305:0.08, 310:0.10, 315:0.12, 320:0.14, 325:0.17, 330:0.20, 335:0.23, 340:0.27, 345:0.31, 350:0.36, 355:0.41, 360:0.46, 365:0.52, 370:0.59, 375:0.66, 380:0.73, 385:0.82, 390:0.91, 395:1.00, 400:1.10, 405:1.21, 410:1.33, 415:1.45, 420:1.57, 425:1.71, 430:1.85, 435:2.00, 440:2.15, 445:2.31, 450:2.48, 455:2.66, 460:2.84, 465:3.02, 470:3.22, 475:3.41, 480:3.62, 485:3.83, 490:4.04, 495:4.26, 500:4.49, 505:4.72, 510:4.95, 515:5.19, 520:5.44, 525:5.68, 530:5.93, 535:6.19, 540:6.45, 545:6.71, 550:6.97, 555:7.23, 560:7.50, 565:7.77, 570:8.04, 575:8.31, 580:8.58, 585:8.86, 590:9.13, 595:9.40, 600:9.68, 605:9.95, 610:10.23, 615:10.50, 620:10.77, 625:11.04, 630:11.31, 635:11.58, 640:11.85, 645:12.11, 650:12.38, 655:12.64, 660:12.90, 665:13.15, 670:13.41, 675:13.66, 680:13.91, 685:14.15, 690:14.39, 695:14.63, 700:14.87, 705:15.10, 710:15.33, 715:15.56, 720:15.78, 725:16.00, 730:16.21, 735:16.42, 740:16.63, 745:16.83, 750:17.03, 755:17.22, 760:17.41, 765:17.59, 770:17.78, 775:17.95, 780:18.13" />
</emitter>
<bsdf type="null" name="bsdf"/>
</shape>
<shape type="rectangle" id="emit-light0" name="emit-light0">
<boolean name="flip_normals" value="true"/>
<transform name="to_world">
<matrix value="12.179999 0.000000 0.000000 2.126528 0.000000 0.000000 0.500000 62.946301 0.000000 -12.180000 0.000000 21.397684 0.000000 0.000000 0.000000 1.000000"/>
</transform>
<emitter type="area" name="emitter">
<!-- <rgb value="4.712389 4.712389 4.712389" name="radiance"/> -->
<spectrum name="radiance" value="300:0.05, 305:0.06, 310:0.07, 315:0.08, 320:0.10, 325:0.11, 330:0.13, 335:0.15, 340:0.18, 345:0.21, 350:0.24, 355:0.27, 360:0.31, 365:0.35, 370:0.39, 375:0.44, 380:0.49, 385:0.54, 390:0.60, 395:0.67, 400:0.74, 405:0.81, 410:0.88, 415:0.96, 420:1.05, 425:1.14, 430:1.23, 435:1.33, 440:1.44, 445:1.54, 450:1.65, 455:1.77, 460:1.89, 465:2.02, 470:2.14, 475:2.28, 480:2.41, 485:2.55, 490:2.70, 495:2.84, 500:2.99, 505:3.15, 510:3.30, 515:3.46, 520:3.62, 525:3.79, 530:3.96, 535:4.13, 540:4.30, 545:4.47, 550:4.65, 555:4.82, 560:5.00, 565:5.18, 570:5.36, 575:5.54, 580:5.72, 585:5.90, 590:6.09, 595:6.27, 600:6.45, 605:6.63, 610:6.82, 615:7.00, 620:7.18, 625:7.36, 630:7.54, 635:7.72, 640:7.90, 645:8.08, 650:8.25, 655:8.43, 660:8.60, 665:8.77, 670:8.94, 675:9.11, 680:9.27, 685:9.44, 690:9.60, 695:9.76, 700:9.91, 705:10.07, 710:10.22, 715:10.37, 720:10.52, 725:10.66, 730:10.81, 735:10.95, 740:11.08, 745:11.22, 750:11.35, 755:11.48, 760:11.61, 765:11.73, 770:11.85, 775:11.97, 780:12.08" />
</emitter>
<bsdf type="null" name="bsdf"/>
</shape>
<shape type="rectangle" id="emit-light1" name="emit-light1">
<boolean name="flip_normals" value="true"/>
<transform name="to_world">
<matrix value="12.179999 0.000000 0.000000 31.588627 0.000000 0.000000 0.500000 62.946301 0.000000 -12.180000 0.000000 20.535725 0.000000 0.000000 0.000000 1.000000"/>
</transform>
<emitter type="area" name="emitter">
<!-- <rgb value="4.712389 4.712389 4.712389" name="radiance"/> -->
<spectrum name="radiance" value="300:0.05, 305:0.06, 310:0.07, 315:0.08, 320:0.10, 325:0.11, 330:0.13, 335:0.15, 340:0.18, 345:0.21, 350:0.24, 355:0.27, 360:0.31, 365:0.35, 370:0.39, 375:0.44, 380:0.49, 385:0.54, 390:0.60, 395:0.67, 400:0.74, 405:0.81, 410:0.88, 415:0.96, 420:1.05, 425:1.14, 430:1.23, 435:1.33, 440:1.44, 445:1.54, 450:1.65, 455:1.77, 460:1.89, 465:2.02, 470:2.14, 475:2.28, 480:2.41, 485:2.55, 490:2.70, 495:2.84, 500:2.99, 505:3.15, 510:3.30, 515:3.46, 520:3.62, 525:3.79, 530:3.96, 535:4.13, 540:4.30, 545:4.47, 550:4.65, 555:4.82, 560:5.00, 565:5.18, 570:5.36, 575:5.54, 580:5.72, 585:5.90, 590:6.09, 595:6.27, 600:6.45, 605:6.63, 610:6.82, 615:7.00, 620:7.18, 625:7.36, 630:7.54, 635:7.72, 640:7.90, 645:8.08, 650:8.25, 655:8.43, 660:8.60, 665:8.77, 670:8.94, 675:9.11, 680:9.27, 685:9.44, 690:9.60, 695:9.76, 700:9.91, 705:10.07, 710:10.22, 715:10.37, 720:10.52, 725:10.66, 730:10.81, 735:10.95, 740:11.08, 745:11.22, 750:11.35, 755:11.48, 760:11.61, 765:11.73, 770:11.85, 775:11.97, 780:12.08" />
</emitter>
<bsdf type="null" name="bsdf"/>
</shape>
<shape type="rectangle" id="emit-light2" name="emit-light2">
<boolean name="flip_normals" value="true"/>
<transform name="to_world">
<matrix value="12.179999 0.000000 0.000000 1.264569 0.000000 0.000000 0.500000 62.946301 0.000000 -12.180000 0.000000 -8.064415 0.000000 0.000000 0.000000 1.000000"/>
</transform>
<emitter type="area" name="emitter">
<!-- <rgb value="4.712389 4.712389 4.712389" name="radiance"/> -->
<spectrum name="radiance" value="300:0.05, 305:0.06, 310:0.07, 315:0.08, 320:0.10, 325:0.11, 330:0.13, 335:0.15, 340:0.18, 345:0.21, 350:0.24, 355:0.27, 360:0.31, 365:0.35, 370:0.39, 375:0.44, 380:0.49, 385:0.54, 390:0.60, 395:0.67, 400:0.74, 405:0.81, 410:0.88, 415:0.96, 420:1.05, 425:1.14, 430:1.23, 435:1.33, 440:1.44, 445:1.54, 450:1.65, 455:1.77, 460:1.89, 465:2.02, 470:2.14, 475:2.28, 480:2.41, 485:2.55, 490:2.70, 495:2.84, 500:2.99, 505:3.15, 510:3.30, 515:3.46, 520:3.62, 525:3.79, 530:3.96, 535:4.13, 540:4.30, 545:4.47, 550:4.65, 555:4.82, 560:5.00, 565:5.18, 570:5.36, 575:5.54, 580:5.72, 585:5.90, 590:6.09, 595:6.27, 600:6.45, 605:6.63, 610:6.82, 615:7.00, 620:7.18, 625:7.36, 630:7.54, 635:7.72, 640:7.90, 645:8.08, 650:8.25, 655:8.43, 660:8.60, 665:8.77, 670:8.94, 675:9.11, 680:9.27, 685:9.44, 690:9.60, 695:9.76, 700:9.91, 705:10.07, 710:10.22, 715:10.37, 720:10.52, 725:10.66, 730:10.81, 735:10.95, 740:11.08, 745:11.22, 750:11.35, 755:11.48, 760:11.61, 765:11.73, 770:11.85, 775:11.97, 780:12.08" />
</emitter>
<bsdf type="null" name="bsdf"/>
</shape>
<shape type="rectangle" id="emit-light3" name="emit-light3">
<boolean name="flip_normals" value="true"/>
<transform name="to_world">
<matrix value="12.179999 0.000000 0.000000 30.726669 0.000000 0.000000 0.500000 62.946301 0.000000 -12.180000 0.000000 -8.926374 0.000000 0.000000 0.000000 1.000000"/>
</transform>
<emitter type="area" name="emitter">
<!-- <rgb value="4.712389 4.712389 4.712389" name="radiance"/> -->
<spectrum name="radiance" value="300:0.05, 305:0.06, 310:0.07, 315:0.08, 320:0.10, 325:0.11, 330:0.13, 335:0.15, 340:0.18, 345:0.21, 350:0.24, 355:0.27, 360:0.31, 365:0.35, 370:0.39, 375:0.44, 380:0.49, 385:0.54, 390:0.60, 395:0.67, 400:0.74, 405:0.81, 410:0.88, 415:0.96, 420:1.05, 425:1.14, 430:1.23, 435:1.33, 440:1.44, 445:1.54, 450:1.65, 455:1.77, 460:1.89, 465:2.02, 470:2.14, 475:2.28, 480:2.41, 485:2.55, 490:2.70, 495:2.84, 500:2.99, 505:3.15, 510:3.30, 515:3.46, 520:3.62, 525:3.79, 530:3.96, 535:4.13, 540:4.30, 545:4.47, 550:4.65, 555:4.82, 560:5.00, 565:5.18, 570:5.36, 575:5.54, 580:5.72, 585:5.90, 590:6.09, 595:6.27, 600:6.45, 605:6.63, 610:6.82, 615:7.00, 620:7.18, 625:7.36, 630:7.54, 635:7.72, 640:7.90, 645:8.08, 650:8.25, 655:8.43, 660:8.60, 665:8.77, 670:8.94, 675:9.11, 680:9.27, 685:9.44, 690:9.60, 695:9.76, 700:9.91, 705:10.07, 710:10.22, 715:10.37, 720:10.52, 725:10.66, 730:10.81, 735:10.95, 740:11.08, 745:11.22, 750:11.35, 755:11.48, 760:11.61, 765:11.73, 770:11.85, 775:11.97, 780:12.08" />
</emitter>
<bsdf type="null" name="bsdf"/>
</shape>
</scene>
Loading