The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: sittingduck on March 25, 2008, 07:32:21 PM

Title: Lightwave
Post by: sittingduck on March 25, 2008, 07:32:21 PM
Do anyone know where i can get a parser for Lightwave data written in Masm?
Title: Re: Lightwave
Post by: u on March 25, 2008, 07:45:18 PM
There is no parser written in masm. Well, I've coded one, but gave-up implementing some of the more tricky things (which I actually need: multitexturing, weightmapping). Currently I have one, that is in C++ with custom garbage collection XD.
.lwo is a complete mess :) , and it's really bad to make your game use it instead of pre-processed offline data. It simply requires a lot of reallocation, concatenation, rearrangement of arrays.
Title: Re: Lightwave
Post by: sittingduck on March 26, 2008, 07:30:09 AM
Quote from: Ultrano on March 25, 2008, 07:45:18 PM
and it's really bad to make your game use it instead of pre-processed offline data. It simply requires a lot of reallocation, concatenation, rearrangement of arrays.

Thank you.
How about 3DSMAX is that a better option?
Title: Re: Lightwave
Post by: u on March 26, 2008, 12:04:54 PM
If 3DSMax outputs ".3ds" files, then maybe it's convenient. Though I don't know if it supports multitexturing, or how convenient the file-format is.

http://www.ultimategameprogramming.com/demoDownload.php?category=OpenGL&page=7
http://www.ultimategameprogramming.com/demoDownload.php?category=OpenGL&page=6

But you need the file-format docs to extend it.
Title: Re: Lightwave
Post by: Draakie on March 27, 2008, 05:09:11 AM
I've been working on a semi-proffesional .3ds (3DSMAX) parser in assembler. I'll post the code
in the OpenGL forum in a couple of days [ need to work on one or two things still].
Should be easy to convert to a .dll or something. Actually wanted to run it past Ultrano first - seeing
as he has become our defacto graphics expert. :lol

Luv's
Draakie
Title: Re: Lightwave
Post by: daydreamer on March 28, 2008, 08:08:37 AM
Quote from: Ultrano on March 25, 2008, 07:45:18 PM
it's really bad to make your game use it instead of pre-processed offline data.
I wrote an .obj fileimporter for dx9 and I gave up on get it fast because the above and aiming for make a .obj filecompressor instead, because only converting from ascii->binary without all whitespace will reduce filesize by about  2.5times smaller, because this is the bottleneck of loading lots of meshes from disk matters lot more than write it in asm for least amount of time to process it
was thinking of option to let it convert to signed words, signed bytes if precisionloss doesnt matter that much, but especially interesting in the case of implement meshes you modeled in a 3d modeller into your asm demo

Title: Re: Lightwave
Post by: u on March 28, 2008, 01:05:06 PM
The only optimal format (speed and size) is one that you directly copy to VBO buffers. Plus contains which ARB shaders to use, and layout of the VBO - where attributes are in the array, and what type they are.
Also, for drawing many models in a scene quickly, some classification of models is necessary. Insomniac Games have classified models in several categories: ufrags, ties,.. each with specific usage depending on how static the model is. The  PDF is "Resistance:FoM debriefing" at http://www.insomniacgames.com/tech/techpage.php

I've attached my .lwo importer, supports up to 8 UV coords/textures per vertex/surface. Uses the same stuff I use in asm ("foreach", lotsa macros,..), so it's rather trivial to port to masm code that is using my macros/libs/style.
I had coded it while not being clear enough on how to optimally use OpenGL shaders, so some overhaul will be necessary soon. [the optimal path with opengl is to use ARB shaders (asm code), which is precompiled from GLSL code with nVidia's cgc.exe]
Ah, face3.lwo (c) Ultrano :P


.3ds looks nice but limited. Anyway, there is no modern modeler centered on shaded-games, so lots of fix-ups have to be done in all cases.