Why is this demo so fast?
Blitz3D Forums/Blitz3D Programming/Why is this demo so fast?
| ||
Something I don't quite understand. This demo renders over 200,000 textured polys on screen, yet I'm still maxing out my FPS. How come this is so fast, yet other programs I make with more than a few thousand polys on screen (characters, terrain, etc) crawl along at ~60? +BlackD |
| ||
5 fps on my old machine :( Guess you got one of those... how you call them.. 'graphics cards' or something... 3d boards are optimised to handle geometry. It's all the ; specials' that bring it down. Collision, textures, transparent textures, animated meshes, lights, drawing large bitmaps to screen, etc, etc.. d. |
| ||
Well, i know surfaces, how u copy entities and other logic process can really eat up time. I ran test like this before With a mesh i had that was 27,000 polys. I had a number of them on the screen, rotating with alpha and still got great rates. like 5 of them gettin 200 FPS with all that one. That's about 135,000 polys right there. I know that copys are better than reloads because of the way the vertexs get index on the graphics card. Using more than one surface starts to slow things down too. Collisoin is a big part too. |
| ||
could also have something to do with this:Graphics3D 800,600 |
| ||
Switching Surfaces takes a good chunk of GPU time as i understand, use less than about 30 Surfaces, or something, i have and i use blitz to render 66k Tris and the game runs nicely at 60 fps. Trick is i use single surfaces where possible and DONT have too many actors on screen. a 3D card will happily render upto about 3 times its stated Texel rate IF you keep down surfaces. Also Lights are a BIG Hit too, colisions aren't that bad, but having more than 2 or 3 colision types can start hurting your CPU ! (I am a programmer by nature, Dont hurt me) |
| ||
There is no renderworld statement? No flip? Nothing is being rendered? |
| ||
I discovered just recently, that if you limit the manual animation of entities(e.g. for next looping through each entity) and just use the built in animation system, I got a major speed increase! Probably pretty obvious, but new to me. |
| ||
Graphics3D 800,600 camera=CreateCamera() light=CreateLight() Global FrameTime,Period,timer,fpscount,fpstemp,fps,fx,fynum=500 num=250 tex=CreateTexture(256,256) SetBuffer TextureBuffer(tex) Color 0,0,250 Rect 0,0,256,256,1 SetBuffer BackBuffer() Dim cubes(num) For i = 1 To num cubes(i)=CreateSphere(16) PositionEntity cubes(i),0,0,15 EntityTexture cubes(i),tex Next Color 255,255,255 While Not KeyHit(1) For i = 1 To num x#=Rnd(-1,1)/10 y#=Rnd(-1,1)/10 z#=Rnd(-1,1)/10 MoveEntity cubes(i),x#,y#,z# Next RenderWorld fps 0,0 Text 0,15,"Polys OnScreen: "+TrisRendered() Flip Delay 500 Wend End Function fps(fx,fy) fpscount=fpscount+1 If MilliSecs()<timer+1000 Else fps=fpscount-fpstemp fpstemp=fpscount timer=MilliSecs() EndIf Text x,y,"FPS: "+fps End Function Fixed! |
| ||
lol |
| ||
haha sswift :) @graythe - err.. yes there is. Renderworld AND flip are both there. :p |
| ||
'Why is this demo so fast?' Because Blitz is awesome! |
| ||
There is no renderworld statement? No flip? Nothing is being rendered? No, no.. you're just blind. |