-
Notifications
You must be signed in to change notification settings - Fork 6
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
Compression converts else if
to elseif
#6
Comments
I'm also having this problem but with else blocks with no // Copied from ThreeJS
float getFace( vec3 direction ) {
vec3 absDirection = abs( direction );
float face = - 1.0;
if ( absDirection.x > absDirection.z ) {
if ( absDirection.x > absDirection.y )
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if ( absDirection.z > absDirection.y )
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
} The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
H, I noticed that compressing this shader code:
Results in the following string:
Where
else if
is converted toelseif
I'm guessing this is unintentional. My understanding is that elseif is not valid syntax for GLSL, or at least not widely supported. I realize having
else if
on separate lines is also strange, but I'm working with a large legacy codebase and figured compression shouldn't impact the output, as long as the input is valid.Thanks for looking into this!
The text was updated successfully, but these errors were encountered: