Skip to main content
gamedev.net
🔒 Locked

Quick Simple Question

Started by LevyDee Sep 8, 2010 at 11:08 PM 3 replies 700+ views
Original Post
LevyDee
LevyDee
What is a material when dealing with 3D modeling? A mesh is just the vertices and faces formed by them right? So what is a material? I ask so I can understand better with D3D functions. Thanks
DieterVW
DieterVW
A material is normally all of the properties of the surface being shaded. This can be as simple as a solid color, but often consists of many attributes for light interaction such as diffuse color, specular color, angle refraction, reflection, transparency, scattering, fall off, etc.

If you have access to any tools such as Maya or 3DStudio you might want to take a look at the properties of the various materials to get a good idea of the variety of attributes a material might have.
taby
taby
Materials are used to colour/shade objects:
http://www.toymaker.info/Games/html/materials.html

I'm under the impression that using textures to colour/shade the objects would replace the use of materials.

Here's an example of material usage:
http://www.gamedev.net/community/forums/topic.asp?topic_id=576502

There are three materials defined here... a black one with no specularity, a gray one with a tiny bit of specularity, and an orange one with no specularity. Materials were obviously a good choice for this project, since using textures would have been of no real benefit.
LevyDee
LevyDee
Thanks for the quick reply, and one more question. Ive been using Blender to create a few simple models to practice importing into a simple scene made using Direct3D. Theres a parameter I don't understand in the D3DXLoadMeshFromX Function. What is Adjacency? Thanks
taby
taby
Quote:
Original post by LevyDee
Thanks for the quick reply, and one more question. Ive been using Blender to create a few simple models to practice importing into a simple scene made using Direct3D. Theres a parameter I don't understand in the D3DXLoadMeshFromX Function. What is Adjacency? Thanks


A mesh's adjacency information tells you which triangles are neighbours (each triangle has up to 3 neighbours, if you think about it).

I believe that the adjacency array associates each triangle with three integers -- each integer specifies the index of a neighbouring triangle. If a triangle has less than three neighbours, the extra integers in the array will be filled with the value of -1.

That is, if you had a mesh with only one triangle in it, the adjacency array will most likely contain 3 integers, all of the value -1. You would have to test this out yourself to verify it (using a mesh consisting of only one triangle), but this is the impression that I get from the Microsoft docs on how it would work.

On the other hand, if you can't think of a reason to store the adjacency information in memory, then perhaps you shouldn't export it from Blender / import it using D3DX since that would just be a waste of memory (like... 12 bytes per triangle adds up quick when your mesh has a million triangles!).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.