michael-fadely / sadx-dc-lighting

Sonic Adventure 1 palette lighting for SADX PC.
MIT License
39 stars 3 forks source link

Dynamic shader compilation #42

Closed michael-fadely closed 7 years ago

michael-fadely commented 7 years ago

This (ab)uses the HLSL preprocessor to compile shaders for specific use cases. This significantly improves performance without having to reduce the number of shader switches.

It could be improved further to separate addressing of vertex and pixel shaders to reduce code redundancy. The only issue there is that it would require basically re-inventing the wheel by implementing would effectively be a custom ID3DXEffect, so whether or not it's worth the time is still unknown.