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

Tiled/repeating textures #399

Open
tristanpemble opened this issue Aug 30, 2020 · 8 comments
Open

Tiled/repeating textures #399

tristanpemble opened this issue Aug 30, 2020 · 8 comments

Comments

@tristanpemble
Copy link
Contributor

@tristanpemble tristanpemble commented Aug 30, 2020

It would be nice to set a texture to tile or repeat on a mesh instead of stretch.

@GabLotus
Copy link
Contributor

@GabLotus GabLotus commented Aug 30, 2020

Sounds like a great idea

@tristanpemble
Copy link
Contributor Author

@tristanpemble tristanpemble commented Sep 1, 2020

I'm not sure how to specify a SamplerDescriptor for a texture. if I am reading this code correctly, it seems like the sampler is being generated automatically with a From impl. it does seem like a SamplerDescriptor would be the right API for this

@W4RH4WK
Copy link
Contributor

@W4RH4WK W4RH4WK commented Oct 28, 2020

How about adding SamplerDescriptor to Texture as a member and grabbing it from there? The code that constructs a SamplerDescriptor from a Texture doesn't even use that texture.
https://docs.rs/bevy_render/0.2.1/src/bevy_render/texture/sampler_descriptor.rs.html#37-52

@cart
Copy link
Contributor

@cart cart commented Oct 29, 2020

Yup adding a SamplerDescriptor to Texture has been on my "mental to-do list" for awhile. I think that's the right approach.

W4RH4WK added a commit to W4RH4WK/bevy that referenced this issue Oct 29, 2020
GLTF loader now grabs (some) sampler information from the respective
GLTF sampler struct.
W4RH4WK added a commit to W4RH4WK/bevy that referenced this issue Oct 29, 2020
GLTF loader now grabs (some) sampler information from the respective
GLTF sampler struct.
@W4RH4WK
Copy link
Contributor

@W4RH4WK W4RH4WK commented Oct 29, 2020

In #747 I've moved the SamplerDescriptor and adjusted the GLTF loader.

Still, when loading a texture manually (not from a GLTF file), like it's done in the texture example, we'd still need to specify the sampler somehow. Of course, we could just keep it this way, initialized with default, and the user could still mutate it after loading.

@cart
Copy link
Contributor

@cart cart commented Oct 29, 2020

@W4RH4WK sounds reasonable.

Atelier Assets (which we will eventually migrate to) allows you to specify per-asset configuration in a ".meta" file. I think we will eventually put the SamplerDescriptor config there for formats like png.

cart pushed a commit that referenced this issue Oct 29, 2020
GLTF loader now grabs (some) sampler information from the respective
GLTF sampler struct.
@cart
Copy link
Contributor

@cart cart commented Oct 30, 2020

#747 largely resolves this problem, but I think we should probably hold off on closing this until we can do it for arbitrary texture files (aka using the ".meta" config in atelier assets)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.