Jump to content

Home

Kaurora: Talk about it right here!


Recommended Posts

I here by now open this new discussion thread!

 

Lets gather all our info, problems and wishlisting about this handy tool here.

A good focused thread will no doubt help MagnusII a bit more, then our other general thread.

Link to comment
Share on other sites

Was coding the lightmap import into Kaurora today, when I was reminded of a nice sticking point: how can the engine render the UV mapping (both for normal textures and for lightmaps) if the texture face information is not stored anywhere in the .mdl and .mdx files?

The only data stored about them is their vertex list info and the .tga file. This is not enough since the texture faces obviously refer to the texture vertices, and these are different (and more numerous) than the mesh vertices... aren't they?

 

Then I remembered... <sigh>

 

The truth is that, when you create your mesh, you always start with a number of vertices which is equal to the number of faces * 3, plainly enough; and these vertices are used for everything, from the basic mesh structure to however many textures you're UV-mapping onto it.

What happens next is that Max will automatically simplify the mesh structure by deleting duplicate vertices whenever it meets them (e.g. on two faces sharing an edge, there will be 2 duplicate vertices). Of course, this deletion works differently for the basic structure and for each and every texture you're applying, so you end up with e.g. 8 vertices for the normal structure, 24 for the texture, and 16 for the lightmap. Max is not fussed about it as it stores face data for each channel; the Kotor engine, on the other hand, hasn't such a luxury and so he wants all the original vertices before Max messed them up with its simplification algorithm.

 

Back when I wrote the code to import the "normal" textures I developed an algorithm which, while not perfect, was good enough to rebuild the original vertex list in a way which was in accordance with both the basic structure and the texture faces' data. Now the shortcut I took has come back to bite me in the ass, as I now also have a second texture (the lightmap) to contend with, with its own faces, and the way I'm using is NOT good enough to comply with this additional bit of data. So it's back to the drawing board for the "unsimplify vertex list" algorithm...

Link to comment
Share on other sites

Well, Doc the fact is Max hides a lot of Vertices for you. If you make a cube, you actually have 6 planes, each with 4 verts. But 3Ds Max "deletes" ( so to speak) the verts shared by two faces.

 

So lets say you select an edge of this cube, all there needs to be are 2 verts, but actually there are 4, because the Top plane and the side of the cube each have its own edge. Because their on the same spot, Max goes and hides this.

 

Its the same with the Poly and Mesh thing, Editable poly hides the fact that things are all made of triangles.

 

I'm not an expert myself, nor do these things really matter much when your modelling, it does become more important when you start to render things and export. The technical side of modelling.

 

Sad puppy I can't help MagnusII more with this sort of things...

Link to comment
Share on other sites

  • 2 weeks later...

Ok, so I have a build which should theoretically be able to import lightmaps. Unfortunately I've not had the time to test it yet, and I really doubt it's going to work at first try, so I will need to find my old scratch area for a few test runs.

Link to comment
Share on other sites

Well, what I know about Lightmaps is that they save/store shadows, lightcolors.

 

Its sort of an extra layer, which blends with your regular texture. The benifet is that you don't need add real engine lights. All the engine needs to do is load in an extra texture.

 

Though its kind of magic :lol:

Okay I better stop jabbering about it and wright a tutorial >_>

Link to comment
Share on other sites

I think I might get it...

So, like those red glowing things on Malachor's Academy, you'd basically copy the texture, resize it to be VERY TINY, and than make it the color you want it, am I right? Are those little boxes in the lightmap arranged in a numeric order (ie. flr_tex01-10 are the first 10 little boxes on the lightmap texture)

Link to comment
Share on other sites

Some what like that Trigger. Kotor's lightmaps are actually smaller lightsmaps all bunched together. It saves room I guess.

 

Anyway I'll write that tutorial to day for you guys: That way you'll see it for yourself what it does :)

 

Expect a linky somwhere to night or euh morning, late afternoon ( I don't know what timezone you're in :lol: )

 

 

Okay here it is:

 

LINKY TO TUTORIAL

Link to comment
Share on other sites

I've not yet uploaded the new build 'cause it's completely untested. I can put it online somewhere I guess, if you're willing to give it a try, but I really doubt it's going to work until I do at least the first debugging run. I had to work on some assumptions about how the lightmap vertex data is stored in the .mdx files and until I can check whether or not it is correct, the new build is basically a shot in the dark.

Link to comment
Share on other sites

Some what like that Trigger. Kotor's lightmaps are actually smaller lightsmaps all bunched together. It saves room I guess.

Ah, after reading through your tuto, that makes perfect sense. Those cheapskates. First they give us those tubes, than they give us a horrid robe model, and than they use 256x256 when we can use 1024x1024 + without lagging the game much/at all. Bioware cut a lot of corners, and than Obsidian used those cut corners in TSL.

 

USE BIGGER IMAGES IN YOUR FUTURE GAMES! f9qi5w.jpg

Link to comment
Share on other sites

:lol: TG :lol:

 

remember they had to fit it all on a Xbox DVD format.

Plus the system of the Xbox wasn't the same like our PC's today.

 

A lot less of memory and stuff: devellopers have to follow certain guidelines set out by

Microsoft. Though I wouldn't choose for 1024x1024 all the time, since K1 and TSL areas don't look to ugly, I guess smaller formats might work OK.

Link to comment
Share on other sites

Lets hope I found the right procedure.

No doubt we'll have to look how Bioware named their lightmap.

 

Something tells me there's still some mysteries to be solved to get it to work.

But at least its a step closer :)

 

Anyway don't take my word for as the ultimate truth about lightmaps.

Feel free to do some research yourselfs on the matter.

 

I got most of my info from an old tutorial for Unreal Tournament 2004 editing.

Link to comment
Share on other sites

So forgive my ignorance, but this lightmap tutorial and explaination, will it allow shadows in your area?

 

For example in taris middle city, I have 4 big aururalights at the top of my area lighting the way. However even after putting the shadow settings on, no shadows show up. Will this allow me to finally have moving shadows in my area?

Link to comment
Share on other sites

I'm pretty sure AuroraLight's are only used to render shadows of objects like the PC and other NPC's. Infact I'm pretty sure they arn't supposed to affect the environment at all; which is why only the nearest 3(?) AuroraLight's seem to be switched on - it doesn't make sense to render shadows from a light in another room.

I'm pretty sure that the only time I've seen AuroraLight's affect the environment is when they are used to create effects such as the Sun - especially on Tatooine as I discovered ¬¬

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...