Jump to content

A few questions on models/animations


darkf
 Share

Recommended Posts

For a project I'm working on, I want to be able to import full LRR models and animations. A few quick questions:

 

  1. What are the .X models for? Are they for UV mapping? How else is UV mapping done?
  2. Do you recommend a particular method of (ideally batch converting) LWO/LWS models/animations to a more modern format?
  3. Am I correct in thinking that null objects are simply empty positioned objects intended for replacement as defined by .ae files?
  4. And finally: is there anything else I should know about loading these models/animations from the game?

 

Thanks! :)

Link to comment
Share on other sites

I can at least pitch in a bit here.

 

2: Can you elaborate a bit more on this? In principle this should be reading the animation file, converting its structure to whatever the other format uses, and writing an equivalent file as output. There's really not much more to it.

3: In part, yes. Null objects can also be a part of a structure in order to simplify animation. I'm not sure if there are any models in LRR which use them that way, though.

 

Link to comment
Share on other sites

2 hours ago, bartvbl said:

2: Can you elaborate a bit more on this? In principle this should be reading the animation file, converting its structure to whatever the other format uses, and writing an equivalent file as output. There's really not much more to it.

 


I mean if there are any decent programs to do so in batch. The only one I've found so far that can handle it properly is PolyTrans (which carries quite a hefty price tag.)
If Lightwave could do it I might look into that -- can Lightwave 11 still import LRR's LWS fine or is a previous version more appropriate?

Link to comment
Share on other sites

I'm also curious as to how the game renders some of the polygons. For example this Pilot walking:

http://i.imgur.com/C3O5Jc3.gifv 

Or just the head:

http://i.imgur.com/vZZWIsC.png

 

How in the world is it rendering these pointed triangles as the actual minifig we see in-game?

If I could get these models and animations loading, we could see something very cool... :P

Link to comment
Share on other sites

I don't think the .X files are linked to by anything. I don't even remember ever seeing them or messing with them at least.

 

For that low-poly animation you linked to, it takes some textures from a sprite sheet somewhere in World/Shared and applies rectangular textures from that to the triangles, with the space outside those rectangles becoming transparent. The high-poly models are different from the one you posted, but the LWS files link to the low-poly LWO and higher-poly LWO models are defined in the entity's .AE file. You need to find the HP models in the AE and replace the LP models with them, because this is a game from 1999 that was resource-intensive for the time so it's intentionally s***ty-looking by default so kids could play it on their mom's Pentium II or whatever was the standard at that time.

Link to comment
Share on other sites

@RingtailI love you! ♥ Yep, they're the VLP (very low poly) models, instead of the LP/MP/HP models I was expecting. They are incredibly sad looking. :)

Well, I've got more of a plan to import these now, and at least I can see a RR walk: http://i.imgur.com/J0okwwL.gifv (ignore the missing polys and jerky animation.)

Now I need to actually go about doing this programmatically and replacing the nulls. Oh joy, what a lot of "fun" stuff to do!

Thanks. I'm sure I'll have more questions in the future.

  • Like 2
Link to comment
Share on other sites

Still struggling with importing LWS animations though. Lightwave in all its infinite wisdom does not export textures on scenes without at least one UV map, and obviously the LWOs have none.

Anyone have a solution for converting the animations in the LWSs into another format?

Link to comment
Share on other sites

sheepandshepherd

Has anyone tried using ASSIMP to load these particular lightwave files? The LWS/LWO formats are listed as supported on the GitHub page, so I could give it a shot. Just not sure if ASSIMP will preserve the lightwave-specific things like null nodes.

 

EDIT: Tried it, but all the LWOs fail to load with "LWO: Unable to build a valid node graph". I'll look into it more tomorrow. I don't know anything about lightwave files.

This ancient thread might still have some useful information.

Link to comment
Share on other sites

8 hours ago, sheepandshepherd said:

Has anyone tried using ASSIMP to load these particular lightwave files? The LWS/LWO formats are listed as supported on the GitHub page, so I could give it a shot. Just not sure if ASSIMP will preserve the lightwave-specific things like null nodes.

 

