-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Do not make "instanceTechnique" mandatory in "materials". "technique" at all should be just optional. #288
Comments
Thanks for the feedback - it looks like you have nice stuffs on your repo :). Since you do not want to worry about instanceTechnique, I assume your engine or the middleware you are using (or maybe GL fixed pipeline) is able to deal with the parameters and all the necessary shaders will be available for you already... but that's not the general case. I completely understand the desire to simplify, but in order to be able to render fully a asset using GL and glTF, glTF has to provide every data including shaders and gl states and doing so you have to be tied to a specific GL API. (and providing them involves using techniques/passes). Also, normally you should still dive into the instanceTechnique, but using the -d options with the convert all the meta informations needed to regenerate gl shaders and gl states stored in the pass are listed in the |
BTW, About the JSON size, there are also many things we can do (and began to do) to reduce the memory footprint (once uncompressed) like not outputting properties to their default value. |
Thanks for looking at my repo :-) I understand your points but please rethink it: E.g. create a "tiny glTF" and a "glTF" profile. |
Thanks for the feedback @McNopper. This is something worth discussing since other folks have also want to use glTF piecewise. The case that comes to mind was using glTF just for materials - but I can also see it being used just for geometry. One downside to, for example, making the Your suggestion of a "tiny profile" could work so engines could say which profile they support, but this adds some complexity to the spec. glTF is all about lowering complexity. I don't feel to strongly one way or the other, but we need to carefully consider the flexibility/simplicity/fragmentation tradeoffs. |
I am currently working on a glTF exporter (and later importer) for my OpenGL based Graphics Engine. Meanwhile, I did see, that some fields are not mandatory and I just implemented it. Still, I do not like, that I do have two different glTF assets for e.g. OpenGL ES 2.0 and OpenGL 4.4. |
That's great @McNopper ! . Please let me advise you to watch out for coming format change to spare you some work maintenance. To you concern, say you want to convert a mesh with millions of polygons, on OpenGL ES 2.0 you'll have to split it (to satisfy indices constraints), but not on OpenGL 4.4. (just talking about core spec, but yes extensions can help here). So, if you convert to the lowest common denominator like OpenGL 2.0, and if as you mentioned earlier, and if you don't plan to use the provided shaders (since you don't plan to use the techniques), then your asset will work everywhere, but geometry might be unnecessary splitted for OpenGL 4.4. By adding support for some GL extensions (needs to add ways in the converter), then you could have probably the same geometry and I believe this is what you'd want, your profile would be OpenGL ES 2.0 with extensions, would this work for you ? |
Well, I think it just needs some time for me to get comfortable with the concept of glTF :-) But thank you for your explanation and response. |
@fabrobinet any action here for 1.0? |
no I believe based on the discussion we can close this. |
In my opinion, "instanceTechnique" should be just optional in materials and it should be somehow possible to directly set the material values (see a modified example from duck.json at the end).
Also, I want to have the "technique" element just to be optional. This field and the tree behind it binds the asset to strong to the version of the GL API, the render technique and also makes the JSON file unnecessary big and complicated.
"materials": {
"blinn3-fx": {
"values": {
"ambient": [
0,
0,
0,
1
],
"diffuse": "texture_file2",
"emission": [
0,
0,
0,
1
],
"shininess": 38.4,
"specular": [
0,
0,
0,
1
]
},
"name": "blinn3"
}
}
The text was updated successfully, but these errors were encountered: