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

Draw calls stop mysteriously when offscreen #28094

Closed
juddrgledhill opened this issue Apr 16, 2019 · 7 comments
Closed

Draw calls stop mysteriously when offscreen #28094

juddrgledhill opened this issue Apr 16, 2019 · 7 comments

Comments

@juddrgledhill
Copy link

juddrgledhill commented Apr 16, 2019

Godot version:

3.1

OS/device including version:

Windows 10

Issue description:

While using multiple draw calls, to draw an empty circle (the perimeter of a circle) using multiple line segments, I noticed that objects close to the edge of the screen stop drawing their circles. Specifically the right edge of the screen - I draw the circle with the first point being along the x axis. It seems like when that first point is drawn offscreen subsequent calls to draw lines in a single _draw() are ignored completely.

Steps to reproduce:
Using a sub routine, draw a non-trivial shape with primitives, where the first command would be offscreen (or out of the viewport maybe...?).

Minimal reproduction project:

OffscreenDraw.zip
Attached.

@juddrgledhill
Copy link
Author

Note that if your first call is drawn on screen, then you subsequently draw offscreen, it seems to work.

@MidZik
Copy link
Contributor

MidZik commented Apr 17, 2019

From a quick look, it seems there's an issue with how transform commands are interacting with the bounding box.

Your example code which exhibits the problem:

draw_set_transform_matrix(transform.inverse())
draw_empty_circle(position, _step, _color, 1, _line_width)

Fixed code which doesn't have any issues:

draw_empty_circle(Vector2(0,0), _step, _color, 1, _line_width)

@juddrgledhill For your specific issue, you don't need to use the transform matrix command. For this specific case, you should just draw the circle relative to the node itself.

There is an issue though, so please leave this open.

@bojidar-bg
Copy link
Contributor

Related: #23711.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 16, 2020

Still valid in 3.2.3 rc3
EDIT: And 9413446 too.

@TechnoPorg
Copy link
Contributor

As far as I can tell, drawing behaviour in this regard is currently the same in 3.5.1 and master. Can you still reproduce this issue in either of those versions? I'm not entirely sure what I'm supposed to be looking for, so I can't tell if this is still a valid issue.

@juddrgledhill
Copy link
Author

I will try it asap with the project above.

@juddrgledhill
Copy link
Author

I reran this in v3.5.stable.official [991bb6a]. I attached the project to this posting. It looks like the draw calls are happening on the screen edge, so I believe this can be closed.
OffscreenDraw_35.zip

@KoBeWi KoBeWi closed this as completed Oct 6, 2022
@akien-mga akien-mga added this to the 3.5 milestone Oct 7, 2022
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

7 participants