0.6.0 Update
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: 0.6.0 Update
What's a Power of 2 image?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 0.6.0 Update
Image with it's width and height being a power of 2.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: 0.6.0 Update
That doesn't explain what a power of 2 is. I failed Algebra, talk to me like I am in preschool.
Re: 0.6.0 Update
2 4 8 16 32 64 128 256 512 1024 2048 ect
http://en.wikipedia.org/wiki/Power_of_two
open gl requires images be a power of 2, love just usually padded it for you if it wasnt
also it doesnt have to be square ie 1024x128 is perfectly valid
http://en.wikipedia.org/wiki/Power_of_two
open gl requires images be a power of 2, love just usually padded it for you if it wasnt
also it doesnt have to be square ie 1024x128 is perfectly valid
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: 0.6.0 Update
Ah, good.
Re: 0.6.0 Update
Hmm, people would be using the padPowerTwo() function no matter what just to suit the computers with crappy drivers...rude wrote:Yes. The plan is also to add a function to ImageData:
That may change the width/height of the image, so you don't want to divide getWidth/getHeight by 2 to get the center of the image, for instance.Code: Select all
imgd = love.image.newImageData("evil.png") imgd:padPowerTwo() image = love.graphics.newImage(imdg)
If this is really going to be the situation then I think we should just disable non-power of two images altogether if we don't pad the images for the programmer by default... otherwise we'd see stuff like....
Code: Select all
imgd = love.image.newImageData("evil.png")
imgd:padPowerTwo()
imgd1 = love.image.newImageData("evil1.png")
imgd1:padPowerTwo()
imgd2 = love.image.newImageData("evil2.png")
imgd2:padPowerTwo()
imgd3 = love.image.newImageData("evil3.png")
imgd3:padPowerTwo()
imgd4 = love.image.newImageData("evil4.png")
imgd4:padPowerTwo()
Code: Select all
imgd = love.image.newImageData("evil.png")
imgd1 = love.image.newImageData("evil1.png")
imgd2 = love.image.newImageData("evil2.png")
imgd3 = love.image.newImageData("evil3.png")
imgd4 = love.image.newImageData("evil4.png")
Re: 0.6.0 Update
I am using io.lines and io.open ..... it still works, but has a different working directory or something like that, I want it to have the working directory of the .love file beeing executed.... how do i get this path?
- Sardtok
- Party member
- Posts: 108
- Joined: Thu Feb 21, 2008 2:37 pm
- Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
- Contact:
Re: 0.6.0 Update
Are there still video cards that don't support non-power-of-two textures?
There are of course four different OpenGL extensions that allow non-power-of-two textures.
It doesn't make sense to let the LÖVE devs decide if the textures need to be power-of-two textures or not, though.
GL_ARB_TEXTURE_NON_POWER_OF_TWO - the standard extension for non-power-of-two-textures
GL_TEXTURE_RECTANGLE_EXT - (old version of?) nvidia extension for non-power-of-two support
GL_TEXTURE_RECTANGLE_NV - nvidia extension for non-power-of-two support
GL_TEXTURE_RECTANGLE_ARB - the same as the two above with some opengl shading language additions
So, you'd actually have to check for all four and if none of them are available, pad the textures. Isn't it easier to just always pad the texture?
Or did you do this to get pixel coordinates for textures instead of floating point coords (0.0-1.0)?
There are of course four different OpenGL extensions that allow non-power-of-two textures.
It doesn't make sense to let the LÖVE devs decide if the textures need to be power-of-two textures or not, though.
GL_ARB_TEXTURE_NON_POWER_OF_TWO - the standard extension for non-power-of-two-textures
GL_TEXTURE_RECTANGLE_EXT - (old version of?) nvidia extension for non-power-of-two support
GL_TEXTURE_RECTANGLE_NV - nvidia extension for non-power-of-two support
GL_TEXTURE_RECTANGLE_ARB - the same as the two above with some opengl shading language additions
So, you'd actually have to check for all four and if none of them are available, pad the textures. Isn't it easier to just always pad the texture?
Or did you do this to get pixel coordinates for textures instead of floating point coords (0.0-1.0)?
Re: 0.6.0 Update
The default should probably be to automatically pad images loaded to power-of-2, with the ability to check the card for non-pow-2 extensions and globally disable the behavior of automatic padding.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 0.6.0 Update
I wonder is there a downside to not making power-of-two sized images? Is there a loss in padding the images?
Who is online
Users browsing this forum: No registered users and 0 guests