materials and or textures per node
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
materials and or textures per node
Can somebody explain to me how materials and textures work with eachother? In relation to 'per node'.
I understand there is a max 4 of one or the other. But are materials textures plus other settings, or what ?
I understand there is a max 4 of one or the other. But are materials textures plus other settings, or what ?
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
You can have more than one texture per material because you can have layers of textures, you can have a reflection layer on top of a solid layer, so maybe you have a bus model which has the bus' texture as one layer and then a reflection of the surrounding environment as another layer.
Or there's the terrain node which has a texture layer for the colour of the terrain and also a detail texture layer which gives the terrain more details.
I don't think the max number of materials per node is 4.... you can have one material per mesh buffer (if indeed you are using mesh buffers in the node).
You can look through a number of the tutorials that you downloaded with the SDK to learn about how materials work.
Or there's the terrain node which has a texture layer for the colour of the terrain and also a detail texture layer which gives the terrain more details.
I don't think the max number of materials per node is 4.... you can have one material per mesh buffer (if indeed you are using mesh buffers in the node).
You can look through a number of the tutorials that you downloaded with the SDK to learn about how materials work.
Materials are NOT textures! in Irrlicht terminology. Material is set of attributes which are used to draw geometry on to screen or other target. One of the material attributes is texture ...up to 4 can exist per material. How textures are rendered is specified by material type. Material can exist without texture too.
To learn more look at SMaterial class in API.
To learn more look at SMaterial class in API.
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
There is no way material can use more than one texture in one layer (textures in different layers are rendered differently based on material type ...they can blend in to each other for example or get ignored altogether). Thats why each group of geometry which is using its own texture end up having its own material (this is already done in your modeling ap) and its own mesh buffer (which is done in Irrlicht).
Structure of basic mesh scene node in Irrlicht looks like this:
Node contain one mesh among some other attributes like position.
Mesh consist of minimum one mesh buffer (in case of dwarf its two).
Mesh buffer contain one material among other things like vertices and indices.
Material can contain between 0-4 textures in 4 layers among other attributes like color or shininess.
Geometry in Irrlicht is rendered using mesh buffers. Means if node contain more than one mesh buffer, they are rendered one by one ...each using its material.
Structure of basic mesh scene node in Irrlicht looks like this:
Node contain one mesh among some other attributes like position.
Mesh consist of minimum one mesh buffer (in case of dwarf its two).
Mesh buffer contain one material among other things like vertices and indices.
Material can contain between 0-4 textures in 4 layers among other attributes like color or shininess.
Geometry in Irrlicht is rendered using mesh buffers. Means if node contain more than one mesh buffer, they are rendered one by one ...each using its material.
-
- Posts: 12
- Joined: Wed May 14, 2008 12:31 pm
to see the dwarf model you can run the meshviewer example, it's the model that gets loaded when you open it. If you want the original version (with more animations) you can get it from psionic3d.
to explain a bit further about the dwarf...
It's made up of two meshes basically, there's the dwarf's body and there's the axe. Each of these has its own texture and when you tell your gfx card to draw some vertices you can only specify one base layer texture, so the dwarf and his axe have to be drawn seperately and so are put into seperate mesh buffers so this can be done.
I'm sure this doesn't really explain it fully... i can see where you're getting confused about the materials and textures but i can't really think of how better to explain it!
to explain a bit further about the dwarf...
It's made up of two meshes basically, there's the dwarf's body and there's the axe. Each of these has its own texture and when you tell your gfx card to draw some vertices you can only specify one base layer texture, so the dwarf and his axe have to be drawn seperately and so are put into seperate mesh buffers so this can be done.
I'm sure this doesn't really explain it fully... i can see where you're getting confused about the materials and textures but i can't really think of how better to explain it!