Set index for SEMANTIC
Currently we have a couple of { semantic, set }.
Patrick suggested we could use a parsing convention like "semantic.set" so that we get a single property. Some implementation experiments and/or community feedback welcomed before changing this.
A bit more details from our discussion:
The COLLADA solution is to introduce a new property, set, to uniquely identify an attribute. Although this keeps the semantic property clean and well defined, it also requires the client-side implementation to carry around two properties to link attributes from primitive to program. It seems more concise and convenient to have unique semantics, e.g,
"TEXCOORD.0" "TEXCOORD.1", "TEXCOORD.2"
We can define the semantic string format as "SemanticName[.OptionalUniqueIndex]."
and
We can look at it like this: there is pain either because
- We have to manage two properties: semantic and set
- We have to parse semantic
For rendering uses cases, (2) is less frequent than (1) so I prefer (2). My renderer doesn't need (2). Also, (2) requires less overall code. (1) is just a one-liner if needed.
I asked for advice from web developers. using "." character in JSON is not good practice, same for "-" , only "_" seems safe. It is technically possible to handle "." but it might appear not right for a JSON SPEC.
what about "/" or "," , not good?
"_" is ok by me. Are we already using that anywhere in our reserved identifiers?
Tony
On Thu, Mar 14, 2013 at 5:59 PM, Fabrice Robinet [email protected]:
I asked for advice from web developers. using "." character in JSON is not good practice, same for "-" , only "_" seems safe. It is technically possible to handle "." but it might appear not right for a JSON SPEC.
— Reply to this email directly or view it on GitHubhttps://github.com/KhronosGroup/glTF/issues/1#issuecomment-14938621 .
Tony Parisi [email protected] CTO at Large 415.902.8002 Skype auradeluxe Follow me on Twitter! http://twitter.com/auradeluxe Read my blog at http://www.tonyparisi.com/
Read my book! WebGL, Up and Running http://shop.oreilly.com/product/0636920024729.do http://www.amazon.com/dp/144932357X
I'm OK with "_", but why is "." a bad idea? It is inside a string literal; we should be able to do whatever we want.
Yes, but is usually not recommended because they need to access a property like this obj['prop'] and can't do obj.prop in that case, which is what people tend to like more.
To be honest I would really prefer "." I just don't want to upset JS purists here :).
Gotcha. This is a non-issue for "semantic" : "name.index"; however, I see that it is an issue for "name.index" : { whatever }.
I'm OK with "_".
That is pushed. Closing.