I know this is a pretty general question. But I've been looking for different kinds of 3D objects and their names to implement in my engine to boost its speed.

Static meshes, dynamic(?) meshes and what else?

Thanks in advance!

  • \$\begingroup\$ These "generate a list" type questions are not a good fit for the site. Since there's no single correct answer. See the FAQ to learn what types of questions to ask here and find a list of sites where questions like this are a better fit. Once you get 20 rep, you should ask the question in chat, I'm sure people will have some suggestions for you. \$\endgroup\$ – MichaelHouse Mar 1 '13 at 23:52
  • 7
    \$\begingroup\$ All the ones you need for your game, and no others. \$\endgroup\$ – Sean Middleditch Mar 1 '13 at 23:58
  • 1
    \$\begingroup\$ First you must ask yourself what kinds of 3D objects you need in your game. \$\endgroup\$ – user1306322 Mar 2 '13 at 0:23
  • 1
    \$\begingroup\$ Don't implement anything unless you are sure you will need it (except the cases, when you do that for fun) :) \$\endgroup\$ – Ivan Kuckir Mar 2 '13 at 0:39

This is really a very unspecific question and an answer would completely depend on the game you are trying to build. I also wonder what performance improvements (?) you expect.

The system I am building consists of two layers. The bottom layer is the renderer. It can draw instances of meshes. Each instance type has its own specialized vertex shader. These are the instance types I am currently using:

  • SimpleShape: Has a 2D position and size in screen space and a source rectangle for the texture. Vertices consist only of a 2D vector for the position. Can be used for simple sprites or font letters. Uses hardware instancing.
  • Shape: Same as SimpleShape, but has an individual origin and can be rotated and flipped. I use it for more complicated sprite effects.
  • Billboard: Billboards are very similar to shapes, but they are positioned in 3D space and always face the camera. They can be used for particle effects or vegetation.
  • Static: 3D models that are not animated. They have a translation, rotation and scaling amount in 3D space. The vertices consist of a position, texture coordinates, normal and tangent vector. I use them for all kinds of props. The tangent is used for bump mapping.
  • Animated: Same as the Static instance, but additionally has an array of matrices (bone transforms). The vertices also have an array of weights. This type is used for animated meshes.
  • Terrain: Basically I could use the static type for terrains as well. But since my terrains are always regular grids, there is room for optimizatiom. A terrain instance cannot be rotated or scaled, only translated. Also, instead of a normal and tangent the vertices have a 2D slope component. I use it for calculating tangent space in the vertex shader.

The second layer is built on top of the rendering layer. It has more complex objects that are then translated to the above instances. There is a lot of room here for creativity. Here are some ideas:

  • Text: I use sprite fonts for drawing text. Using the font data each character can be translated to a SimpleShape instance.
  • Sprite: Textured squares that can be drawn to the screen. Sprites are translated to shapes.
  • Particles: Spawns particles that behave in a certain way. For example, the movement can be controlled by a script. Individual particles are translated to billboards.
  • LenseFlare: Lense flares are attached to a light source and consist of various components, which behave in a certain way. Each component is translated to a collection of Shape instances.
  • Model: Consists of various meshes that are bound to a node structure. Each node can be transformed relatively to a parent node. The individual meshes are translated to Static instances. Additionally, nodes can also contain particle effects or other types of complex objects.
  • Character: Has various animations that can be played. When rendered, a single frame (a set of transformation matrices) is used for drawing the mesh as an Animated instance.
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.