Page 1 of 1

Saving an upscaled texture

Posted: Tue Sep 26, 2017 12:51 pm
by Terff
Hello fellow developers! Lets say I have an image 16x16, I want to upscale it to 256x256 using bilinear interpolation (like you can in love.graphics.draw) but then I want to save the new upscaled image so I can pass it to a shader. I can't seem to find a way to upscale imagedata outside of love.graphics.draw, is there any way to get the upscaled image into imagedata?

Re: Saving an upscaled texture

Posted: Tue Sep 26, 2017 3:53 pm
by bartbes
You can't (easily) turn it into ImageData, but you can use a Canvas.

Re: Saving an upscaled texture

Posted: Tue Sep 26, 2017 4:00 pm
by Nixola
Why do you need to pass the upscaled image to a shader as opposed to the normal one? Can't you just let the shader do the interpolation?

Re: Saving an upscaled texture

Posted: Fri Oct 06, 2017 9:12 pm
by Terff
Nixola wrote: Tue Sep 26, 2017 4:00 pm Why do you need to pass the upscaled image to a shader as opposed to the normal one? Can't you just let the shader do the interpolation?
Eh thought it would be easier to have the program do it for me, I ended up implementing the interpolation in the end.

Re: Saving an upscaled texture

Posted: Sat Oct 07, 2017 1:57 am
by s-ol
Terff wrote: Fri Oct 06, 2017 9:12 pm
Nixola wrote: Tue Sep 26, 2017 4:00 pm Why do you need to pass the upscaled image to a shader as opposed to the normal one? Can't you just let the shader do the interpolation?
Eh thought it would be easier to have the program do it for me, I ended up implementing the interpolation in the end.
uhm, doesn't OpenGL do it for you either way? If you just have a 'blank' shader that samples your texture, it shoul use the bilinear sampling method set with :setFilter too.

Re: Saving an upscaled texture

Posted: Wed Oct 11, 2017 3:42 pm
by Terff
s-ol wrote: Sat Oct 07, 2017 1:57 am
Terff wrote: Fri Oct 06, 2017 9:12 pm
Nixola wrote: Tue Sep 26, 2017 4:00 pm Why do you need to pass the upscaled image to a shader as opposed to the normal one? Can't you just let the shader do the interpolation?
Eh thought it would be easier to have the program do it for me, I ended up implementing the interpolation in the end.
uhm, doesn't OpenGL do it for you either way? If you just have a 'blank' shader that samples your texture, it shoul use the bilinear sampling method set with :setFilter too.
oof... didn't even think about that haha, that would've been easier.