Now for the shader stuff.
This time it's about how to prepare your model inside your modeling application
in a way that TG creates all the Part nodes and their corresponding Shader nodes
you want your model to have.
It may be of help to know that the file format we are using (.obj) just saves the coordinates
of the vertices (points) of a model and - if -the vertex normals.And some other stuff that can
vary from app to
app.No info as for separate geometry parts.That's done via materials.
The material/shading information is saved within the accompanying .mtl file.(put the mtl file
in another folder and load the obj without it and you'll see the
difference.No greyPart node,
just the red Parts shader node.The model renders pure black unless you connect some Default or other shader to it.)
There are lots of parameters that won't be exported from your modeling app or imported by
your target app.A few are,but most of them not.
That goes for TG and other rendering software.
So I found it a good habit to make the final shader tuning in TG instead of trying to do as much
as possible beforehand,but that's just me.
A little visual aid as to what is what:
[attachimg=1]
The demo model is composed of 6 separate parts of geometry and has one shader/material
assigned.It's the material that's on every model by
default.Here it's named default,too.
In your app it may be named differently.
[attachimg=2]
When exported like that your model will have one grey Part node and it's corresponding
Default shader.
The nodes inside the Parts shader node:
[attachimg=3]
Renders like this in TG
[attachimg=4]
So,what to do?
Back in your modeling app you select one of your model's parts and assign a new material/
shader to
it.Name that material/shader properly.Avoid spaces,use underscores or hyphens.
For example: starting with the cube,assign a new material to it and name it cube.
You don't have to do anything else to this material now.Most of the settings won't export
anyway.
Do that for the other parts as well.
In the example I gave every material it's own color,but that's just for demo purposes,easier
to see what has been done.
You'll also notice that I've 'grouped' the spheres to show what's possible generally.
Now our model has still 6 parts,but this time three materials/shaders.
[attachimg=5]
The nodes
[attachimg=6]
Rendered
[attachimg=7]
That's better,we can have a different shading on the different elements now.
But it's still not enough! More shaders,gimme more shaders...aahrff.
to be continued in the next post.