New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement pre-collapsed shader stage, fix #216 #230
implement pre-collapsed shader stage, fix #216 #230
Conversation
282a4ac
to
587d295
Compare
That looks ready to me |
I removed the |
I merged into master the very first commit that is not doing anything on the code itself, except moving some text to make subsequent PR less noisy. |
f5559c5
to
b3f6d4f
Compare
54d86b0
to
df516c0
Compare
Note to myself; I said there: #189 (comment) that I had an implementation to collapse both lighting stages and reflection stages with an unified glsl shader (I hope I still have the branch somewhere 😁 ) but this is blocked because of #190. Once a fix is found for #190, many lines would be deletable. |
df516c0
to
60cf898
Compare
@slipher: resolved remarks, rebased on master |
collapseTextureEnv is not used at all colorMap stage is by definition a map that is not collapsed so this keyword is absolutely useless
60cf898
to
5cda362
Compare
Code seems all right to me. I don't understand anything about shaders, of course. |
Which is unfotunately to expect: that code is probably the most obscure part of dæmon, at least the most obscure I've seen. Basically XreaL project hacked shader parser of Quake 3 to parse Doom3 shaders the quick and dirty way, expecting multi textures as shader globals (what does Doom 3) while the Quake 3 design allows advanced stage blending and operation. While those textures parts (normal/spec/glow) can perfectly run as separate stages, for performance reason it's better to collapse everything we can to render as must things we can in one pass, hence the convoluted collapse code that has to deal with the fact there is way to define textures both in shader stages and shader globals… 😨 To add features it's usually required to redesign from scratch some parts that do not make possible to extend the existing code to add such features. So, hopefully, PR after PR the code becomes less complex. And less buggy: there is a lot of dragons ready to bite in dark corners, and bugs, those dragons are trained and bugs squished as I walk over the code. It's all about serendipity. |
This is my attempt to implement pre-collapsed shader stages, as defined in #216.
This will allow to use more than one collapsed (multi-texture) stage per shader.
Historical syntax (Doom3-like) with collapsing heuristic is still there.