Material based rendering

Community Forums/Showcase/Material based rendering

Defoc8(Posted 2004) [#1]
This small demo shows you how you can improve fps results
in busy scenes by grouping sub/meshes by material..
You may have to increase the object count by quite a lot
to see the diff..depending on your system specs..

Run the demo + use the enter key to swap between render
methods...its a source code based demo..so feel free to
tinker ;)

www.redflame.net/hosted/RenderTest.zip

special thanks to Bloodlocust for hosting this ;) cheers m8


Beaker(Posted 2004) [#2]
Interesting. I added a SeedRnd line to each function so they produce exactly the same positions for the objects = more equal test.

With 600 objects (about 5500 tris on screen) I get approx 32 and 50 FPS for each mode.

Function CreateCustomRenderGroup()
root=CreatePivot()
mat00root=CreatePivot(root)
mat01root=CreatePivot(root)
mat02root=CreatePivot(root)
SeedRnd 0
 For n=0 To OBJECTCOUNT-1
  inst=CopyEntity(refmesh)
  PositionEntity(inst,Rnd(-1000,1000),Rnd(-200,200),Rnd(-1000,1000),True)
  ch1=FindChild(inst,"b00"):EntityParent(ch1,mat00root)
  ch2=FindChild(inst,"b01"):EntityParent(ch2,mat01root)
  ch3=FindChild(inst,"b02"):EntityParent(ch3,mat02root)
 Next
HideEntity(root)
Return root
End Function


Function CreateStandardRenderGroup()
root=CreatePivot()
SeedRnd 0
 For n=0 To OBJECTCOUNT-1
  inst=CopyEntity(refmesh,root)
  PositionEntity(inst,Rnd(-1000,1000),Rnd(-200,200),Rnd(-1000,1000),True)
 Next
Return root
End Function



Defoc8(Posted 2004) [#3]
thanks beaker ;)


Defoc8(Posted 2004) [#4]
I modified this test withing my own game code..but
its not much good for moving objects.
Im guessing this is becuase objects have to be repositioned
+orientated every frame - destroying the benefit of stack
based transformations...
Anyway..it might still be handy for people working with
a lot of static scenery objects ;)


Beaker(Posted 2004) [#5]
It should really be compared to single surface systems as well.