Merged
Conversation
cart
approved these changes
Jun 18, 2023
Member
cart
left a comment
There was a problem hiding this comment.
Good call. This is correct. If you place the camera "above" the plane with the camera facing down ("forward" aligned with -Y and "up" aligned with -Z), the image should have the "default" orientation. This fixes that.
NoahShomette
pushed a commit
to NoahShomette/bevy
that referenced
this pull request
Jun 19, 2023
# Objective Fix bevyengine#1018 (Textures on the `Plane` shape appear flipped). This bug have been around for a very long time apparently, I tested it was still there (see test code bellow) and sure enough, this image:  ... is flipped vertically when used as a texture on a plane (in main, 0.10.1 and 0.9):  I'm pretty confused because this bug is so easy to fix, it has been around for so long, it is easy to encounter, and PRs touching this code still didn't fix it: bevyengine#7546 To the point where I'm wondering if it's actually intended. If it is, please explain why and this PR can be changed to "mention that in the doc". ## Solution Fix the UV mapping on the Plane shape Here is how it looks after the PR  ## Test code ```rust use bevy::{ prelude::*, }; fn main () { App::new() .add_plugins(DefaultPlugins) .add_startup_system(setup) .run(); } fn setup( mut commands: Commands, assets: ResMut<AssetServer>, mut meshes: ResMut<Assets<Mesh>>, mut materials: ResMut<Assets<StandardMaterial>>, ) { commands.spawn(Camera3dBundle { transform: Transform::from_xyz(0., 3., 0.).looking_at(Vec3::ZERO, Vec3::NEG_Z), ..default() }); let mesh = meshes.add(Mesh::from(shape::Plane::default())); let texture_image = assets.load("test.png"); let material = materials.add(StandardMaterial { base_color_texture: Some(texture_image), ..default() }); commands.spawn(PbrBundle { mesh, material, ..default() }); } ``` ## Changelog Fix textures on `Plane` shapes being flipped vertically. ## Migration Guide Flip the textures you use on `Plane` shapes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Fix #1018 (Textures on the
Planeshape appear flipped).This bug have been around for a very long time apparently, I tested it was still there (see test code bellow) and sure enough, this image:
... is flipped vertically when used as a texture on a plane (in main, 0.10.1 and 0.9):

I'm pretty confused because this bug is so easy to fix, it has been around for so long, it is easy to encounter, and PRs touching this code still didn't fix it: #7546 To the point where I'm wondering if it's actually intended. If it is, please explain why and this PR can be changed to "mention that in the doc".
Solution
Fix the UV mapping on the Plane shape
Here is how it looks after the PR

Test code
Changelog
Fix textures on
Planeshapes being flipped vertically.Migration Guide
Flip the textures you use on
Planeshapes.