-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
updating the snowflake example so that it is compatible with latest gltf specifications #10539
Conversation
It looks good, However, I can not judgement. I would like to ask @javagl who is familiar with the glTF file to review it. |
That sounds like a good idea. |
Just a side note: The main problem was not so much that the files have been "outdated". The Regarding the updated file: It indeed passes the validation, and thus, is 1.1-compliant - as far as the validator can reasonably check this: There is still a small error(EDIT: This applies to both, "snowflake" and "snowflakes") The
But in the vertex shader, they are only called This is something that the validator cannot detect - of course it does not parse the shader code. Something like this can only be detected at runtime, when GL reports a location of
It seems to be a common practice to prepend the
With this change, it passes validation, is displayed properly in JglTF, and is "valid" as far as I can say. Another side note: There is an ongoing discussion about a possible change in the spec. In glTF 1.0 (and the current state of glTF 1.1), the structure is as follows:
This indirection may not be necessary. In the final version of glTF 1.1, the
But this is not yet finalized, and still open for discussion in KhronosGroup/glTF#789 |
BTW: Uniforms are "often" prefixed with uniform mat4 u_modelViewMatrix; etc. in the shader and the glTF file (!), But this is no strict rule, and I'm also only starting to follow conventions like these.... |
…breplaceTHREEShaderAttributes.
Ok, thanks. I guess I got confused by the way the Three.js glTFLoader translates some of the the shader attribute names in 'replaceTHREEShaderAttributes()'.. Perhaps this part of the loader should be revisited soon.. I changed the attribute names to 'a_position' and 'a_color' and added the color attribute to the loader renaming scheme. I also prefixed the uniforms with 'u_'. Regarding your 'side note': When I updated our exporter I also changed the way the technique was compiled so it should be valid now. |
Thanks! |
In
but should be
(The variable is now called |
Obviously.. |
It seems like our "new" glTF generator were producing outdated glTF files for the line(s) demo. I have updated the generator and validated the results in the official glTF-Validator.
See issue #10526.