Skip to content

Conversation

realh
Copy link
Contributor

@realh realh commented Nov 14, 2015

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.

@realh
Copy link
Contributor Author

realh commented Nov 14, 2015

The corresponding three.js bug was found and fixed already: mrdoob/three.js#6956.

thothbot added a commit that referenced this pull request Nov 15, 2015
Put GLSL #extension directive first.
@thothbot thothbot merged commit 572bb8a into thothbot:master Nov 15, 2015
@thothbot
Copy link
Owner

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants