Skip to content
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

Explain why texture.source is not always required #1549

Merged
merged 3 commits into from
Feb 27, 2019
Merged

Conversation

emackey
Copy link
Member

@emackey emackey commented Jan 29, 2019

Fixes #1226.

@lexaknyazev
Copy link
Member

Should textures with nor source neither extensions be invalid?

@emackey
Copy link
Member Author

emackey commented Jan 29, 2019

Good question. Would there be some future way to supply a texture that didn't place an extension directly on the texture object, but still used a texture object? I don't... think so?

Current implementations mostly throw an exception if a source isn't supplied one way or another.

@lexaknyazev
Copy link
Member

  • It could be app-specific extras.
  • An engine could use false color or other predefined value for missing textures.

@emackey
Copy link
Member Author

emackey commented Jan 29, 2019

Sure. So I don't think we can tighten the schema-level field requirements on this. Is my description here good enough then, or does it need to change to indicate that engines are free to use default colors or even reject models that don't properly specify a source? (Where "properly" in my mind is either specifying it with the source property, or marking a WebP or DDS type extension under "extensionsRequired").

The WebP extension for example specifically states that it must be placed in extensionsRequired in order for source to be left undefined.

@lexaknyazev
Copy link
Member

Is my description here good enough...

At least, I'd change "must" -> "may". Otherwise, it sounds like textures without source or extensions are invalid by definition.

@emackey
Copy link
Member Author

emackey commented Jan 29, 2019

Would this make sense?

texture.source

The index of the image used by this texture. When undefined, it is expected that an extension or other mechanism will supply an alternate texture source.

@emackey
Copy link
Member Author

emackey commented Feb 5, 2019

@lexaknyazev Is this OK?

@lexaknyazev
Copy link
Member

Should we suggest any behavior in case when nor source neither extensions are present?
If not, this looks good to me.

@emackey
Copy link
Member Author

emackey commented Feb 15, 2019

How about this:

The index of the image used by this texture. When undefined, it is expected that an extension or other mechanism will supply an alternate texture source, otherwise behavior is undefined.

@emackey
Copy link
Member Author

emackey commented Feb 27, 2019

Updated as we discussed.

@emackey emackey merged commit adaf595 into master Feb 27, 2019
@emackey emackey deleted the texture-source branch February 27, 2019 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants