Open friuns2 opened 6 years ago
Are the missing objects brush entities? Those textures also look pixelated
i just disabled mipmap generation in unity so textures load faster.
what do you mean by brush entities? missing objects are bridge and some boxes, they are like seperate small objects on map
here is example map de_aztec.zip
https://developer.valvesoftware.com/wiki/Brush_entity https://developer.valvesoftware.com/wiki/Category:Brush_Entities
Brush entities are brushes tide to an entity for things like doors, transparent objects, buttons, water, ect. They are also used to optimize maps as they don`t cut up other faces during compile as they are treated as a mini bsp.
http://hlbsp.sourceforge.net/index.php?content=bspdef#models
A model is kind of a mini BSP tree. Its size is determinded by the bounding box spaned by the first to members of this struct. The major difference between a model and the BSP tree holding the scene is that the models use a local coordinate system for their vertexes and just state its origin in world coordinates. During rendering the coordinate system is translated to the origin of the model (glTranslate()) and moved back after the models BSP tree has been traversed. Furthermore their are 4 indexes into node arrays. The first one has proofed to index the root node of the mini BSP tree used for rendering. The other three indexes could probably be used for collision detection, meaning they point into the clipnodes, but I am not sure about this. The meaning of the next value is also somehow unclear to me. Finally their are direct indexes into the faces array, not taking the redirecting by the marksurfaces
It might be worth looking though Xash3D to see how they handle entities
thanks for info, btw do you happen to have https://www.codeproject.com/Articles/32751/Half-Life-Game-Level-Viewer compiled version? i could check if that project have same issue if not i could use its code to cross check and fix pvs in your code.
I cannot compile it myself i dont have visual studio 2003 with dx9 sdk, and microsoft changed a lot things to mcvs so it hard to migrate code.
i got printed out some info, seems vislist is -1 on those faces, any idea why is that? Well easy fix would be just render them always :)
private void ReadLeafs()
{
int leafCount = header.directory[10].length / 28;
leafs = new Leaf[leafCount];
br.BaseStream.Position = header.directory[10].offset;
for (int i = 0; i < leafCount; i++)
leafs[i] = new Leaf(br.ReadInt32(), /*vislist */ br.ReadInt32(), br.ReadBBoxshort(), br.ReadBBoxshort(),
br.ReadUInt16(), br.ReadUInt16(), br.ReadBytes(4));
}
No don't have a compiled version, might be worth looking at these projects as they are full engines.
Trinity rendering engine Xash3D https://github.com/everbuild/eresys/blob/master/src/Extra/HLBSPMap.cs
https://github.com/mikezila/uQuake1
If you read this he seems to think there is no need to use PVS, the code is based on an older version of this so might be worth going though it to see what hes changed.
""vis" data is not used in any way. I had originally meant to use the visible sets data in the .bsp to cull geometry to boost performance, but it proved to be a worthless effort"
http://hlbsp.sourceforge.net/index.php?content=bspdef#leaves
Those brush based entities like doors water come from LUMP_MODELS and LUMP_ENTITIES (Use bspedit or nems bsp viewer) so for example here is water entity, its and index into the LUMP_MODELS array is number 221
{ "model" "*221" "renderamt" "175" "WaveHeight" ".2" "skin" "-3" "wait" "4" "speed" "100" "angles" "0 0 0" "rendermode" "2" "rendercolor" "0 0 0" "classname" "func_water" }
Perhaps the confussion was in "lighmap code from Paul Higinbotham" Hoping that meant something like below https://github.com/m-x-d/ericw-tools Included utilities:
qbsp - Used for turning a .map file into a playable .bsp file.
light - Used for lighting a level after the bsp stage. This util was previously known as TyrLite
vis - Creates the potentially visible set (PVS) for a bsp.
bspinfo - Print stats about the data contained in a bsp file.
bsputil - Simple tool for manipulation of bsp file data
Hi its the lightmap code in this project https://www.codeproject.com/KB/directx/HLViewer/HLViewer_2.zip
You might a word with this friuns2, they started working on a project using this code https://github.com/friuns2
PVS not work correctly, if i enable it some objects missing