Homeworld Resource
BNDV stands for boundary vertices. They define the boundaries of ships. Right now, only box shaped vertices are used, with two points, one for minimum extents (1st vertex) and other for maximum extents (7th vertex). It is possible to use custom shapes for BNDV, though whether they will work properly or not is a question. So the best thing is to just use “Auto-Calculate” function in CFHodEd for now. Following is the interface to edit BNDV:
Import: Imports vertices from a Wavefront Object file.
Export: Exports vertices to a Wavefront Object file.
Auto-Calculate: Automatically calculates the extent of the object. You may want to enlarge the BNDV if it has animations (Ex. moving parts).
Position: Opens up “SIMPLe DRAW X” to choose a position for the selected vertex.
Number of vertices: Number of vertices in the BNDV chunk.
Current vertex: The vertex, which is being edited.
X Y Z position: The position of the vertex being edited.
BGMS stands for background mesh(es). Yes, that’s right, they can be a bunch of different meshes, which contain coloured vertices (and not normals, UV co-ordinates). They contain convex meshes, which are continuous, and have coloured vertices, which are blended to act as a background. Meshes need to divided into parts, because the parts which are not visible, are not rendered, which should increase frame-rate and efficiency. Backgrounds are spherical, but can be of different shapes. They are rendered at the position of the camera, and usually have a radius of 100 units (meters?). BG (background) meshes are contained in “Homeworld2 Background HOD”, i.e. in the HOD attribute window; you must have selected “Homeworld2 Background HOD” for the BG Hod to properly work. In Short: Input for making BG meshes is a mesh, with UV co-ordinates, and it’s corresponding texture (usually of the size 2048x1024, but the aspect ratio MUST be 2:1 for CFHodEd to properly work!). Following is the interface to modify BG meshes:
Add: Adds a new BG mesh part.
Remove: Removes the selected BG mesh part.
Export: Exports the selected BG mesh part (vertices only! No colour information is exported).
Replace: Replaces the selected BG mesh with a mesh. The mesh should be a textured mesh, with UV co-ordinates. The UV co-ordinates are used to give colour to vertices, using the texture, which is used by the mesh. Each contrast point must be a vertex, so that the BG Mesh is properly imported.
Re-colourize: Re-colourizes the selected BG mesh with its UV co-ordinates. After saving and re-opening a BG mesh file, all it ‘s UV co-ordinates are lost. In such a situation, “Re-colourizing” the mesh will result in all vertices being given the colour of the very first pixel in the texture (since the UV information is ‘lost’ all vertices will have UV (0,0) when retrieved. Hence, they will get the colour of the first pixel in the texture, and will result in a flat shaded background mesh). Therefore, use this function with caution. Also, images need to be half-toned, i.e. the colour for all pixels must be between 0-127, if it is more than 127 it will emit that colour, and that colour will seep into the surrounding pixels.
Generate BGMS Texture: Spherically unwraps the vertices in different parts of the BGMS chunk and creates a texture. Also, this function allows you to export the mesh that was generated in the process, which contains the UV co-ordinates for the generated texture. This allows you to re-import the mesh-texture into a new BG Hod. (Note: You need to have a 3D Accelerator [Graphic Card] to do this)
The function “Generate BGMS Texture “ spherically unwraps the vertices in different parts of the BGMS chunk and creates a gradient between different vertices of the meshes, using DirectX routines. This will allow you to modify pre-made BG meshes as well as create a texture for them. Be advised about the implications of spherical wrapping though. The wrapping in the X-axis of the texture is fixed, but automatic fixation of Y-axis has not been implemented yet. Due to this, the texture generated is not flawless. Although irregular spheres are bound to give problems, given the low mesh density of those parts, colour at those region(s) does not matter (much). Therefore, such regions need to be manually fixed. CFHodEd asks many questions, and you need to properly know the nature of the type mesh to give optimal values. Following are the questions asked by CFHodEd during this process, and what’s done when what input is given is also explained here.
· Attempt to fix circular wrapping?
Sometimes, when working with regular spheres, it becomes difficult to distinguish which quadrant the triangle\vertices belong to. Due to this it becomes hard to assign X co-ordinate to the final texture. To overcome this difficulty, the X co-ordinate assigned to the texture is mean of the rest two vertices. Usually you always use this, especially when the texture mapping is like what is in image (I). After applying this function, the texture map should be like image (II) [Note that this is just what should be, actual results may vary].
Image (I) Image (II)
· Enter size multiplier for generated image:
Default size for the BG texture is 2048x1024 pixels. If you need a larger\smaller image, you may use this. Note that the largest texture size is 4096x4096, therefore, the largest texture exported is 4096x2048, which means that Size Multiplier is between 0 and 2 (2 is included)
· Enable Alpha-blending?
Alpha blending, so that images are blended in the alpha channel. Note that the image will get blended against black, so this may not be needed.
· Enable Anti-Aliasing?
Anti-aliasing, if you graphics card supports it.
· Engine Depth (Z) test?
Depth test, you should enable this, always, since some triangles are purposely pushed backwards.
· Double-tone image?
Images are half-toned when creating a background image. Usually for a texture, if a pixel has any colour more than 127, it would emit that colour. Hence, all colours are kept between 0-127. You may want to double tone the output image to make sure it looks proper.
· Create Additional faces to account for Circular wrapping?
In case of irregular spheres, some faces are midway between the first and fourth quadrant. Due to this, the center, if it lies in first quadrant, the triangle is rendered on the left, and if the center lies in the fourth quadrant, the triangle is rendered in the right, and the image is left incomplete with missing parts towards the left\right. To overcome this difficulty, triangles towards the left and right are duplicated towards each side. Although this takes more time and decreases efficiency, this produces good results. Most type of sphere meshes are properly unwrapped with this setting on. Try unwrapping meshes with this on and off to see the difference.
· Duplicate faces towards the top or bottom sides?
Sometimes, when faces towards the sides are duplicated, they may also have a vertex, which is towards the top or bottom. If such a triangle is duplicated, it may overlap other triangles, due to which the gradient of the texture, i.e. the output texture gets spoilt. Hence, usually you should keep this off, but if you find missing parts towards the sides, try this with on.
· Lower threshold to create faces from the LEFT side (0-1)?
All the faces, which fall from zero to the given value, are duplicated. For example, if you give a value of 0.125, all triangles with UV 0-0.125 are duplicated and put in the right side.
· Upper threshold to create faces from the RIGHT side (0-1)?
All the faces, which fall from the given value to one, are duplicated. For example, if you give a value of 0.875, all triangles with UV 0.875-1 are duplicated and put in the left side.
· Triangle Cull-Mode:
Lets you select the triangle cull mode. CCW (Counter-Clockwise) is the default, but CW (Clockwise) allows you to see which triangles are not being rendered in CCW mode, and “No Triangle Culling” allows you to see all triangles. Select the texture with CCW or no culling, whichever looks better to you.
· Save Generated meshes (with UV co-ordinates)
Allows you to save the meshes, which were generated when the texture was being created. These meshes can use the generated texture to mimic the background almost exactly as it was in HW2.
Background lights are needed for lighting. They are contained in HODs independent of the background meshes, and these HODs are multi-meshes i.e. you must have selected “Homeworld2 Multi-Mesh” in the HOD attributes window.
Add: Adds a new light.
Remove: Removes the selected light.
Add Duplicate: Duplicates the selected light.
Position: Opens up SIMPLe DRAW X to choose the co-ordinates of the light.
Light Name: Name of the light.
Light Type: Type of light.
X Y Z Position: Position of the light.
R G B colour: Colour of the light.
R G B specularity: Unknown. It is observed to be half of the colour.
Attenuation: Unknown usage.
Attenuation Distance: Unknown usage.
.HOD Editing continued