YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
13 stars 5 forks source link

In-Game: Sprites disappear too early if they have an offset and you move their position in a vertex shader #5817

Closed gm-bug-reporter[bot] closed 2 weeks ago

gm-bug-reporter[bot] commented 3 weeks ago

Description

When drawing sprites with a perspective camera and updating their position in the vertex shader, the sprite seems to disapear when the camera moves. Their draw events seems to be executed but the sprite is not drawn.

Steps To Reproduce

  1. Put a sprite in the room and a perspective camera (the error seems to happen with all cameras)
  2. Apply a shader to it and move all the vertices with a big offset
  3. Move the camera far from the sprite
  4. See the issue

Which version of GameMaker are you reporting this issue for?

IDE v2024.4.0.137 Runtime v2024.4.0.168

Which operating system(s) are you seeing the problem on?

Windows 10.0.22631.0

Which platform(s) are you seeing the problem on?

Android, Windows

97b8b623-54ec-48a9-a5e7-13b23ebcbe56

jackerley commented 2 weeks ago

Updated sample project that shows the problem could be seen using draw_self as well. Also contains the fix with a toggle for visibility sprite_disappear_bug.zip

YYDan commented 2 weeks ago

Can see that new functions have been added for controlling whether the culling operation takes place or not, so these will need documenting and testing.

phablix commented 2 weeks ago

Would be great if these functions also worked not only with drawsprite calls but also with drawsurface, draw_tilemap or anything that uses the internal culling.

Alphish commented 2 weeks ago

Looks like this and FR #4530 are about the same thing, so the other one might also get closed?