Jump to content
  • Advertisement

paulshady

Member
  • Content count

    78
  • Joined

  • Last visited

Community Reputation

100 Neutral

About paulshady

  • Rank
    Member
  1. paulshady

    Optimizing OpenTK/OpenGL code in C#

    Thanks, mhagain, that was really helpful. The link was very informative, too. One more question: So, the GPU is basically free? Meaning the developer doesn't have to do anything specific to cause work to be handed off to the GPU? Even if I'm just using the fixed function pipeline.
  2. paulshady

    Optimizing OpenTK/OpenGL code in C#

    I wouldn't say I'm unhappy, I would say I'm surprised with the results that I got. Here's what surprised me: In my Draw() loop I do hundreds of texture switches every frame, loads of matrix math, quite a bit of string manipulation, and I have nested foreach loops that could be optimized and written much more efficiently. But at the moment since the DrawElements() call takes up such a glaring percentage of time inside the Draw() loop, I don't really see a large payoff if I start cleaning up and optimizing the rest of the method. The open question I have at the moment is: Is the DrawElements() call much more expensive than almost any other call I would make? IE - Are results similar to what I have described expected? Thanks in advance for any replys.
  3. paulshady

    Optimizing OpenTK/OpenGL code in C#

    Anyone have any interesting input to this question? Thanks!
  4. Hey guys, I am working on a project in C# using OpenTK. I am using it in Windowed mode, meaning there are other controls visible on my WinForm, and there is also a GLControl visible on the WinForm. I'm drawing about 200-300 textured quads every frame. Right now I am not using the fixed function pipeline and not using any shaders. The vertex data for the quad is stored in a vertex buffer and index buffer. The VBO never changes, I just use matrix manipulation to move the quad around the screen and draw it where I need to. I used a profiler on my program and it seems over 95% of the time is spent in the OpenTK method: GL.DrawElements(...) My questions are: Is there any optimization I should be doing to lower that percentage? If I must draw this many quads every frame should I just assume the draw time will be very high? Is there a smarter way to do what I'm trying to accomplish? Should I even bother with other optimizing other areas such as ordering my texture switches? Since the draw call takes such a bulk of the time, it doesn't seem like other optimizations would get me very far. Any input or insight would be greatly appreciated Thanks guys!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!