Skip to content

Remove references to old sample_texture function #17195

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

Merged

Conversation

alex5nader
Copy link
Contributor

Objective

Remove some outdated docs from 0.15 that mention a removed function.

Solution

In pbr_functions.wgsl, I think it's fine to just remove the mention. In meshlet/asset.rs, I think it would be nice to still have a note on how texture samples should be done. Unfortunately, there isn't a nice abstraction for it any more. Current workaround, for reference:

pbr_input.material.base_color *=
#ifdef MESHLET_MESH_MATERIAL_PASS
textureSampleGrad(
#else // MESHLET_MESH_MATERIAL_PASS
textureSampleBias(
#endif // MESHLET_MESH_MATERIAL_PASS
#ifdef BINDLESS
pbr_bindings::base_color_texture[slot],
pbr_bindings::base_color_sampler[slot],
#else // BINDLESS
pbr_bindings::base_color_texture,
pbr_bindings::base_color_sampler,
#endif // BINDLESS
#ifdef STANDARD_MATERIAL_BASE_COLOR_UV_B
uv_b,
#else
uv,
#endif
#ifdef MESHLET_MESH_MATERIAL_PASS
bias.ddx_uv,
bias.ddy_uv,
#else // MESHLET_MESH_MATERIAL_PASS
bias.mip_bias,
#endif // MESHLET_MESH_MATERIAL_PASS
);

For now, I've just removed the mention.

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

// How this is done depends on whether we're rendering meshlets or regular
// meshes.
// Biasing info needed to sample from a texture. How this is done depends on
// whether we're rendering meshlets or regular meshes.
struct SampleBias {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but as a side note the derivative stuff for meshlet meshes are not biases. We should probably rename this type to TextureSampleInfo in the future or something.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 7, 2025
@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jan 7, 2025
Merged via the queue into bevyengine:main with commit f26af8f Jan 7, 2025
32 checks passed
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
# Objective

Remove some outdated docs from 0.15 that mention a removed function.

## Solution

In `pbr_functions.wgsl`, I think it's fine to just remove the mention.
In `meshlet/asset.rs`, I think it would be nice to still have a note on
how texture samples should be done. Unfortunately, there isn't a nice
abstraction for it any more. Current workaround, for reference:


https://github.com/bevyengine/bevy/blob/b386d08d0f905d07843ddfed936e404845a6a10b/crates/bevy_pbr/src/render/pbr_fragment.wgsl#L184-L208

For now, I've just removed the mention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants