Texturing and children

Blitz3D Forums/Blitz3D Programming/Texturing and children

PowerPC603(Posted 2004) [#1]
I've created a simple test-spacestation already (in 3ds max).

On the left side is a cube, in the middle there's a cilinder (with the top and bottom tris removed) and on the right there's a sphere.

The cilinder is just some sort of pipe, which connects the cube with the sphere.

When I export this station, I use the "Add Scene Root" option in the B3D Pipeline, so all three objects are children to a pivot.
They are not textured yet, I do this in code (all children have UV-coords already when exported to b3d).

; Load spacestation model
SpaceStation = LoadAnimMesh("Station01.b3d")

; Load texture
Texture = LoadTexture("Station01.bmp")

; Assign the texture to all children of this station
For childcount = 1 To CountChildren(SpaceStation)
	; Get handle of the current child
	child = GetChild(SpaceStation, childcount)
	; Put texture on the child
	EntityTexture child%, SpaceStation
Next


When I do this (and it works perfectly), how many surfaces are there in the entire scene (as I want to keep the surface-count to a minimum)?
Only 1 (because there's only 1 texture applied) or 3 (same texture on all three children)?

Would it make a difference in framerate if all stations are created with lots of children (which all have the same texture applied) and there are about 5 stations in view at any moment in the game?

Or is it better to create one big mesh, where all vertexes are joined together, so all children become 1 mesh (1 single object in 3ds max)?


Stevie G(Posted 2004) [#2]
3 separate meshes will be 3 surfaces.

If all stations were the same then instances of this mesh will ( I'm told ) share the same surface so will be faster to render.

If all the children for the stations are static in that you don't have to rotate them or move them then it would be best to add them as one mesh with 1 x texture.

Stevie


PowerPC603(Posted 2004) [#3]
Thanks.

Then I guess I've got to create all static parts of a spacestation as one big mesh and rotating parts as separate meshes.

I'm loading each station separately, even if the model was loaded once before.
This way the loading-routines are simpler (for me anyway).

And I'm afraid that there might be only 2 stations in the same sector which are the same, because I want those stations to work as factories (see X2 - The Threat).
So they are different and use different textures.

I tried Copymesh before (on a child) and Windows froze for a few seconds (couldn't even move the mouse) and after that I had to kill the app manually with the task-manager, because it wasn't responding to the X-button on the top-right of the window.

Maybe I did something wrong with it, don't know.