Skip to main content
GameDev.net gamedev.net
🔒 Locked

missing triangles in bsp maps

Started by dx elliot May 14, 2004 at 9:15 PM 10 replies 1.3k views
Original Post
dx elliot
dx elliot
I have successfully created a q3 .bsp loader for DirectX which uses the type 1 faces and converts them from triangle fans into triangle lists, no problem. I loaded some commercial maps and they turned out flawlessly, but when I load my own compiled versions, some of the triangles are missing (culling off). I also used a bsp viewer and it turned out that the same triangles are missing too. Maybe I''m just not compiling them correctly. I''ve used all the latest compilers (maybe that''s a bad thing) and it just won''t seem to work. Or maybe the latest versions of bsps require me to use the vertex index for each face, AND the mesh vertices? I don''t even know exactly what the mesh vertices are because I''ve looked through every reference I could find and it just said the same thing, "the number of mesh vertices." or, "the index into the first mesh vertex." Also from all the source codes I''ve looked through (all in openGL), they don''t even use these at all. Which by the way, they also have missing triangles with my maps. All the bsp version numbers are the same too :/ which is weird. This is a really awkward problem, any help it appreciated.
eFoDay
eFoDay
I made a q3 bsp loader in d3d and the maps that come with q3 have parts missing. its based on gametutorials opengl tutorial. i think the parts missing are parts with animated textures on them.
gwihlidal
gwihlidal
There are also curved surfaces present in most of the maps using bezier patches.

You may be seeing holes because there should be curved geometry in its place, and your renderer does not support them.

~Graham

----
while (your_engine >= my_engine)
my_engine++;
gwihlidal
gwihlidal
No, I *think* patches were 3 or 4 or something. You need to check the format.

You are drawing most of the map fine I am assuming, but if you aren''t drawing the patches, lots of maps will be missing this.

~Graham

----
while (your_engine >= my_engine)
my_engine++;
dx elliot
dx elliot
I logged all the coordinates for the faces of a cube and it turns out that the indices are off. I guess tutorials aren''t perfect either.
dx elliot
dx elliot
thanks for your help.

One more thing if anyone might know this ugly problem. The lightmaps turn out really blocky even though I load the lightmap with format setting X8R8G8B8 through a DWORD pointer to the 128x128 RAW bits.



the scene is rendered with anisotropic settings. the first texture stage state's only operation is on the texture, and the second (lightmap) is modulating the current and its own texture. the bsp was compiled with max settings too, not that it matters. It seems that all other maps turn out similar.

[edited by - Lee_ on May 15, 2004 9:14:12 AM]
Basiror
Basiror
did you generator mipmaps?
http://www.8ung.at/basiror/theironcross.html
Boogle55
Boogle55
Some Q3 maps don''t use Triangle Fans, so you''ll need to use the mesh verts + indices to render the scene properly. This has the added advantage that meshes and the level itself can be rendered using the same code

Check out tutorial 8 on Game Tutorials (its in the extra section). Should work the same in DX as it does in OGL, except you don''t need to change the clock winding iirc, because DX using clockwise coords iirc.
dx elliot
dx elliot
Yes, I learned that the hard way because I didn''t realize that I was improperly using the mesh offsets, plus the vertex index. Everything is rendered very fast with triangle lists now

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.