Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Resize BoxTextured image to 256 so it is PowerOfTwo #137

Merged
merged 4 commits into from
Jan 9, 2018

Conversation

msfeldstein
Copy link
Contributor

The model currently has some issues on mobile as it uses a non power of two texture with a REPEAT wrap mode, which is not supported by mobile gpus. While this is technically a valid gltf, it can cause lots of gotchas for people working on implementing a renderer, so maybe we should keep this example simple, and add a NonPowerOfTwo model for people to specifically be able to test this to implement the edge case

@msfeldstein
Copy link
Contributor Author

Oops didn't add the NPOT example

@javagl
Copy link
Contributor

javagl commented Dec 1, 2017

Keeping the NPOT example is important. I'd even consider to omit the new NPOT example, and instead keep the original BoxTextured one with its NPOT textures: The point is that this is likely one of the first models that implementors will use for testing textures, and the "gotchas" that you mentioned should hit the implementor as early as possible. Otherwise, they could be tempted to say: "Fine, textures are working, next topic..." - and finally ship a renderer that only works with POT textures...

But that's just an opinion, let's see what others think.


This model uses a Non Power-Of-Two texture with REPEAT mode wrapping. This is an edge case that is technically a valid gltf model, but needs some renderer work to resize the texture before uploading to the GPU. According to the spec:

Non-Power-Of-Two Texture Implementation Note: glTF does not guarantee that a texture's dimensions are a power-of-two. At runtime, if a texture's width or height is not a power-of-two, the texture needs to be resized so its dimensions are powers-of-two if the sampler the texture references
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last statement is incomplete (compare with the spec). It may be better to put a link instead.

@emackey
Copy link
Member

emackey commented Dec 17, 2017

There's a merge conflict here. MaterialsCommon and techniqueWebGL were removed from master, so should be removed from this branch.

@emackey
Copy link
Member

emackey commented Jan 8, 2018

Merge resolved. Any other thoughts on this? #137 (comment)

@msfeldstein
Copy link
Contributor Author

msfeldstein commented Jan 8, 2018 via email

@emackey
Copy link
Member

emackey commented Jan 8, 2018

@javagl I think it's more in line with the other examples here, to keep the basic box simple, and call out features like NPOT with separate examples. This way, engine developers can more easily isolate particular features for testing. So, I think we should merge this.

@javagl
Copy link
Contributor

javagl commented Jan 8, 2018

@emackey Sure, as long as there also is a non-POT-example. (Now there is a dedicated one. Otherwise, it could be part of one of the more general texture feature samples)

@bghgary
Copy link
Contributor

bghgary commented Jan 8, 2018

We will add some tests to glTF-Asset-Generator as a bonus.

@emackey emackey merged commit 79891f1 into KhronosGroup:master Jan 9, 2018
@emackey
Copy link
Member

emackey commented Jan 9, 2018

Merged. Thanks again @msfeldstein and reviewers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants