In stingray, we have a structure sewn into the fabric of a scene's materials that both adds some complications but also offers an amazing amount of flexibility and capability. Therefore, we must understand this structure to use it effectively. This tutorial will explore how we can leverage the material system.
In the following diagram, we can see the actual structure so we can better understand the way things are related.
Notice how our units are shared in the scenes… 2 assets (table and chair) allow us to create one scene where we have 1 table and 2 chairs and another scene with 2 tables and 1 chair. Now notice that Material Wood Dark and Material Wood Light are both shared by Mesh Table and Mesh Chair Body. Lastly, notice how the texture wood_normal and wood_rma are both shared in the two wood materials. None of this would be possible if we had a linear top down approach. If that were the case we would not only be unable to share material resources (duplicated instructions), but we would require duplicated texture files. When making fine adjustments, we would also have to make those fine adjustments across a multitude of files and materials. Here for example we could edit material Wood_Dark and all our tables and chairs would be updated in one single edit. This proves to be more efficient for both you and your project.
So, now that we understand the structure, what does this look like in Stingray? Let’s have a look.
This scene is exactly like what we see in the above diagram in scene 1. In the following scene image, we have a project, a level, 1 Table, 2 chairs, and shared materials just like the graph above.
We can also note how texture slots are created and filled by looking at the sample nodes in the shader graph.
In the texture manager, we can see the instructions given to our textures.
Note: we do not generally work with samples directly and are therefore hidden from us. However, if you select the gear icon in the asset browser, you can enable viewing of all files and see that each texture has a correlated sample.
If you would like to explore this project and see how things relate, download the project files and review for yourself.