EDIT: Tried it, but all the LWOs fail to load with "LWO: Unable to build a valid node graph". I'll look into it more tomorrow. I don't know anything about lightwave files.

This ancient thread might still have some useful information.


I tried before, but it fails on any LWOs -- I filed an issue a few days ago: https://github.com/assimp/assimp/issues/1196

I ended up writing a loader for scenes, but I have more testing and cleanup to do for it. I have yet to work on an LWOB loader, but it shouldn't be too difficult (the harder part is texture mapping -- I think all LRR models use planar texture mapping? Dunno. Not my forte, either.)

In any case, have a truck: http://i.imgur.com/Zb86C18.gifv

I believe after I have all of the importers taken care of I can actually do something fun with these models... :) (Yay, no more programmer art cubes!)

  • Like 1
Link to comment
Share on other sites

3 hours ago, darkf said:

I think all LRR models use planar texture mapping?

 

Yes, LRR does not support UV mapping. Any model that requires a planar map on more than one axis has to be split up into separate groups, each with a different surface (even if it's the same texture file).

Link to comment
Share on other sites

  • 2 weeks later...
On 3/8/2017 at 8:12 PM, Cirevam said:

 

Yes, LRR does not support UV mapping. Any model that requires a planar map on more than one axis has to be split up into separate groups, each with a different surface (even if it's the same texture file).

Well I notice there are .UV files which probably define them (IIRC the developer said they made their map tool support UVs because LW5.6 did not.)

For now I'm just doing planar mapping (which works fine), but eventually I'll see if it requires UVs.

Now: How is alpha handled in the textures? Say a029_Drill.bmp (Tool Store drill quad) or LightSPANKLE.bmp (light gradient), these have different solid colors that both end up as transparent in LRR.

With the latter (spankle), I imagine it *could* just be additive blending (for the light), but for the drill it's actually alpha blended.

So what is it using for the chroma keying / alpha channel?

Bonus screenshot: http://i.imgur.com/HoZK0UN.png

  • Like 1
Link to comment
Share on other sites

lol username
6 hours ago, darkf said:

Now: How is alpha handled in the textures? Say a029_Drill.bmp

 

It's that part of the file name:

 

On 12/30/2015 at 1:18 PM, Cirevam said:

There are other textures that start with A###, but most of them start with A000. I think that this specifies the alpha index. To test, I looked at a few other textures, like A068_LightX and A227_headtop2, and guess what? The index in the file name always matches the index of the background colour.

 

 

Link to comment
Share on other sites

That's only one form of transparency that LRR uses. Things like glow effects are handled differently, where pixels that are more black (I think it uses the Value part of Hue/Saturation/Value for this) are more transparent, with pure black being completely transparent and pure white being completely opaque.

 

I believe Lightwave calls this Additive Transparency, so darkf is right.

Link to comment
Share on other sites

2 minutes ago, Cirevam said:

That's only one form of transparency that LRR uses. Things like glow effects are handled differently, where pixels that are more black (I think it uses the Value part of Hue/Saturation/Value for this) are more transparent, with pure black being completely transparent and pure white being completely opaque.

 

I believe Lightwave calls this Additive Transparency, so darkf is right.

Yes, fundamentally it's additive blending -- but I'm not sure how the game recognizes this.
In LightWave, if we open the scene for the Powerstation and view the spangle model, we note that all of the textures on the quads use Normal blending. That's why they're black in LightWave -- they're not using additive blending.

Screenshot: http://i.imgur.com/QyVKjfo.png

So it must get the information from somewhere else, not the model.

Thanks a bunch for the A### tip -- I never would have figured that one out! Is the number an index into the LWO surface color, or the BMP palette?

Link to comment
Share on other sites

The index number is from the color index of the 8-bit bitmap file. I use GIMP to figure out the index number for a specific color.

 

Additive transparency is defined in the model under the Advanced tab in the Surface editor. It must be set to 100% or Rock Raiders will not display it properly. This is the only thing that affects it as far as I've been able to tell. I leave everything else alone.

 

large.Additive.png.7c0c05f96e9a7ec9ef2e1

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.