Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:17:16+00:00 2026-05-23T16:17:16+00:00

I’m writing a small 2D game engine in OpenGL ES 2.0. It works, but

  • 0

I’m writing a small 2D game engine in OpenGL ES 2.0. It works, but for medium sized scenes it feels a little sluggish currently. I designed it so that every game object is a tree of nodes, and each node is a primitive shape (triangle, square, circle). And every node can have an arbitrary set of transformations applied to it at creation and also at runtime.

To illustrate, a “head” node is a circle, and it has a child “hat” node that is a triangle with a translation transform to move it to the top of the circle. Now, at runtime, I can move the head around with an animated translation transformation on the head, and the hat moves with it. Or I can animate a “hat tip” by applying a rotation transformation just on the hat, dynamically at runtime.

On render, every node applies its own static transformations (the hat moving up), then any dynamic translations (the hat tip), and then so on for every parent node. There are three matrices per node plus another three for each applied dynamic animation. For deep trees, this adds up to a lot of matrix math.

This seems like a good thing to push to the GPU if possible, but since animations are applied dynamically I don’t know ahead of time how many transforms each node will undergo in order to write a shader to handle it. I’m new to OpenGL ES 2.0 and game engine design both and don’t know all limitations.

My questions are…

  1. Am I radically out of line with “good” game engine design?
  2. Is this indeed a task for the CPU or the GPU?
  3. Can an OpenGL 2.0 ES shader be written to handle an arbitrary number of transformations that conform to my “object tree” design and run-time applied animation matrices?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:17:17+00:00Added an answer on May 23, 2026 at 4:17 pm

    Moving the transformation hierachy calculations to the GPU is a bad idea. Shaders operate on a per-primitive/per-vertex/per-fragment level. So you’ll carry out those calculations for each and every vertex you draw. Not very efficient.

    You should really optimize the way you’re doing your animations. For example you don’t need 3 matrices per node. One matrix contains the whole transformation. Every 4×4 matrix-matrix multiplication involves 64 floating point multiplcations. So you’ve 64⁴ multiplications for each node. Cut that out!

    A good way to optimize the animation system is by separation of the single parameters. Use quaternios for the rotation; quaternions take only 8 scalar multiplications, store the translation as a 3 vector, the same with scaling. Then compose the single transformation matrix from those parts. You can translate a quaternion directly into the 3×3 upper left part, describing the rotation, use the scaling vector as factor on the columns. The translation goes into the 4th row. Element 4,4 is 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.