Put GLSL #extension directive first. #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a shader bug while working on the bump mapping demo (human head). When compiling I got this error:
0:3: P0001: Extension directive must occur before any non-preprocessor tokens
which was caused by the #extension directive coming after the precision directive. I've made some changes to fix this, which can be applied to your fork, but I think one of the shader chunks, logdepthbuf_par_fragment.glsl, will also run into this problem, and I haven't dealt with that yet. Whatever fix I come up for that will be more difficult to merge into your version because I had to devise a different way of making the glsl files available in Java: I used a script to turn them all into Strings in Java classes.
I think this bug is also in three.js.