Skip to content

Tutorials

Darío Marcos edited this page Dec 7, 2023 · 4 revisions

Here's a simple tutorial for exporting a Blender scene into Nori.

Creating the scene

First, we need to create a scene in Blender in order to export it to the Nori format. Make sure you take into account the restrictions for features that can be exported into Nori! For the purpose of this first tutorial, you can use the example scene included in this repo.

Example scene in Blender.

Exporting the scene into the Nori format

Now, it's as easy as clicking the "Export Nori scenes..." option, under File > Export...

Export Nori scene.

A file dialog will show, where you can select where to store your Nori description. Furthermore, you can customize which features are going to be exported into the scene, as well as some scene parameters, like the number of samples per pixel, etc...

File dialog and export options.

Once you're happy with the setup, click over "Export Nori Scene". This will create the following folder structure:

Exported scene's folder structure.

Rendering with Nori

If everything is okay, the plugin should have exported a XML scene similar to the following snippet:

<?xml version="1.0" ?>
<scene>
	<integrator type="path_mis"/>
	<sampler type="independent">
		<integer name="sampleCount" value="128"/>
	</sampler>
	<camera type="perspective">
		<float name="fov" value="39.597755335771296"/>
		<float name="nearClip" value="0.10000000149011612"/>
		<float name="farClip" value="100.0"/>
		<integer name="width" value="800"/>
		<integer name="height" value="500"/>
		<transform name="toWorld">
			<scale value="1.000000 1.000000 -1.000000"/>
			<matrix value="1.0,0.0,0.0,0.0,0.0,0.3316195011138916,-0.9434131979942322,-4.702550888061523,0.0,0.9434131979942322,0.3316195011138916,1.9520505666732788,0.0,0.0,0.0,1.0"/>
		</transform>
	</camera>
        <!-- many more mesh descriptions... -->
	<mesh type="obj">
		<string name="filename" value="meshes/Sphere.obj"/>
		<bsdf type="roughsubstrate" name="Material.008">
			<color name="kd" value="0.000000,0.150287,0.800482"/>
			<float name="alpha" value="0.500000"/>
		</bsdf>
	</mesh>
</scene>

Now, assuming you execute Nori with the command ./build/nori, you just have to pass the exported XML scene description as argument!

./build/nori <scene_path>/example.xml

Blender result.

Render done with Nori.

As you can see, the results are pretty similar!

Clone this wiki locally