Simple Features

I implemented the following simple features in Nori:


The relevant header files are /include/nori/texture.h for all the different textures, /include/nori/texturemappings.h for the UV and Spherical mappings, /include/nori/normalmaps.h and /include/nori/bumpmaps.h for the Normal and Bump maps. Some convenience adjustments have been made in /include/nori/bsdf.h for all the different texture types.

UV Texture Mapping

Textures are a must have to make a scene alive. I implemented simple UV texture mapping, a constant color convenience texture and also a procedural checkerboard texture to have some nice looking testing surface.
The source files of interest are the following:

  • /src/imagetexture.cpp
  • /src/constant.cpp
  • /src/checkerboard.cpp
  • /src/bsdfs/diffuse.cpp
  • /src/bsdfs/microfacet.cpp
  • /src/bsdfs/metal.cpp
  • /src/bsdfs/roughmetal.cpp

All the bsdfs stated handle the textures in the function
Color3f handleTextures(BSDFQueryRecord &bRec,bool sampling) const

Wood Texture
A simple wood texture applied to a square
Checkerboard Texture
A procedural checkerboard texture applied to a square

Spherical Mapping

Hereafter you can see two examples of modells on which I used spherical mapping. This mapping has the usefull property that it can be applied to a mesh that has no UV coordinates and still gives good results on roundish meshes.
There are no other source files as the ones used in the UV mapping case.

Spherical Mapping on a Sphere
A spherical Mapping on a Sphere
Spherical Mapping on a Sphere
A spherical Mapping on the Bunny

Transparent Textures

The next feature I implemented was exclusively for my project since I needed a way to efficiently render a lot of models in my scene. My strategy was actually based on alpha planes in correlation with normal maps to give it a realistic 3D look.
The source file of interest are the following:

  • /src/imagetexture.cpp
  • /src/bsdfs/diffuse.cpp
  • /src/bsdfs/metal.cpp
  • /src/bsdfs/roughmetal.cpp

All the bsdfs stated handle the textures in the function
Color3f handleTextures(BSDFQueryRecord &bRec,bool sampling) const
and we indicate to Nori that a texture is transparent by setting the texture filter to
TEXTURE_TRANSPARENT

A transparent texture
A texture with an alpha channel applied to a square

Useful Texture Manipulations

For convenience I added different ways of combining textures. I can displace, scale, blend and superpose textures with the help of a so called Z-index to pile up the textures. Textures can be blended with other textures that are on the same level by either avereging or multiplying them with each other. An alpha channel can also be specified so that the texture is partially transparent.
The source file of interest are the following:

  • /src/imagetexture.cpp
  • /src/bsdfs/diffuse.cpp
  • /src/bsdfs/microfacet.cpp
  • /src/bsdfs/metal.cpp
  • /src/bsdfs/roughmetal.cpp

All the bsdfs stated handle the textures in the function
Color3f handleTextures(BSDFQueryRecord &bRec,bool sampling) const
.

A complex texture superposition
A superposition of a constant texture and two custom textures displaced and scaled

Normal and Bump Maps

Normal maps are essential to add some details to the scene. I implemented both normal and bump maps to add flexibility when creating a scene.
The source file of interest are the following:

  • /src/textures/bumpmap.cpp
  • /src/textures/normalmap.cpp

A diffuse square
A square with a diffuse material without bump mapping
Bump mapped
.. and with bump mapping
A diffuse square
A square with a diffuse material without normal mapping
Normal mapped
.. and with a normal mapping

Rough Conductors

As my scene contains many different types of metals I needed a simple rough metal bsdf.
The source file of interest are the following:

  • /src/bsdfs/roughmetal.cpp

Really rough conductor
A really rough conductor
Almost non-rough conductor
An almost non-rough conductor
The passing Chi Square Warp Test
The passing Chi² Warp Test

Bridge Modelling

As I did not found any convincing old wooden bridge model I modelled one myself with the help of Blender.

Model Overall View
An overall view of my bridge model
Model Close up View
A close up view of the model