I wish I could explain this better, but I'll try.
Right now I have a graphic effect that requires the use of a lot of small graphic calls. I figured I would draw this effect to a canvas, and then just draw that canvas to increase performance. Long story short, it didn't work. For some reason the canvas is only displaying as like 60% of the area I set it too, and my draw calls to it are really mucked. I think it has something to do with Gamera but I'm not sure. Anyone have any idea? I understand it's a lot of code to go through, and it's quite the mess.
as of now I just made the canvas a big white square to see where it is, and it's not where it's supposed to be. It should be the entire screen.
Canvas problem; canvas not right size? Gamera?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Canvas problem; canvas not right size? Gamera?
- Attachments
-
- fore.love
- (1.43 MiB) Downloaded 118 times
Re: Canvas problem; canvas not right size? Gamera?
Hi, your right the clipping of the canvas comes from gamera
when gamera draw it uses love.graphics.setScissor to limit the drawing area (I never heard about this function before but I'm happy to discover it )
So when you draw your canvas, the draw doesn't go beyond 1280 in width due to your setting.
To solve it you can delete the setScissor call but you'll lose efficiency.
Or try to create those canvas out of the gamera draw
PS : yes, it's quite a mess, at least think about auto indentation
when gamera draw it uses love.graphics.setScissor to limit the drawing area (I never heard about this function before but I'm happy to discover it )
So when you draw your canvas, the draw doesn't go beyond 1280 in width due to your setting.
To solve it you can delete the setScissor call but you'll lose efficiency.
Or try to create those canvas out of the gamera draw
PS : yes, it's quite a mess, at least think about auto indentation
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Canvas problem; canvas not right size? Gamera?
Do you need to do the canvas manipulation inside the camera:draw(...) function? It seems that you should be doing it before using the camera at all.
When I write def I mean function.
Re: Canvas problem; canvas not right size? Gamera?
Joe Black wrote:Hi, your right the clipping of the canvas comes from gamera
when gamera draw it uses love.graphics.setScissor to limit the drawing area (I never heard about this function before but I'm happy to discover it )
So when you draw your canvas, the draw doesn't go beyond 1280 in width due to your setting.
To solve it you can delete the setScissor call but you'll lose efficiency.
Or try to create those canvas out of the gamera draw
PS : yes, it's quite a mess, at least think about auto indentation
Thank you! I didn't even think about the scissor. I removed it and the white now fills the entire screen meaning the canvas is being drawn. Now I'm going to have to work on getting the grass particles to actually draw right on the canvas. And I'll think about it lol.
Your'e right, I don't. Didn't even consider just drawing to the canvas out of the draw method, I was trying to do all these transforms to undo what the camera was doing. Can I perform draw calls in the update loop to create a canvas? If not, once I get home I'll just split my particle draw function in two.kikito wrote:Do you need to do the canvas manipulation inside the camera:draw(...) function? It seems that you should be doing it before using the camera at all.
Thanks! Without anim8 or gamera I wouldn't be anywhere near as far as I am making this game.
Re: Canvas problem; canvas not right size? Gamera?
That did it, after I moved the draw call out of the camera draw everything worked perfectly. I'll keep that in mind for later.
- DeltaF1
- Citizen
- Posts: 64
- Joined: Mon Apr 27, 2015 4:12 pm
- Location: The Bottom of the Stack
- Contact:
Re: Canvas problem; canvas not right size? Gamera?
I hope we'll see this game in the Projects subforum soon, it looks very interesting
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests