Mode 7 still, this time with a fragment shader.
Controls:
WASD/UDLR: Move character
1 & 2: Change angle
3 & 4: Change scale
5 & 6: Change character location (how far up/down as a percentage of the screen)
Random question, will LOVE ever use anything above GLSL 1.20 so I can have nearest neighbor filtering? floor(pixel_coords)/screenwidth doesn't work.
Planned features:
☑: Psudo-3D track
☒: Racing physics
☒: AI
☒: Sprites
☒: Tracks
☒: A track editor
☒: Characters
☒: Loads of awesome pixel effects
☒: Stereoscopic 3D
History:
v1.0
- Initial
v1.5
- Adds some kart physics
- Adds shadow
Mario Kart (again)
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Mario Kart (again)
Last edited by retrotails on Sun May 05, 2013 4:37 pm, edited 1 time in total.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Mario Kart (again)
I'm not sure I understand. Nearest-neighbour filtering is controlled by (Image):setFilter and Canvas:setFilter. Changing an image's filter will affect it when it's drawn regardless of whether a shader is active, different GLSL versions don't change that.retrotalis wrote:Random question, will LOVE ever use anything above GLSL 1.20 so I can have nearest neighbor filtering? floor(pixel_coords)/screenwidth doesn't work.
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Re: Mario Kart (again)
Yes, but not when a texture is drawn in a shader. Only GLSL 1.30 can do that as far as I know.slime wrote:I'm not sure I understand. Nearest-neighbour filtering is controlled by (Image):setFilter and Canvas:setFilter. Changing an image's filter will affect it when it's drawn regardless of whether a shader is active, different GLSL versions don't change that.retrotalis wrote:Random question, will LOVE ever use anything above GLSL 1.20 so I can have nearest neighbor filtering? floor(pixel_coords)/screenwidth doesn't work.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Mario Kart (again)
No. As I just said, an image's (or canvas') filter mode is completely separate from shader versions. Changing it will affect Texel/texture2D function calls in shaders for that image no matter the GLSL version.retrotails wrote:Yes, but not when a texture is drawn in a shader. Only GLSL 1.30 can do that as far as I know.slime wrote:I'm not sure I understand. Nearest-neighbour filtering is controlled by (Image):setFilter and Canvas:setFilter. Changing an image's filter will affect it when it's drawn regardless of whether a shader is active, different GLSL versions don't change that.retrotalis wrote:Random question, will LOVE ever use anything above GLSL 1.20 so I can have nearest neighbor filtering? floor(pixel_coords)/screenwidth doesn't work.
It's pretty easy to test this. Adding tex:setFilter("nearest", "nearest") to love.load changes it from this:
to this:
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Re: Mario Kart (again)
Tried it, doesn't work for me. You using a version above 0.8.0?slime wrote: It's pretty easy to test this. Adding tex:setFilter("nearest", "nearest") to love.load changes it
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Mario Kart (again)
Nope. Are your video drivers up to date? If not, update them. What GPU do you have? Can you confirm that tex:getFilter() returns "nearest", "nearest" after the setFilter call?retrotails wrote:Tried it, doesn't work for me. You using a version above 0.8.0?slime wrote: It's pretty easy to test this. Adding tex:setFilter("nearest", "nearest") to love.load changes it
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Re: Mario Kart (again)
I used setDefaultImageFilter but I've tried setFilter on the texture and the canvas, to no avail.slime wrote:Nope. Are your video drivers up to date? If not, update them. What GPU do you have? Can you confirm that tex:getFilter() returns "nearest", "nearest" after the setFilter call?retrotails wrote:Tried it, doesn't work for me. You using a version above 0.8.0?slime wrote: It's pretty easy to test this. Adding tex:setFilter("nearest", "nearest") to love.load changes it
See v1.5 above - it's still filtered for me.
track.tex:getFilter() returns 'nearest'
Ubuntu 12.04
Latest experimental nVidia drivers (310.14)
GTX 260
Love 0.8.0
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Mario Kart (again)
In your updated version, you draw the track image to a canvas, and then use that canvas in the shader. love.graphics.setDefaultImageFilter doesn't affect canvases in 0.8.0, so your texture accesses in the shader still use linear filtering. Setting nearest-neighbour filtering for all of the canvases individually makes it work as expected.
Version 1.0 works fine by just setting the default image filter, because you're using the image directly in the shader.
Version 1.0 works fine by just setting the default image filter, because you're using the image directly in the shader.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests