Page 1 of 1

Multi-level rendering work

Posted: 19 Apr 2015, 21:46
by Per
I just pushed two changes to the renderer.

The first is that the SHADERS directive in PIE files should now immediately follow the LEVEL directive, so that you can set a different shader for each level on a model. Having the SHADERS directive after the texture directives will still work, but is to be considered deprecated now.

The second is that rendering of multiple mesh levels for features, structures and wall sections should now work. It does not work for models using .ani animation, since they use their own rendering path. If more than one level of a structure has connectors, turrets will be rendered on all of them (likely creating duplicate turrets). This has only a cosmetic effect, and is unlikely to work as anticipated. We should change the connectors description later to allow for more precise placement of turrets. For defensive structures with more than one level, all levels will be pulled to the ground. We should add per-level flags to the PIE format to allow us to stop individual levels from being pulled to the ground. For now, you can prevent the whole model from being pulled to ground with the 0x00001000 model flag.

Feedback and testing welcome.

Re: Multi-level rendering work

Posted: 23 Apr 2015, 14:04
by Jorzi
Hmm, interesting, I can think of a few extra possibilities which this adds...

Re: Multi-level rendering work

Posted: 27 Apr 2015, 00:00
by Per
Question. The ANI format supports scaling the model in three dimensions each frame. However, this support has never been implemented in the game itself (the values are simply ignored). Is there a use case for this, or should we just drop this from our animation support? It is not really hard to support, it just bloats the animation definition and calculations (and eventually the shader that will handle it once we move from the fixed pipeline).

Re: Multi-level rendering work

Posted: 29 Apr 2015, 08:37
by Jorzi
As long as everything is converted into one 4x4 matrix, it shouldn't bloat anything.
I think it's good to have it, it's a pretty standard feature, after all

Re: Multi-level rendering work

Posted: 30 Apr 2015, 09:16
by Per
Is scaling in three dimensions a pretty standard feature, too? Or would it be enough to limit it to simply a single-value scaling factor?

Re: Multi-level rendering work

Posted: 30 Apr 2015, 12:37
by Jorzi
Having scaling on 3 dimensions available can be quite useful, for example if you want to make moving parts that stretch.