Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mo Jul 14, 2025 13:15

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: RBSP
BeitragVerfasst: Fr Mär 04, 2005 07:50 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Im wondering if anyone knows of any materials on the RBSP format (Lightmaps & Colour Arrays) or any projects that tryed to render RBSP maps.

RBSP is Ravens version of ID Softwares Q3 BSP Format, the main difference between the two is that faces in RBSP can have 4 lightmaps and 4 Colour Arrays(Don't know the actual term, they basicaly have colour references and are used to light the Mesh's insted of using lightmaps) but IBSP can only have 1 lightmap and 1 colour array per face. I havn't been able to work out how to make the lightmaps work (currently only renders the first lightmap, which works most of the time but there are noticable bits that arn't right)

Note: If anyone would like the IBSP Format or RBSP Format "Layout" (All the Types, i.e Faces, Vertex's Etc) just ask.


Dateianhänge:
MapViewer2_RBSP.jpg [94.12 KiB]
45-mal heruntergeladen
academy1.jpg
academy1.jpg [ 76.88 KiB | 5337-mal betrachtet ]

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Mär 04, 2005 09:37 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Aug 28, 2002 19:27
Beiträge: 568
Wohnort: Chemnitz / Sachsen
i don't know an answer but i would ask you about the rbsp-specs ...

_________________
Aktuelles Projekt :
www.PicPlace.de


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Mär 04, 2005 14:37 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Useful Links

- Jan Horns BSP loader (Basic IBSP Loading but shows the basics of loading the BSP files)
- Harry Painters Q3MapView (Advanced Q3 Map Loader)
- IBSP Spec
- RBSP Spec
- QCommon with RBSP support

Basic "Maths Code" used below
Code:
  1.  
  2. type TVector3f = record
  3.   X, Y, Z : single;
  4. end;
  5.  
  6. type TVector2f = record
  7.   X, Y : single;
  8. end;
  9.  


The header is the first bit of info in the BSP file, StrID should be RBSP and Version should be 1. Note: In IBSP maps valid versions are 46 (Q3) and 47 (RTCW)

Code:
  1.  
  2. type TBSPHeader = record
  3.   strID : array[0..3] of char;           // This should always be 'IBSP'
  4.   Version : integer;                     // This should be 0x2e for Quake 3 files
  5. end;
  6.  


The offset to all the "Sections" are stored in Lumps, they define the size of the "Section" and its offset.

Code:
  1.  
  2. type TBSPLump = record
  3.   Offset : integer;                      // The offset into the file for the start of this lump
  4.   Length : integer;                      // The length in bytes for this lump
  5. end;
  6.  


The Sections are layed out like the following:

Code:
  1.  
  2. const
  3.   kEntities    = 0;            // Stores player/object positions, etc...
  4.   kTextures    = 1;            // Stores texture information
  5.   kPlanes      = 2;            // Stores the splitting planes
  6.   kNodes       = 3;            // Stores the BSP nodes
  7.   kLeafs       = 4;            // Stores the leafs of the nodes
  8.   kLeafFaces   = 5;            // Stores the leaf's indices into the faces
  9.   kLeafBrushes = 6;            // Stores the leaf's indices into the brushes
  10.   kModels      = 7;            // Stores the info of world models
  11.   kBrushes     = 8;            // Stores the brushes info (for collision)
  12.   kBrushSides  = 9;            // Stores the brush surfaces info
  13.   kVertices    = 10;           // Stores the level vertices
  14.   kMeshVerts   = 11;           // Stores the model vertices offsets
  15.   kEffects     = 12;           // Stores the effect shaders (face to brush)
  16.   kFaces       = 13;           // Stores the faces for the level
  17.   kLightmaps   = 14;           // Stores the lightmaps for the level
  18.   kLightVolumes= 15;           // Stores extra world lighting information (For meshes)
  19.   kVisData     = 16;           // Stores PVS and cluster info (visibility)
  20.   kLightArray   = 17;           // Unknown
  21.  
  22.   kMaxLumps    = 18;           // A constant to store the number of lumps
  23.  


The first section is the entitys, they are stored in plain text and look like:

Code:
  1.  
  2.  
  3. {
  4. classname Bannana
  5. someproperty somevalue
  6. model 20
  7. }
  8.  
  9.  



The 2nd is the textures which are stored like

Code:
  1.  
  2. type TQ3FileTexture = record
  3.   TextureName : array[0..63] of char;    // The name of the shader
  4.   flags    : cardinal;                    // The surface flags (unknown)
  5.   contents : cardinal;                    // The content flags (unknown)
  6. end;
  7.  


3rd is planes

Code:
  1.  
  2. type TBSPPlane = record
  3.     Normal : TVector3f;         // Plane normal.
  4.     d : single;                         // The plane distance from origin
  5. end;
  6.  


4th is Nodes

Code:
  1.  
  2. type TBSPNode = record
  3.   plane : integer;                  // The index into the planes array
  4.   front : integer;                  // The child index for the front node
  5.   back : integer;                   // The child index for the back node
  6.   min : TVector3i;                      // The bounding box min position.
  7.   max : TVector3i;                      // The bounding box max position.
  8. end;
  9.  


5th is leafs

Code:
  1.  
  2. type TBSPLeaf = record
  3.   cluster : integer;                // The visibility cluster
  4.   area : integer;               // The area portal
  5.   min :  TVector3i;                 // The bounding box min position.
  6.   max : TVector3i;                  // The bounding box max position.
  7.   leafface : integer;               // The first index into the face array
  8.   numOfLeafFaces : integer;         // The number of faces for this leaf
  9.   leafBrush : integer;              // The first index for into the brushes
  10.   numOfLeafBrushes : integer;           // The number of brushes for this leaf
  11. end;
  12.  


6th is Leaf faces, which is an Array Of Integer. The Leaf's leafface points to the start leaf of the Leaf Face array, which inturn points to the actual face id. (faces are still to come)

7th is the leaf brushes, which is an Array Of Integer. Its use is the same as the Leaf Faces array, but fro brushes.

8th is the models (Note: Models point to faces, all entitys that are visible(aka rendered) or use an area to detect things (like a trigger_multipul) use the models). Model 0 is always the level's model

Code:
  1.  
  2. type TBSPModel = record
  3.   min              : TVector3f;       // The min position for the bounding box
  4.   max              : TVector3f;       // The max position for the bounding box.
  5.   faceIndex        : integer;         // The first face index in the model
  6.   numOfFaces       : integer;         // The number of faces in the model
  7.   brushIndex       : integer;         // The first brush index in the model
  8.   numOfBrushes     : integer;         // The number brushes for the model
  9. end;
  10.  


9th is brushes

Code:
  1.  
  2. type TBSPBrush = record
  3.   brushside       ,           // First brushside for brush
  4.   numOfBrushsides ,           // Number of brushsides for brush
  5.   Texture         : integer;  // Texture index
  6. end;
  7.  


10th is brush sides. Note: this is the RBSP Version

Code:
  1.  
  2. type TRBSPBrushSide=record
  3.   plane   ,                   // Plane Index
  4.   texture, Face : integer;          // Texture Index
  5. end;
  6.  


11th is the Vertex's. Note: this is the RBSP Version

Code:
  1.  
  2. type TRBSPVertex = record
  3.   Position      : TVector3f;             // (x, y, z) position.
  4.   TextureCoord  : TVector2f;             // (u, v) texture coordinate
  5.   LightmapCoord : array [0..3] of TVector2f;             // (u, v) lightmap coordinate
  6.   Normal        : TVector3f;             // (x, y, z) normal vector
  7.   Color         : array [0..3] of array [0..3] of Byte;    // RGBA color for the vertex
  8. end;
  9.  


12th is MeshVerts which is an array of integer. (Its used with the faces to work out which vertex's should be drawn, note the way Jan Horn does it is wrong, Mesh Verts should be used)

13th is Effects (which to my knowlage is just fog, its fog thats applyed to the face its self not the world using shaders and some maths to work out how solid it looks(Alpha))

Code:
  1.  
  2. type TFileEffect = record
  3.   Name        : array[0..63] of char;  // effect shader
  4.   brushIndex  : integer;               // brush that generated this effect
  5.   visibleSide : integer;               // the brush side that ray tests need to clip against (-1 == none)
  6. end;
  7.  


14th is Faces. Note: RBSP version

Code:
  1.  
  2. type TRBSPFace = record
  3.   textureID : integer;                   // The index into the texture array
  4.   effect    : integer;                   // The index for the effects (or -1 = n/a)
  5.   FaceType  : integer;                   // 1=polygon, 2=patch, 3=mesh, 4=billboard
  6.   startVertIndex : integer;              // The starting index into this face's first vertex
  7.   numOfVerts     : integer;              // The number of vertices for this face
  8.   meshVertIndex  : integer;              // The index into the first meshvertex
  9.   numMeshVerts   : integer;              // The number of mesh vertices
  10.   unknown1       : array [0..3] of byte; // lightmapStyles
  11.   unknown2       : array [0..3] of byte; // vertexStyles
  12.   lightmapID     : array [0..3] of integer;              // The texture index for the lightmap
  13.   lMapCorner : array [0..3] of array[0..1] of integer;   // The face's lightmap corner in the image
  14.   lMapSize   : array[0..1] of integer;   // The size of the lightmap section
  15.   lMapPos  : TVector3f;                  // The 3D origin of lightmap.
  16.   lMapVecs : array[0..1] of TVector3f;   // The 3D space for s and t unit vectors.
  17.   Normal  : TVector3f;                  // The face normal.
  18.   Size : array[0..1] of integer;         // The bezier patch dimensions.
  19. end;
  20.  


15th is lightmaps

Code:
  1.  
  2. type TBSPLightmap = record
  3.   imageBits : array[0..127, 0..127, 0..2] of byte;   // The RGB data in a 128x128 image
  4. end;
  5.  


16th is Light Volumes. If im correct there used for the lighting of the Models, i.e weapons, player models, since u can't use Lightmaps. Never implemented or seen it implemented in a Delphi app (hence the C code). Note: RBSP Version

Code:
  1.  
  2. typedef struct
  3. {
  4.     unsigned char   ambient[BSP_STYLES][3];
  5.     unsigned char   diffuse[BSP_STYLES][3];
  6.     unsigned char   styles[BSP_STYLES];
  7.     unsigned char   direction[2];
  8. } dgridlight_t;
  9.  


17th is Vis Data

Code:
  1.  
  2. type TBSPVisData = record
  3.   numOfClusters : integer;      // The number of clusters
  4.   bytesPerCluster : integer;        // The amount of bytes (8 bits) in the cluster's bitset
  5.   Bitsets : array of byte;      // The array of bytes that holds the cluster bitsets
  6. end;
  7.  
  8. //Reading it
  9.  
  10.     if (lumps[kVisData].length > 0 ) then begin
  11.       BlockRead(F, clusters.numOfClusters, sizeof(integer));
  12.       BlockRead(F, clusters.bytesPerCluster, sizeof(integer));
  13.       size := clusters.numOfClusters * clusters.bytesPerCluster;
  14.       SetLength(clusters.Bitsets, size);
  15.       BlockRead(F, clusters.Bitsets[0],sizeof(byte)* size);
  16.     end
  17.     else
  18.       SetLength(clusters.Bitsets, 0);
  19.  


18th is LightArray (RBSP Only), i havn't seen it implemented in any 3rd party app, or seen the Type definition of it.


If anyone ever comes across the COD or EF2 specs plz inform me (There isn't any information i have found on EF2 format, and only some of the lumps of the COD format)

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.016s | 17 Queries | GZIP : On ]