Archived

This topic is now archived and is closed to further replies.

PGstudio

Lights on X files

Recommended Posts

Hi all... i´m very new to this whole world.... Is there any way to put light information in X files( made in 3Dstudio)?? Position and Color at least ??? What should i do to have this ??? because it´s painfull and Hard to put all the lights in my scene by hand... Thx ..

Share this post


Link to post
Share on other sites
Normally, light values are not encoded in a .x file because that format is typically for models, not worlds. That doesn''t mean you can''t do it with the .x file format though. The .x file format is made up of templates describing the mesh. Some of these templates include color, transformations, mesh data, and others. The light type isn''t one of them though. You can however create custom templates with the the format though so it is possible. In order to export from 3dstudio light information, you''d have to write a custom exporter plugin. Basically you''d save your templates like normal but when you get to lights you''d setup a custom template. A problem with that though is that loading that file up becomes a pain. You can''t use D3DXLoadMeshFromX to load your mesh anymore. You''d have to loop through all templates and read them in manually getting the data. When you reach a light template, you''d have to setup a light. Also, you''ll probobly need a custom mesh format sinse ID3DXMesh obviously doesn''t handle lighting on its own.

A better solution would be to create your own format. Therefore you''d be able to understand it inside and out. I personally would forget fixed function lighting and go with light mapping because it''s 1.) faster and 2.) better results. The disadvantage with light maps is that they take up more space but the results are a lot better in my oppinion(disregarding per pixel lighting because of it''s large speed decrease).

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org

Share this post


Link to post
Share on other sites
I actually wrote a .ASE (ASCII Scene Export) importer that I use in my "Level Editor" to load the 3D studio mesh/light info with. Then I save to my own format for storage I found ASE to be an insanely easy format to load (and it contained pretty much all of the info that I needed)

I do just export to .X files for models though. It''s easier that way.

Share this post


Link to post
Share on other sites