Simple Features
I implemented the following simple features in Nori:
- UV Mapping
- Spherical Mapping
- Transparent Textures
- Useful Texture Manipulations
- Normal and Bump Maps
- Rough Conductors
- Bridge Modelling
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
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.
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) constand we indicate to Nori that a texture is transparent by setting the texture filter to
TEXTURE_TRANSPARENT
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.
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
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
Bridge Modelling
As I did not found any convincing old wooden bridge model I modelled one myself with the help of Blender.