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 

Noob question about file import/export

 
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
arthurdent
Member


Joined: 11 Feb 2007
Posts: 2

PostPosted: Sun Feb 11, 2007 4:36 pm    Post subject: Noob question about file import/export Reply with quote

Hello,

I'm fairly new to game programming and am putting together a simple game engine based on DirectX9. I can import meshes and animation and all that jazz from modellers into the engine using .X format, no problem, but I'm not sure how to handle lighting. I can programatically add lights, but I'd like it to be data driven. So I'm thinking that a level editor may be the way to go. If I was to get a DeleD 3d license and create my levels in this tool, can anyone give me any tips or pointers to how I can specify and more importantly read the lighting information that is saved from Dele3d into my game engine? Does DeleD 3d save into some format that has an easily accessible format, preferably with some sort well defined API code to read this data?

thanks in advance.
Back to top
View user's profile Send private message
Jeroen
Site Admin


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

PostPosted: Sun Feb 11, 2007 4:47 pm    Post subject: Reply with quote

Hi there arthurdent, and welcome to these forums! Smile

Using a leveleditor for adding lights is indeed a smart move. DeleD uses lightmapping for lighting scenes. This means, in general, that each polygon has a regular texture and a lightmap texture (the lightmap texture being generated by DeleD itself). For each texture, you need a set of UV coordinates for your polygon (one UV coordinate per vertex per texture).

Using lightmapping with the .x format might not be a good combination because the .X format doesn't allow multiple sets of UV coordinates per vertex. At least, not as far as I know.

DeleD's DMF format stores sets of UV coordinates per polygon. So if you have, for example, a material that has 2 regular textures and 1 lightmap texture, the polygon using that material stores 3 sets of UV coordinates. However, the DMF format, although being a relatively simple ASCII format, is rather hard to read (see the Help). That is why we decided to switch to XML. DeleD 1.6 (out somewhere this month, if all goes well with testing & debugging) features a new XML-based fileformat which is very easy to read and parse using available XML parsers. Therefor, you can do 3 things:

- implement your own DMF reader
- wait a little while for DeleD 1.6 and use the new XML-based format instead
- or do both, of course Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arthurdent
Member


Joined: 11 Feb 2007
Posts: 2

PostPosted: Sun Feb 11, 2007 5:08 pm    Post subject: Reply with quote

Jeroen,

thanks a bunch for such a quick reply, that impresses me a lot.

Is lightmapping the only form of lighting supported by Dele3d? Are the simpler vertex-based lighting schemes also supported (i.e., just adding simple point light, spotlight, ambient light, and directional light sources to a scene)?

To be honest, I haven't dealt with XML much, so the prospect of having to deal with that is somewhat daunting. Unless there was some help available here on how to utilize that, I look at that as just another thing to have to worry about. I'd rather just have some sort of API in a DLL or something that made accessing it easier.
Back to top
View user's profile Send private message
Jeroen
Site Admin


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

PostPosted: Sun Feb 11, 2007 8:26 pm    Post subject: Reply with quote

Yes, right now DeleD only supports lightmapping. It does so by offering the light types you already described: point-, directional- and spotlights. The ambient lightlevel can be set in the scene properties. Note that directional- and spotlights are available in DeleD PRO only. Vertex-based lighting is something we'll probably add sometime in the future, but a fixed timeframe for such implementation has yet to be determined.

Working with XML is a breeze if you have a good XML parser. For example, if you use a Microsoft .NET language (C#, VB.NET etc), you can load XML files quite easily using the build-in XML parser of Microsoft. I'm sure there are lots of opensource XML parsers available for other languages as well. The big advantage of XML is that it describes the data itself, making a file very human readable and therefor, easy to write code for (most of the time anyway). I suggest you get your hands on a parser and some documentation and try to read/write some basic XML files. You'll see how easy it is in no time! Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Paul-Jan
Site Admin


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

PostPosted: Mon Feb 12, 2007 8:07 pm    Post subject: Reply with quote

Quote:
Are the simpler vertex-based lighting schemes also supported (i.e., just adding simple point light, spotlight, ambient light, and directional light sources to a scene)?


Although such 'vertex-based lighting' is not active within the DeleD 3D editor itself (i.e. you can't preview them, except for generating a lightmap to see how they look), the point/spot/directional light properties are saved into the DMF (and the soon-to-be-introduced .XML based file format). Currently, the light properties are very much compatible with the light properties the OpenGL and DirectX API's expose.

Note: Neither the .DMF, nor the new file format, contain information about the normals, so you'll have to generate those yourself (or have your API generate them for you) if you want proper vertex lighting to show up.

If loading a custom .XML file format seems a bit daunting, you might consider using the collada file format. Although the plugin is still in beta (but functional), the format itself is quite flexible, and there are sources available for using it in your own programs...

I'd not recommend using collada as a final file format (it's a bit too elaborate for that), but I think it's the only mesh file format currently supported by DeleD plugins that actually allows for the storage of lights.
Back to top
View user's profile Send private message 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