Compiled objects
Contents
Compiled Objects
compiled objects are a new feature in jPCT 1.18 and higher. By default, jPCT uses a render-pipeline that i call hybrid-pipeline, because it processes software- and hardware rendered scenes in a very similar way. When compiling an object, another, more hardware oriented pipeline is used. Compiling usually increases performance but it has some drawbacks too. Here's a brief overview:
Advantages
- It's much faster than the default pipeline for higher polygon counts (up to 80times faster in my tests)
- Shaders are possible for compiled objects by using the GLSLShader class
- A compiled object can be stripped (if not animated) to save some memory
- A compiled object can share it's compiled data with another one (if they are based on the same mesh)
- A compiled object can share it's texture data with another one (if they are already sharing compiled data)
Disadvantages/Limitations
- A compiled object can only use as many texture stages as the hardware offers. On current hardware, this means 4, on something like a GeForce2, it means 2. Anything higher will be discarded.
- Only the 8 nearest light sources will affect the lighting, not all lights
- Config.lightMul is implicitly set to 1 for a compiled object
- environment mapping is done in world space only
Basically, all objects can be compiled, even animated ones. There are two modes. One for static objects, one for dynamic ones (animated, manipulated by an IVertexController....). The static mode is much faster than the dynamic one...which may still be faster than the default pipeline but that depends.
Compiled objects and jPCT-AE
jPCT-AE uses compiled objects only and compiles them automatically. There's no need for an explicit call to compile() like in the desktop version unless you want to change the automatic behaviour.