
OpenTK instead of Tao
Posted Sunday, 29 March, 2009 - 10:21 by Rich inHello there!
I'm currently using Tao & Mono for my Project to rebuild a 10 year old 2D game.
I came to your side once in a while and I think that OpenTK is much more serious than Tao.
My question is now:
Is OpenTK a good choice for that? Are there more advantages than less cryptic code (which is a present from heaven for me)?
thx rich


Comments
Re: OpenTK instead of Tao
Yes, display lists should be faster in this case. The best ways to improve performance are to:
Display lists help in both regards: you draw more stuff in one call and they driver may be able to minimize state changes.
However, before you go in and make any large changes, make sure you are benchmarking a release build (this includes OpenTK) ran outside of the IDE. It is a good idea to try a profiler, too - you wouldn't want to optimize something that isn't a bottleneck!
Re: OpenTK instead of Tao
@the Fiddler: what you mean with your seconde statement (2.)? how can i sort everything by shader / texture? can you give me a tutorial, because i do not really understand what you mean with it!
ok thx for your advice... I'll give those display lists a try, and i hope that i'll get a huge performance boost :).
I also think i put the mushrooms and stuff into the lists because they will never change or vanish during game play.
But first i will run everything outside the IDE...
thx rich
Re: OpenTK instead of Tao
If you keep a different texture per tile, you can improve performance a lot by drawing all grass tiles first, all water tiles next, etc.
Instead of this (pseudo-code):
you can do this:
This way you reduce the number of times you need to call
GL.BindTexture, which can give a nice performance boost. How nice? Try commenting out your BindTexture calls and see if your fps improve.Re: OpenTK instead of Tao
Hello there,
after a long break, i sorted the BindTexture calls and reduced them to a minimum. It turns out that the map now needs 0 milliseconds which is a huge improvement!
But still an annoying problem: the frame flickers black. With the old implementation the frame is constantly drawn without any flickering. Any suggestions? (I cannot remove the clear - colorbit call because my game does not cover the hole frame)
thx
Re: OpenTK instead of Tao
This shouldn't happen. Are you, by any chance, drawing to the front buffer? (This is no longer supported in OpenGL).
As long as you don't call
GL.DrawBuffer(DrawBufferMode.Front)and callSwapBuffersat the end of theRenderFrameevent, there shouldn't be any flickering at all.Re: OpenTK instead of Tao
This is my code: (I use VBOs)
Re: OpenTK instead of Tao
What does the flickering look like? Does the whole screen flash between black and color? Only the tiles? Can you capture it in a screenshot?
Re: OpenTK instead of Tao
Like this:
Re: OpenTK instead of Tao
Finally i found the error:
I do not update the mapdata every frame. So if i set the todraw[i] = -1; -> the nextframe do not do anything and just clears the map...
This works fine: