Local Info

Topics

j3d.org

Rendering Command Implementation Notes

The output of the state sorting stage is a large list of the individual commands that are to be rendered using OpenGL or OpenAL. In this document we describe the various sets of commands and the order that they can be expected in, so that implementations can be coded to work with it. Each of these commands are represented by constants defined in the org.j3d.aviatrix3d.pipeline.RenderOps interface.

 

Single Layer

Corresponds scene graph that has a single layer and single viewport with no layers in the viewport, and no transparent objects, lights, fog etc.

  1. START_VIEWPORT
  2. START_LAYER
  3. START_RENDER
  4. START_STATE
  5. RENDER_GEOMETRY
  6. STOP_STATE
  7. STOP_RENDER
  8. continue for as many objects are are in the scene
  9. STOP_LAYER
  10. STOP_VIEWPORT

Multiple Layers

Corresponds scene graph that has a multiple layers each with a single viewport with no layers in the viewport, and no transparent objects, lights, fog etc.

  1. START_VIEWPORT
  2. START_LAYER
  3. START_RENDER
  4. START_STATE
  5. RENDER_GEOMETRY
  6. STOP_STATE
  7. STOP_RENDER
  8. continue for as many objects are are in the scene
  9. STOP_LAYER
  10. STOP_VIEWPORT
  11. START_VIEWPORT
  12. START_LAYER
  13. START_RENDER
  14. START_STATE
  15. RENDER_GEOMETRY
  16. STOP_STATE
  17. STOP_RENDER
  18. continue for as many objects are are in the scene
  19. STOP_LAYER
  20. STOP_VIEWPORT
  21. ... for however many layers

Multiple Viewports in a single layer

Corresponds scene graph that has a single layer containing multiple viewports with no layers in the viewports, and no transparent objects, lights, fog etc.

  1. START_VIEWPORT
  2. START_LAYER
  3. START_RENDER
  4. START_STATE
  5. RENDER_GEOMETRY
  6. STOP_STATE
  7. STOP_RENDER
  8. continue for as many objects are are in the scene
  9. STOP_LAYER
  10. STOP_VIEWPORT
  11. START_VIEWPORT
  12. START_LAYER
  13. START_RENDER
  14. START_STATE
  15. RENDER_GEOMETRY
  16. STOP_STATE
  17. STOP_RENDER
  18. continue for as many objects are are in the scene
  19. STOP_LAYER
  20. STOP_VIEWPORT

This pattern repeats per layer, so if you have multple layers with multiple viewports, you'll see the same pattern repeated for each successive layer.

Multipass Rendering

Corresponds scene graph that has a single layer and single viewport with no layers in the viewport. The viewport contains a multipass scene with 2 rendering passes (though it can be generalised to n passes, with no transparent objects, lights, fog etc.

  1. START_VIEWPORT
  2. START_LAYER
  3. START_MULTIPASS
  4. START_MULTIPASS_STATE (for up to 4 different buffers)
  5. START_MULTIPASS_PASS
  6. START_RENDER
  7. START_STATE
  8. RENDER_GEOMETRY
  9. STOP_STATE
  10. STOP_RENDER
  11. continue for as many objects are are in the scene
  12. STOP_MULTIPASS_PASS
  13. STOP_MULTIPASS_STATE (for up to 4 different buffers)
  14. CHANGE_MULTIPASS_STATE (for up to 4 different buffers)
  15. START_MULTIPASS_STATE (for up to 4 different buffers)
  16. START_MULTIPASS_PASS
  17. START_RENDER
  18. START_STATE
  19. RENDER_GEOMETRY
  20. STOP_STATE
  21. STOP_RENDER
  22. continue for as many objects are are in the scene
  23. STOP_MULTIPASS_PASS
  24. STOP_MULTIPASS_STATE (for up to 4 different buffers)
  25. STOP_LAYER
  26. STOP_VIEWPORT

Combined Multipass and Single Pass Rendering

Corresponds scene graph that has a two layers: The first containing a single pass render and the second containing a multipass render. The second layer contains a multipass scene with 2 rendering passes (though it can be generalised to n passes, with no transparent objects, lights, fog etc.

  1. START_VIEWPORT
  2. START_LAYER
  3. START_RENDER
  4. START_STATE
  5. RENDER_GEOMETRY
  6. STOP_STATE
  7. STOP_RENDER
  8. continue for as many objects are are in the scene
  9. STOP_LAYER
  10. START_LAYER
  11. STOP_VIEWPORT
  12. START_VIEWPORT
  13. START_MULTIPASS
  14. START_MULTIPASS_STATE (for up to 4 different buffers)
  15. START_MULTIPASS_PASS
  16. START_RENDER
  17. START_STATE
  18. RENDER_GEOMETRY
  19. STOP_STATE
  20. STOP_RENDER
  21. continue for as many objects are are in the scene
  22. STOP_MULTIPASS_PASS
  23. STOP_MULTIPASS_STATE (for up to 4 different buffers)
  24. CHANGE_MULTIPASS_STATE (for up to 4 different buffers)
  25. START_MULTIPASS_STATE (for up to 4 different buffers)
  26. START_MULTIPASS_PASS
  27. START_RENDER
  28. START_STATE
  29. RENDER_GEOMETRY
  30. STOP_STATE
  31. STOP_RENDER
  32. continue for as many objects are are in the scene
  33. STOP_MULTIPASS_PASS
  34. STOP_MULTIPASS_STATE (for up to 4 different buffers)
  35. STOP_LAYER
  36. STOP_VIEWPORT