It is my experience that, yes, they need to be PO2. Or else you get implementation errors on some (many it seems) systems.Robin wrote:Does it need to be PO2?
How to use Framebuffer:renderTo() properly
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: How to use Framebuffer:renderTo() properly
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How to use Framebuffer:renderTo() properly
Oh, ok. I wouldn't know.TechnoCat wrote:It is my experience that, yes, they need to be PO2. Or else you get implementation errors on some (many it seems) systems.Robin wrote:Does it need to be PO2?
Help us help you: attach a .love.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: How to use Framebuffer:renderTo() properly
Sounds complicated.vrld wrote:Neither. It's a constraint set by OpenGL.kikito wrote:Is that a bug or a feature?
To understand why, think of the framebuffer as an offscreen... screen. In a 3D world, you don't handle pixels, but only shapes (that may have some nice textures on them). These shapes are projected onto a screen, like in a shadow theater.
Now you always want to project the shapes in a way that the whole screen will be filled. If you take a bigger screen and set it up so that it will show the same shadows as the small screen, the shadows will obviously be larger.
When creating a framebuffer, OpenGL will ensure you see the same content on the buffer as you do on your main screen.
The way LÖVE handles 2D is basically to have only flat shapes in the same plane. Images are just surfaces with the image as texture on them. If you project that to a bigger screen, the image will appear to be upscaled.
The scaling with love.graphics.scale is somewhat like moving the screen further away (or closer to) from the objects that are projected onto the screen.
So I take that on a tile-based game, spriteBatches are more appropiate for rendering the level than framebuffers then. Specially if they involve scrolling, perhaps?
-__- I'm still very 0.6-oriented.
When I write def I mean function.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: How to use Framebuffer:renderTo() properly
Don't sprite batches still draw each object every frame?kikito wrote:Sounds complicated.
So I take that on a tile-based game, spriteBatches are more appropiate for rendering the level than framebuffers then. Specially if they involve scrolling, perhaps?
-__- I'm still very 0.6-oriented.
Anyways, still curious about this PO2 stretching issue.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How to use Framebuffer:renderTo() properly
Congrats on your 600th post.TechnoCat wrote:Anyways, still curious about this PO2 stretching issue.
And you could try some things, see what they do?
Help us help you: attach a .love.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: How to use Framebuffer:renderTo() properly
Easiest solution is to make the window po2 too. But then forget full screen.
Disclaimer: Framebuffer and screen size will be independent soon. http://bitbucket.org/rude/love/changeset/4deb61ae7d2c
Disclaimer: Framebuffer and screen size will be independent soon. http://bitbucket.org/rude/love/changeset/4deb61ae7d2c
Last edited by TechnoCat on Thu Nov 18, 2010 3:33 pm, edited 1 time in total.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: How to use Framebuffer:renderTo() properly
LOVE was fixed to not stretch framebuffer windows to the main window. I'm waiting on a build with that before I continue using framebuffers.
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How to use Framebuffer:renderTo() properly
How would I use this to:
Copy the contents of the main visible screen to a separate buffer
Manipulate the pixels of the separate newly copied buffer, say make all the pixels greyscale
Then use that separate buffer as an image to paste onto the main screen
?
Copy the contents of the main visible screen to a separate buffer
Manipulate the pixels of the separate newly copied buffer, say make all the pixels greyscale
Then use that separate buffer as an image to paste onto the main screen
?
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Denver, CO
- Contact:
Re: How to use Framebuffer:renderTo() properly
Sounds more like a job for a shader.Jasoco wrote:How would I use this to:
Copy the contents of the main visible screen to a separate buffer
Manipulate the pixels of the separate newly copied buffer, say make all the pixels greyscale
Then use that separate buffer as an image to paste onto the main screen
?
but maybe, screenshot, greyscale mappixel, draw
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How to use Framebuffer:renderTo() properly
Well, mostly the first and third steps. Can I copy from one frame to another? Then can I take another and use it as image data?
That's mainly what I want. Or just how do I draw to another buffer and use that buffer on my main screen? I don't understand the code provided. Anyone have a working example .love file?
That's mainly what I want. Or just how do I draw to another buffer and use that buffer on my main screen? I don't understand the code provided. Anyone have a working example .love file?
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 69 guests