Creating and applying materials
This tutorial builds upon Importing and visualizing geometry and shows how to create and apply materials to object instances in appleseed.studio.
Table of contents:
- How are materials defined in appleseed?
- Creating and assigning materials
2.1. Importing textures
2.2. Creating the BSDFs
2.3. Creating the EDF
2.4. Creating a surface shader
2.5. Creating the materials
2.6. Assigning the materials - Rendering
- Conclusion
A few texture files are required to complete this tutorial; you can download them here.
1. How are materials defined in appleseed?
In appleseed, a material is defined by three objects:
- a surface shader that will be run when the surface of the object is directly visible on screen
- a BSDF (Bidirectional Scattering Distribution Function) that describes how light is reflected by the surface
- an EDF (Emission Distribution Function) that describes how light is emitted by the surface
The surface shader is mandatory. Without it, the renderer won't know how to shade the surface. Objects using a material without a surface shader will appear in purple in the rendered image to indicate that a surface shader is missing.
The BSDF is required for physically based rendering as it is what describes how light bounces off surfaces. If a surface is assigned a material without a BSDF, it will absorb all the light and won't reflect any back, so it'll appear black—but it might heat up a lot! :)
The EDF is optional: if none is specified, then the surface won't emit light (most object won't).
2. Creating and assigning materials
2.1. Importing textures
Start appleseed.studio and load the project you created in tutorial 01.
Let's start by importing a few textures.
Right-click on the assembly and select Import Textures...
Locate and open the files floortex.exr, orangetex.exr and whitetex.exr that you previously downloaded to your computer.
2.2. Creating the BSDFs
We can now create the BRDFs. We'll create two: one for the material that we'll apply on the Killeroo object, and one that we'll apply to the floor object.
Right-click on the assembly and select Create BSDF...
Let's create a Lambertian BRDF. The Lambertian BRDF, also called perfectly diffuse BRDF, characterizes surfaces that reflect light equally in every direction. The color of the surface is called its reflectance.
So let's fill in the parameters for our BRDF. Give it the name "diffuse_orange_brdf". Then click on the Browse button next to the Reflectance field, and choose the "orangetex_inst" texture instance. Back to the BRDF creation form, click OK to create the BRDF.
Let's now create a second BRDF that we'll use for the floor material. Right-click on BSDFs, select Create BSDF..., choose the Lambertian BRDF model, give it the name "diffuse_floortex_brdf" and assign the "floortex_inst" texture instance to its Reflectance input.
2.3. Creating the EDF
Let's now create a diffuse EDF that we'll use to make the light material actually emit light. Similarly to how the Lambertian or diffuse BRDF reflects light equally in every direction, the diffuse EDF emits an equal amount of light in every direction. The color of the emitted light is called its exitance.
Right-click on the assembly and select Create EDF... Choose the Diffuse EDF model. Name this EDF "diffuse_white_edf". Click on the Browse button next to the Exitance field and choose the "whitetex_inst" texture instance. Click OK to create the EDF.
2.4. Creating a surface shader
The last piece we'll need to create our materials is a surface shader. For pure physically-based rendering, we usually need only once instance of the "physical surface shader" for all the materials. Let's create it: right-click on the assembly and select Create Surface Shader... Choose the "Physical" model and name the surface shader "physical_surface_shader". Click OK to create the surface shader.
2.5. Creating the materials
We've now got all the pieces we need to create the actual surface materials. Let's start by creating a material for the floor plane. Right-click on the assembly and select Create Material... Name this material "floor_mat". Assign "diffuse_floortex_brdf" to the BSDF slot, then assign "physical_surface_shader" to the surface shader slot. This material won't emit light so we leave the EDF slot empty. Click OK to create the material.
Let's now create a material for the Killeroo object. Repeat the procedure outlined above: name the material "killeroo_mat", assign "diffuse_orange_brdf" to its BSDF slot and use the same "physical_surface_shader".
Let's finally create a material called "light_mat" for the light object. We'll leave the BSDF slot empty: the surface of our light object won't reflect any light back (it will absorb it all). Assign "diffuse_white_edf" to the EDF slot: it is this assignment that makes this material emit light. Once more use "physical_surface_shader" for the surface shader slot of this material.
2.6. Assigning the materials
All we're left to do now is to assign the materials we just created to the objects of the scene.
In appleseed, materials are assigned to object instances rather than objects. This allows creating multiple instances of the same object using different materials.
Expand the Object Instances node under the assembly node. You'll notice that all object instances appear in purple: this is to indicate they have no materials assigned yet. Right-click on the "floor.floor_inst" object instance and select Assign Material...
Choose "floor_mat" and click OK. Repeat the operation for the two other object instances: assign "killeroo_mat" to "killeroo.killeroo_inst" and "light_mat" to "light.light_inst". You're done!
3. Rendering
We can finally render our scene: press F5 to start interactive rendering and adjust the camera to put the Killeroo in the center of the frame. Once you're happy with the composition, just let the render converge to the final image, and stop rendering (Shift-F5) when you're satisfied with the quality.
4. Conclusion
That's it for this tutorial.
In the previous tutorial, we've seen how to create a project, import objects and move the camera. In this tutorial, we've covered how to create materials and assign them to objects. In the next tutorial we'll dive a bit deeper and explore how we can tweak other aspects of the scene by directly editing project files on disk (until appleseed provides the appropriate controls in the user interface).
We love feedback! Please report errors, omissions or unclear instructions in the comments below. No login required!












Comments
Post new comment