Archived

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

BSP's: How to Render??

This topic is 5331 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How should I go about rendering a BSP once I have all of the memory structures read in. I''m talking about the mesh wise. I don''t understand particularly the role leafs, leaf faces, and nodes play in rendering. For example, if I just loop through the bsp drawing all of its faces, is that really how its supposed to be rendered? Or should I loop through all of the leafs and render all of the leaf faces indices? Does the meshverts lump contain indices into the vertex array for drawing a triangle fan, triangle strip, or just triangle? So - my main questions are, what is the deal with the leafs and what are the nodes? How would I about properly rendering the entire map at once? Once I get that done, then I''ll worry about only drawing what I need to. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Basically , i understand that you want to render a Quakish level . Google and remember , you can render all ur faces without using nodes or other visibility info . Those are there when you need performance and when brute forcing the whole level is not an option.

Thank you all

Share this post


Link to post
Share on other sites
Ok I''ve improved my BSP Renderer quite a bit, and now it only draws the triangles it needs to through leafs and what not. However, I still have a problem.

1) How do I hit-test this? I''ve loaded in the brush information, but I have no clue about what to do with it. Do brushes indicate something that is walk-through or not walk-through? I''m not looking for mathematical hit testing, but rather what I need to hit test, because I don''t want to hit test every polygon, that would simply be wasteful. Don''t the brushes include information which helps narrow down what needs to be hit test?

2) How do I render face types 2 and 3?

3) How do I parse the entities lump? When I dump it out to a file I get:

{
"classname" "worldspawn"
}
{
"targetname" "t2"
"origin" "488 1032 280"
"classname" "target_position"
}
{
"origin" "24 1032 280"
"classname" "target_position"
"targetname" "t1"
}
{
"radius" "256"
"light" "4000"
"origin" "-280 1336 432"
"classname" "light"
"target" "t1"
}
{
"light" "50"
"origin" "704 768 432"
"classname" "light"
}
{
"classname" "light"
"origin" "704 544 432"
"light" "50"
}
{
"light" "50"
"origin" "480 320 432"
"classname" "light"
}
{
"classname" "light"
"origin" "256 320 432"
"light" "50"
}
{
"light" "50"
"origin" "32 320 432"
"classname" "light"
}
{
"classname" "light"
"origin" "-192 768 432"
"light" "50"
}
{
"light" "50"
"origin" "-192 544 432"
"classname" "light"
}
{
"classname" "misc_model"
"origin" "592 1340 400"
"model" "models/mapobjects/gargoyle1.md3"
"angle" "270"
}
{
"classname" "misc_model"
"origin" "-80 1340 400"
"model" "models/mapobjects/gargoyle1.md3"
"angle" "270"
}
{
"origin" "-192 1024 152"
"classname" "info_player_start"
}
{
"angle" "90"
"classname" "info_player_deathmatch"
"origin" "256 -128 24"
}
{
"angle" "90"
"origin" "256 256 280"
"classname" "info_player_deathmatch"
}
{
"classname" "info_player_deathmatch"
"origin" "256 768 344"
"angle" "90"
}
{
"classname" "info_player_deathmatch"
"origin" "704 832 152"
"angle" "225"
}
{
"origin" "704 880 144"
"light" "50"
"classname" "light"
}
{
"classname" "light"
"light" "50"
"origin" "-192 880 144"
}
{
"angle" "225"
"origin" "-192 832 152"
"classname" "info_player_deathmatch"
}
{
"classname" "light"
"origin" "64 1520 316"
"light" "300"
"_color" "1.0 1.0 .75"
}
{
"_color" "1.0 0.0 0.0"
"light" "300"
"origin" "448 1520 316"
"classname" "light"
}
{
"origin" "-248 1288 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "-276 1312 188"
}
{
"origin" "-248 1336 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "-224 1312 188"
}
{
"origin" "-249 1311 128"
"model" "models/mapobjects/kmlamp1.md3"
"classname" "misc_model"
}
{
"classname" "misc_model"
"model" "models/mapobjects/kmlamp1.md3"
"origin" "-25 1495 128"
}
{
"origin" "0 1496 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "-24 1520 188"
}
{
"origin" "-52 1496 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "-24 1472 188"
}
{
"origin" "536 1472 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "508 1496 188"
}
{
"origin" "536 1520 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "560 1496 188"
}
{
"origin" "535 1495 128"
"model" "models/mapobjects/kmlamp1.md3"
"classname" "misc_model"
}
{
"classname" "misc_model"
"model" "models/mapobjects/kmlamp1.md3"
"origin" "759 1311 128"
}
{
"origin" "784 1312 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "760 1336 188"
}
{
"origin" "732 1312 188"
"light" "70"
"classname" "light"
}
{
"classname" "light"
"light" "70"
"origin" "760 1288 188"
}
{
"radius" "256"
"target" "t2"
"classname" "light"
"origin" "792 1336 432"
"light" "4000"
}
{
"light" "50"
"origin" "792 1336 432"
"classname" "light"
}
{
"classname" "light"
"origin" "-280 1336 432"
"light" "50"
}

What is the purpose of the brackets? For example, how would I extract player starting positions?

I looked at the diesel engine but that guy''s programming ability is far beyond mine. Also the code is somewhat in German. His code seems cryptic almost.

Any and all help will and would be greatly appreciated. Thanks again

Share this post


Link to post
Share on other sites
Ok, I looked at the entities lump and figured it out, but I''m still not sure on how to render the faces that arn''t of type 1

Share this post


Link to post
Share on other sites
Somebody out there''s got to know. I just want to figure out how to render face types that are 2 and 3 (nurbs and mesh it seems). I''ve found out that type 3''s are something to do with the MeshVerts lump or something but I cant find the connection.

If the type is 1, then do I need to worry about the meshVerts? Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites