Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Material ID on objects ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition
View previous topic :: View next topic  
Author Message
Mille
Member


Joined: 21 Mar 2005
Posts: 35
Location: Denmark

PostPosted: Wed Mar 23, 2005 10:28 am    Post subject: Material ID on objects ? Reply with quote

I'm still new to Delgine, anyway I'm coding a scene partition algorithm for a .dmf level and came across the following question:

I’ve looked at a few .dmf files, and it seems that each object has a unique material ID. Is
this always the case ? – I mean is it so, that when saving to .dmf the Delgine takes care of each object in such a way that it has one and only one material ?

Thanks ..
Back to top
View user's profile Send private message Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Wed Mar 23, 2005 11:15 am    Post subject: Reply with quote

No. The material ID simply refers to the material in the material list, and is only unique if you actually have assigned a unique material to every object in the scene.
Back to top
View user's profile Send private message Visit poster's website
Mille
Member


Joined: 21 Mar 2005
Posts: 35
Location: Denmark

PostPosted: Wed Mar 23, 2005 11:24 am    Post subject: Reply with quote

ok, makes sense – so it’s a matter of me making the scene “correctly” Smile

Its just so, that the rendering will speed up if many triangles with the same texture(s) are rendered in on go!
Back to top
View user's profile Send private message Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Wed Mar 23, 2005 12:35 pm    Post subject: Reply with quote

Very true, but that is up to your rendering code. Simply sort your geometry data on texture or material (depending on wether you do multipass rendering or not) before sending it to the graphics card Smile
Back to top
View user's profile Send private message Visit poster's website
Mille
Member


Joined: 21 Mar 2005
Posts: 35
Location: Denmark

PostPosted: Wed Mar 23, 2005 9:59 pm    Post subject: Reply with quote

Just got the geometry sorted with respect to the material, very nice - I can now render dmf maps Smile Putting each dmf object into an Octree structure and the triangles will flow through the pipeline as quick-sand ...

Anyway, I was thinking about normal maps (bump maps). Dose Delgine support normal maps in the .dmf format ? - It would fit nicely into the material layer system.

I hope you guys never stop working on Delgine!, its cool stuff …
Back to top
View user's profile Send private message Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Thu Mar 24, 2005 7:19 am    Post subject: Reply with quote

About the normal maps: Nope, it doesn't at the moment. We like the idea though, and already have some plans in that direction.

The point is, at this moment, all DeleD operations are supported by all hardware, for example falling back to multiple passes when multitexturing runs out of texture units. Adding support for normal maps is in that way quite a big step, as that would demand some minimal graphics card specs to run. Also, we'd like to spice up the texturing capabilities first, because you'd probably use normal maps most for detailmaps 'skinned' around the model.

Thanks for the positive feedback and compliments, very much appreciated Very Happy
Back to top
View user's profile Send private message Visit poster's website
Mille
Member


Joined: 21 Mar 2005
Posts: 35
Location: Denmark

PostPosted: Thu Mar 24, 2005 5:32 pm    Post subject: Reply with quote

Ok I see your point, haven’t thought of it that way.

However, its not really a problem for me anyway, since the normal maps I use have the same texture coords (u,v) as the diffuse map. So I just calculate the famous tagent-binormal-normal matrix for each vertex to get per-pixel-lightning stuff rooling in the shaders (similarly to what doom3 dose).

But then again, the demos I make requires new hardware, otherwise it’s a bad eeg Smile
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Thu Mar 24, 2005 5:34 pm    Post subject: Reply with quote

Mille wrote:
Ok I see your point, haven’t thought of it that way.

However, its not really a problem for me anyway, since the normal maps I use have the same texture coords (u,v) as the diffuse map. So I just calculate the famous tagent-binormal-normal matrix for each vertex to get per-pixel-lightning stuff rooling in the shaders (similarly to what doom3 dose).

But then again, the demos I make requires new hardware, otherwise it’s a bad eeg Smile


Can you explain that famous tagent-binormal-normal matrix as I for one haven't heard of it yet! Wink

Also, your stuff sounds really cool! Care to post some screenshots!?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mille
Member


Joined: 21 Mar 2005
Posts: 35
Location: Denmark

PostPosted: Thu Mar 24, 2005 11:55 pm    Post subject: Reply with quote

Well, if we want to do per-pixel-lightning as seen in halflife2/doom3, then this is how its done: For each light source we have a light vector to each vertex. The light vectors has to be transformed from object space to tangent space (texture space), and this is done by matrix multiplication. The matrix we need is the TBN matrix for each vertex. In algebra the TBN is called a "basis" for each vertex.

In the standard lighting equation, we take the dot product between any normal on the surface and the light vector. The surface normal exists in tangent space while the light vector exists in object space. Therefore, in order for the dot product to make sense, we have to transform the light vector into tangent space by doing the TBN matrix multiplication. Hence, for each pixel we can take the dot between the normal (from the normal map) and the transformed light vector ... this is all best done in programmable shaders (Cg/HLSL)

I recall a few articles on gamedev.net on this normal map stuff.

Screenshots are on its way ... but I'm still new to the .dmf format, havn't parset light info yet Smile
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Fri Mar 25, 2005 8:58 am    Post subject: Reply with quote

Thanks for the explanation! That's some cool stuff indeed! Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Community Edition All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum