Skip to content Skip to sidebar Skip to footer

Windows-specific Issue When Rendering Webgl... Attribute Set To Zero?

I'm running into a hard-to-debug issue using WebGL. I was implementing a WebGL backend for the CraftyJS game framework. Everything works absolutely fine on OSX, Linux, and Androi

Solution 1:

Figured it out, once I actually had time to sit down with a windows machine and experiment -- the compiler was "optimizing" away my attribute on windows. I guess it makes sense that this might be driver/platform/hardware dependent.

The solution was to place the following lines inside of main() instead of outside of it.

vec2 entityOrigin = aOrientation.xy;
mat2 entityRotationMatrix = mat2(cos(aOrientation.z), sin(aOrientation.z), -sin(aOrientation.z), cos(aOrientation.z));

I guess I don't really understand the difference between code that goes inside of main, and code outside of it. Something to look into! :)

Post a Comment for "Windows-specific Issue When Rendering Webgl... Attribute Set To Zero?"