Camera, IDs & Objs

Published January 31, 2007
Advertisement
Fixed some issues with the cameras, and got them loading in game, so designers can now place them in the levels, although they aren't used by the game engine right yet.



I also fixed a lingering bug with the level editor that was causing some issues on large levels with > 250k triangles.

Basically, to speed up sorting triangles, I am embedding the material id into the upper bits of the 32-bit triangle id, making only 20 bits available for the id itself. Since I was using a simple sequential id allocation scheme, I was running into wrap around issues on very large levels, b/c ids were never re-used on purpose.

I needed a way to fix this that wouldn't require rebuilding any levels, and would allow at least 1 million triangles in a level at once.

What I ended up doing was keeping the same id scheme, but re-using ids. Rather than keeping a list of all available ids, I just have a bit stored for each id, to say if its used or not. I track the last known partly open 32-bit word, and when I need a new id, I scan through it for an available bit. If I can't find one, I scan through all dword flags sequentially, skipping all that == 0xffffffff. Once I either wrap around to the start ( > 1 M triangles ), or find an open bit, I use that ID for the new tri, and save this one as the last known open dword.

Deleting a tri causes its id bit to be cleared. The bit flags take up 128k and ensure that no more triangles can share ids at once.

Just now I added .OBJ importing to the level editor. Up to now there was no way to load a mesh with multiple materials in it, other than importing an existing level section, so I added obj support to handle this case.

Here is a shot of a bridge .obj with 2 materials attached.


Previous Entry Level Fun
Next Entry Camtastic
0 likes 1 comments

Comments

FReY
Good to see you making progress, I really love reading your journal. It's like a mini soap opera to me - from an addiction point of view, not a cheesy/tacky point of view :D
February 01, 2007 12:56 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

1.2 Almost ready...

1169 views

Sound Paths

1384 views

Stately Progress

1209 views

State Lines

1339 views

Pulsing

915 views

Return to The Ship!

1056 views

Cameras & Boxes

1176 views
Advertisement