View Issue Details

IDProjectCategoryView StatusLast Update
0028629RunnerFunctionsPublic2019-10-30 09:35
ReporterStewart BishopAssigned ToCoreTech 
PriorityLowSeverityC - GeneralReproducibility100%
Status AssignedResolutionOpen 
Product Version 
Target VersionFixed in Version 
Summary0028629: Functions: After manually setting the view_matrix sprites get culled
DescriptionIn GMS2 the surface_set_target function sets matrix_view to surface's local coordinates so if I call draw_point(0, 0) it will be drawn in the top-left corner of the surface and it doesn't matter what the current view coordinates are but it's possible to save the matrix_view in the beginning of Draw Event, and set it after the surface_set_target then call draw_point(0,0) and it will set a point it the top-left corner of the current view on the selected surface which seems to be fine.

However nothing is drawn on surface behind its imaginary boundaries if it were placed in the top-left corner of the room then it would be culled since once I set the new view matrix, all the draws are performed in the world coordinates but the algorithm which prevents drawing things behind the camera's view is still working in surface's local coordinates, which is totally wrong.
Steps To Reproduce1) Run the project
2) Move the camera around
3) See that after a small distance your sprite on the mouse coordinates gets culled
Tagsfunctions, rendering, Runner
1.4 Found In
2.x Runtime Found In2.1.3.189
2.x Runtime Verified In2.1.3.189


Stewart Bishop

2018-01-05 12:06


view-surface-bug.yyz (24,201 bytes)

Slim D0g

2018-01-05 22:03

Reporter   ~0057192

I have found a workaround. The usage of camera instead of matrices gives expected result:

var cam = camera_get_active(); // <-- fix
    camera_apply(cam); // <-- fix
    draw_clear_alpha(c_red, 0.5);
    draw_sprite_ext(sprite0, 0, 100, 100, 1, 1, 0, c_white, 1);
    draw_sprite_ext(sprite0, 0, mouse_x, mouse_y, 1, 1, 0, c_white, 1);
camera_apply(cam); // <-- fix

Mike Dailly

2018-01-08 09:27

Developer   ~0057195

If there is currently a user matrix in use, all "auto" clipping should be disable, as we have no idea what they're setting.