Thanks Paul,
The gameguru level is now put into 128x128 sections and in each section a billboard is created. I selected the section way so culling would still work.
But i do not see any fps improvement:
Paul , could you explain how the batching works in AGK.
1. Are objects created using AddObjectMeshFromMemblock( tmpobj, newmem ) , treated as a single object , or are each mesh treated as an object ?
2. Are AppGameKit already doing batching, mesh using the same texture,shader ?
3. Any other explanation why reducing the draw calls like this do not have any impact ?
I would expect that this would give a huge fps improvement , going from 1124 billboard objects to 45 billboard objects. but ?
Screenshot red is section billboards.
Missing the rotation code ( vertex ), anyone got some ? , not really needed as section billboards are way out , but anyway.
section billboard are created by using the 128x128 grid x,z and offsetting the objects from this point.
newmem = CreateMemblockFromObjectMesh(ggmediabillbid[ objectmedianum[ol] ],1)
numvert = GetMemblockInt(newmem,0)
numindices = GetMemblockInt(newmem,4) // 0 = 3 vert-polygon , > 0 shared vert.
numattributes = GetMemblockInt(newmem,8) // attributes per vertex,
numsinglevertsize = GetMemblockInt(newmem,12) // size of a single vertex
offsetvert = GetMemblockInt(newmem,16) // start off vertex data
offsetindex = GetMemblockInt(newmem,20) // start off indices data
for vb = 0 to numvert-1
vx# = GetMeshMemblockVertexX( newmem, vb )
vy# = GetMeshMemblockVertexY( newmem, vb )
vz# = GetMeshMemblockVertexZ( newmem, vb )
vx# = vx# + ( GetObjectX(objectid[ol]) - firstx# )
vy# = vy# + ( GetObjectY(objectid[ol]) )
vz# = vz# + ( GetObjectZ(objectid[ol]) - firstz# )
SetMeshMemblockVertexPosition( newmem, vb, vx#, vy# , vz# )
next vb
if firstobj = 0
tmpobj = CloneObject( ggmediabillbid[ objectmedianum[ol] ] )
SetObjectMeshFromMemblock(tmpobj,1,newmem)
firstobj = ol
else
AddObjectMeshFromMemblock( tmpobj, newmem )
best regards Preben Eriksen,