I'm trying to have a perspective effect on an image, a reto grid tunnel like this one: https://www.youtube.com/watch?v=IlKsfV2mRR8.
Using a quad I can manage to get the texture repeating, but not the distortion to make the perspective effect.
I was using a shader for this, but the device the app will run on doesn't seem able to display it correctly, so I'm looking for alternatives. Googling a bit, I've seen there was a different way to draw quads before LÖVE 0.9.0, which might have been handy for waht I want to achieve:
love.graphics.quad( mode, x1, y1, x2, y2, x3, y3, x4, y4 )
This was removed in 0.9.0 and now it's recommended to use "polygon" instead. However, polygons don't allow to set a texture like quads (afaik).
Does anyone have any idea on how to achieve this without using shaders? My last option is to draw a looped video, but I'd rather not, as it would make the project so big.
Trying to draw a textured polygon
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Trying to draw a textured polygon
Note that love.graphics.quad, contrary to what the name might suggest, did not draw Quads at all, it drew quadrilaterals. Anyway, the answer is to use a Mesh. Note that shaders are supported everywhere love is, but on phones/embedded devices the shaders need to be OpenGL ES-compliant too.
Re: Trying to draw a textured polygon
I'll take a look at making the shader gles compliant. That might be the key.
I tried with a mesh but setting vertices to make the perspective effect resulted in a weird result (can't post a screenshot now, but I found some topics here with the same issue).
EDIT
I'm using this shader (perspective.lua-textured polygons): viewtopic.php?t=12483
Is it "gles-ready"? I can't seem to find a way to test if it would work on a gles device :-/
I tried with a mesh but setting vertices to make the perspective effect resulted in a weird result (can't post a screenshot now, but I found some topics here with the same issue).
EDIT
I'm using this shader (perspective.lua-textured polygons): viewtopic.php?t=12483
Is it "gles-ready"? I can't seem to find a way to test if it would work on a gles device :-/
Re: Trying to draw a textured polygon
That is, assuming your computer supports GL ES and the drivers use a stricter compiler. I don't know how to check for that, but trying won't hurt.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Trying to draw a textured polygon
Thanks It does support it and I'm setting that flag already, but I think the LÖVE build I'm currently using (made by a friend of mine because I'm really bad at that) needs some more work. He already told me performance wouldn't be very good yet, so I'm still calm about it.
I just wanted to know it the shader should work fine on a gles device, as I don't really know what to check. It would be cool if there was some online tool for that
I just wanted to know it the shader should work fine on a gles device, as I don't really know what to check. It would be cool if there was some online tool for that
Who is online
Users browsing this forum: Google [Bot] and 4 guests