Shader order

Yuri, can you tell me if the order is important, in which the Shaders are shaded?

I’m currently working on a huge Display Lists improvement. Some Shaders must not be included in the Display List and maybe this will cause some problems, when I’ll have to change the order.

Marvin

Hi,

I will try to answer step-by-step. Unfortunately, I am limited on time I can spend on these discussions but I will share my knowledge in order to help new generation of Xith3D developers.

For most shaders the order is not important. There is an exception: everything related to transparency is (was) important to do in proper order, otherwise you may loose vertex alpha values (if specified on per-vertex basis as a part of vertex colors - very useful for smooth alpha gradients in UI).

When making the display lists, you should note that execution of some shaders MAY BE SKIPPED: State Sorting tries to eliminate shader execution whenever possible. This is a major optimization Xith3D core is doing, and it is also a source for most rendering bugs and misunderstandings.

Xith3D core checks shaders always in predetermined order, but because of some shaders may be skipped we can not guarantee that for specific Atom shaders will be executed in order: some might be executed before while rendering other atoms that share the same shading states for specific shaders.

Yuri

Thank you very much…