0

I've created something of a simplistic renderer on my own using OpenGL ES 2.0. Essentially, it's just a class for rendering quads according to a given sprite texture. To elaborate, it's really just a single object that accepts objects that represent quads. Each quad object maintains a a world transform and object transform matrix and furnishes methods for transforming them over a given number of frames and also specifies texture offsets into the sprite. This quad class also maintains a list of transform operations to execute on its matrices. The renderer class then reads all of these properties from the quad and sets up a VBO to draw all quads in the render list.

For example:

Quad q1 = new Quad();
Quad q2 = new Quad();

q1->translate(vector3( .1, .3, 0), 30); // Move the quad to the right and up for 30 frames.
q2->translate(vector3(-.1, -.3, 0), 30); // Move the quad down and to the left for 30 frames.

Renderer renderer;
renderer.addQuads({q1, q2});
It's more complex than this, but you get the simple idea.

From the implementation perspective, on each frame, it transforms the base vertices of each object according to instruction, loads them all into a VBO including info on alpha value, and passes to a shader program to draw all quad at once.

This obviously isn't what I would call a rendering engine, but performs a similar task, just for rendering 2D quads instead of 3D geometry. I'm just curious as to whether I'm on the right track for developing a makeshift rendering engine. I agree that in most cases it's great to use an established rendering engine to get started in understanding them, but from my point of view, I like to have something of an understanding of how things are implemented, as opposed to learning something prebuilt and then learning how it works.

Joey Carson
  • 2,973
  • 7
  • 36
  • 60

1 Answers1

0

The problem with this approach is that adding new geometry, textures or animations requires writing code. It should be possible to create content for a game engine using established tools, like 3DS, Maya or Blender, which are completely interactive. This requires reading and parsing some standard file format like Collada. I don't want to squash your desire to learn by implementing code yourself, but you really should take a look at the PowerVR SDK, which provides a lot of the important parts for building game engines. The source code is provided and it's free.

ClayMontgomery
  • 2,786
  • 1
  • 15
  • 14
  • thanks for your answer. At this point, I'm more interested in how things work on a fundamental level which is why I want to do something on my own. My concern is not to create a game so much as it is to create a simplistic model rendering engine, related to something one would do in school. I've started writing a simple asset loader that uses Assimp to load OBJ models and want to create a simple renderer and move the models with keyboard and mouse. – Joey Carson Jul 13 '13 at 04:12