AndyKorth's picture

Fix for Parallax_FS.glsl (in the SwizzledParallax example) for Mac

Project:The Open Toolkit library
Category:bug report

I ran into some problems with the Mac version of SwizzledParallax demo (T12_GLSL_Parallax) and found a fix.

Line 34 of the shader contains a comment that seems to interfere with parsing and compilation. For me the comment shows up as "z = sqrt(1-x≤-y≤)", although I'm sure the intended rendering is a superscript 2, for squaring.

When I run the program the following is logged:

Vertex Shader compiled without complaint.
Fragment Shader failed!
ERROR: 0:57: 'premature EOF' : syntax error syntax error

If these invalid characters are removed from the comment, the example works as intended.
I changed the line to:

 normal.z = sqrt( 1.0 - normal.x*normal.x - normal.y*normal.y ); // z = sqrt(1-x*x-y*y)

Additional fun and probably unnecessary facts:
OpenTK version is a nightly build from: 2012-03-15
I'm running OS X 10.7.4: Darwin Rivest.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:33:05 PDT 2012; root:xnu-1699.26.8~1/RELEASE_I386 i386
Mono version: Mono JIT compiler version 2.10.9 (tarball Mon May 7 20:25:51 EDT 2012)


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
AndyKorth's picture


Here is a patch to fix this issue:

the Fiddler's picture


Status:open» fixed

This fix has been merged and will be available in the next release.

the Fiddler's picture


Version:1.x-dev» 1.1-2014-01-02
Status:fixed» closed

Closing bugs fixed in OpenTK 1.1.

If this is still an issue, please file a new bug report at