Data pipeline

Interesting couple of days working on trying to introduce a clear distinction between generating data and actually displaying it in a legacy framework. Really helps to affirm the idea that a rendering engine should be treated as a pipeline.

The idea is called data oriented programming andand is distinct from object oriented coding by how code is grouped. In object oriented code every related model is grouped together. So for example a car, contains wheels and an engine, and links to a driver. Then to have a highway of cars you would create a collection pointing to multiple car objects.

In contrast a data oriented design would maintain lists of cars, wheels, and engines. Then you’d have methods that affect these lists.

For comparison let’s render these via the two different techniques. For OO we might:

  1. iterate through the collection of
  2. Bind car material and
  3. draw
  4. iterate through each wheel
  5. bind wheel material and mesh
  6. draw wheel

In contrast for DO we:

  1. bind car material and mesh
  2. iterate through each car
  3. draw
  4. bind wheel material and mesh
  5. iterate through wheels
  6. draw wheels.

Similar steps right? Except how many times are things being bound in the first instance vs the second. This also completely ignores the caching benefits of the DO approach.

Loading Facebook Comments ...

Leave a Reply

Your email address will not be published. Required fields are marked *