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

AtlasTexture on Sprite3D displays inverted margin height #48816

Closed
TheUltimateAbsol opened this issue May 18, 2021 · 1 comment
Closed

AtlasTexture on Sprite3D displays inverted margin height #48816

TheUltimateAbsol opened this issue May 18, 2021 · 1 comment

Comments

@TheUltimateAbsol
Copy link

Godot version: 3.3.0

OS/device including version:

GLES2, Windows 10, Intel (R) Graphics 630

Issue description:

When rendering an AtlasTexture in 3D through a Sprite3D or AnimatedSprite3D, the margin height is calculated in reverse of that from 2D, pushing the image downwards instead of upwards

This will cause any animations (such as those using an AnimatedSprite3D) to constantly shift positions up and down with unexpected behaviour, making sprite animations in 3D impossible with AtlasTextures

Steps to reproduce:

  1. Create a Sprite3D
  2. Give it an Atlas Texture
  3. Change the AtlasTexture's margin "h" value and watch the sprite go down instead of up

Results:
3D (goes downwards below the plane)
image

2D (goes upwards above the plane)
image

Workarounds:

  1. Render to a separate viewport and then use that viewport as a viewport texture. This works, but requires a lot of overhead and will cause significant slowdown on mobile
  2. Bite the bullet and readjust manually the position of every Sprite3D to match your desired margin
  3. ???????
  4. Recompile godot and fix the issue yourself before someone tells you that AtlasTextures are getting an overhaul in 4.0

Minimal reproduction project:

AtlasTextureTest.zip

@Calinou
Copy link
Member

Calinou commented May 18, 2021

AtlasTextures are not supported in 3D. They are only supported in 2D: https://godotengine.org/article/atlas-support-returns-godot-3-2

Also, due to a bug, AtlasTextures don't save VRAM on iOS: #36105

To use fixed-size animations in Sprite3D, you can use AnimatedSprite3D, or Sprite3D + AnimatedTexture.

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

No branches or pull requests

2 participants