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

Sprites in 3d #2786

Open
VVishion opened this issue Sep 7, 2021 · 5 comments
Open

Sprites in 3d #2786

VVishion opened this issue Sep 7, 2021 · 5 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@VVishion
Copy link
Contributor

VVishion commented Sep 7, 2021

Bevy version

59bfbd3

Operating system & version

macOS 10.15.6

What you did

Place a sprite in 2d, then in 3d.

What you expected to happen

Sprite showing in 2d and 3d.

What actually happened

Sprite only visible in 2d. Not shown for orthographic and perspective 3d.

Additional information

The 3D graph uses Transparent3dPhase. Sprites are scoped in the Transparent2dPhase.

@VVishion VVishion added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 7, 2021
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Sep 7, 2021
VVishion added a commit to VVishion/bevy that referenced this issue Sep 12, 2021
# Objective

Make Sprites usable in 3d space.

## Solution

Rename Sprite to Sprite2d and add Sprite3d.
Add Example 3d_sprite_pipelined.

NOTE: Currently, differences between Sprite2d and Sprite3d and its rendering pipelines are minor. Implementations might diverge to greater extend with future iterations.
@VVishion VVishion mentioned this issue Sep 12, 2021
@djeedai
Copy link
Contributor

djeedai commented Dec 26, 2021

I just lost an hour on this too, this is very confusing. Why is there such a hard distinction between 2D and 3D?

Note for reference that the opposite issue is #3326, where 3D objects don't show up in 2D.

@bsurmanski
Copy link

bsurmanski commented Jan 11, 2022

I ran into this when migrating to 0.6. Sprites worked with PerspectiveCamera in 0.5, now they don't.

To reproduce, run the Sprite demo, replace the ortho camera with new_3d(). To try with the perspective camera, replace with:

PerspectiveCameraBundle {
                transform: Transform::from_xyz(0.0, 0.0, 100.0)
                    .looking_at(vec3(0., 0., 0.), Vec3::Y),
                ..Default::default()
            },

@makoConstruct
Copy link

Related issue, Billboards: #3688

@makoConstruct
Copy link

#2814 (comment)

After some discussions on Discord with @cart and other community members, we came to the consensus that the development direction for bevy sprites should be towards diverging their api and implementation further from 3D, not unifying them / bringing them closer.
2D and 3D should have separate distinct APIs, so that users working on 2D games can have a better experience that feels "native to 2D". We don't want the engine to feel like it was designed for 3D first, or that 2D is a "second-class citizen" hacked together as a special case of the 3D stuff. For example, 2D users shouldn't have to think about 3D rotations and transforms. Bevy sprites might even move away from using the current Transform/GlobalTransform types.
I agree with you that it would probably be nice to have a nice-to-use "3D quads"/"billboards" renderer in Bevy. However, those are not the same as sprites, even though they might seem superficially similar. We shouldn't try to adapt the bevy sprites code to serve that use case. Instead, it should be a separate thing, so that each of these use cases can have nice APIs and implementations that are well-suited.

Sounds legit. Should probably close this, then.

@Waridley
Copy link
Contributor

Waridley commented Mar 2, 2024

Even if Sprite rendering in 3D is never implemented, I still think the current behavior is problematic. Adding a SpriteBundle to an entity and having it simply not show up if your camera is a 3D camera is confusing, especially since the Transform component of the bundle is still a 3D transform.

I also feel it would be useful to have functionality like sprite sheets available in 3D, whether for billboards or 2D graphics in 3D worlds. I know the bevy_sprite3d plugin exists for this, and I will give it a try, but I just wanted to toss my opinion out there for whatever it's worth.

At the very least I think this issue should remain open until some kind of warning can be given when a user tries to render a Sprite with no Camera2d's in the World.

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-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

6 participants