Scene triangles.

Blitz3D Forums/Blitz3D Programming/Scene triangles.

Yue(Posted 2015) [#1]


My question is. How many triangles per scene it is recommended in Blitz3D handle.


RemiD(Posted 2015) [#2]
It is not only a matter of the number of triangles in the scene.
It is a matter of number of vertices and number of triangles and number of surfaces (and consequently the number of textures) in the scene

So as much as possible, you want to combine the vertices/triangles in the same surface. (for example combine the static meshes of an area in the same surface with the same texture, and have one surface per turning moving entity (except when the mesh needs several materials, in this case you need several surfaces))


Rroff(Posted 2015) [#3]
As above if you efficiently manage batching techniques, etc. you can push it upto silly levels - I've had it rendering a million tris in a scene before.

If you don't make full use of single surface systems, etc. it can easily choke at 20K tris.

Don't have one with a million tris but this is a silly example rendering 600K:

http://www.aten-hosted.com/images/stest3.jpg

(Was a long time ago on like a GeForce 3 or something hence the low resolution and framerate).


Yue(Posted 2015) [#4]
For obj.CBox = Each CBox 
	
	EntityAutoFadeMode obj.CBox\mesh%,True 
	EntityAutoFade obj.CBox\mesh%, 1000,1100
	
Next 



Well, what I really want to do is reduce to a minimum the burden on the CPU and GPU, so I think if I have less triangles, vertices and surfaces in the world, performance is improved regardless of the maximum target hardware.

Well, what I really want to do is reduce to a minimum the burden on the CPU and GPU, so I think if I have less triangles, vertices and surfaces in the world, performance is improved regardless of the maximum target hardware.

My question is: The faded meshes improve performance by not displaying their screens?


RemiD(Posted 2015) [#5]
Firstly, see if it is worth it to do that, because for now your scene looks empty so it may not be necessary to do any of that.
Secondly, try to combine static surfaces in the same area and to have one surface for each turning moving entity. This should be enough for simple scene.
After that, you can try to hide/show some meshes/surfaces depending on if they can be seen by the camera or not (a surface may be behind others surfaces, so it is not visible but it will still be rendered), but this is advanced stuff that you probably won't need for your simple scene (you are not trying to create skyrim or gta5).


Cocopino(Posted 2015) [#6]
As RemiD said, your current scene looks pretty simple to handle (unless you are using gigantic textures).
Should you want to use several scenes like these at once, a trick you could use would be a teleport in combination with camerarange or camerafog. For example, you can load
scene1 at origin 0,0,1000
scene 2 at origin 0,0,2000
scene 3 at origin 0,0,3000
... etc

Now, you can create teleports that lets the player teleport instantly (no loading needed) to another scene by simply changing the location of the player. If you use camerarange(1.0,600.0) only the current scene will be rendered.


Rroff(Posted 2015) [#7]
Instead of teleporting the player it would be better to reset the world around the player at 0,0,0 if you are doing something like that - otherwise once you are 32768+ units from the world origin you will start to encounter rounding errors and once past 65536 will likely see significant issues.