Create maps in LÖVE for Android
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Create maps in LÖVE for Android
I looked at the App that 'Gunroar:Cannon()" mentioned and MY GOD ! What a complete App, I believe my problem is solved, thanks to everyone who took the time to help me... you guys are awesome
Code: Select all
-------------------------------
-- i love programming in Lua --
-------------------------------
Re: Create maps in LÖVE for Android
Any example?Gunroar:Cannon() wrote: ↑Fri Aug 27, 2021 8:51 am But non of the shader libraries can be used...I think. I can't even do simple effects in my attempts
Most importantly, GLES shaders don't accept integers where floats are expected. That's to say, use e.g. 1.0 instead of 1 if a float is required.
Re: Create maps in LÖVE for Android
And
y = math.floor(x)/1
?
I knew that Lua has difference between 1 and 1.0!
Re: Create maps in LÖVE for Android
In Lua 5.1 and LuaJIT there's no difference: they are just double precision floating point numbers. I was talking about GLSL, the language used to write shaders.
Code: Select all
-- Example: Shader to ignore alpha
local shader = love.graphics.newShader[[
vec4 effect(vec4 colour, Image tex, vec2 texpos, vec2 scrpos)
{
return vec4(Texel(tex, texpos).rgb * colour.rgb, 1); // won't work on most GLES
return vec4(Texel(tex, texpos).rgb * colour.rgb, 1.0); // should work everywhere
}
]]
Last edited by pgimeno on Sun Aug 29, 2021 11:48 am, edited 1 time in total.
Re: Create maps in LÖVE for Android
<pedantic>Won't work anywhere either way because colour should be vec4.</pedantic>pgimeno wrote: ↑Sat Aug 28, 2021 11:26 amCode: Select all
-- Example: Shader to ignore alpha local shader = love.graphics.newShader[[ vec4 effect(vec2 colour, Image tex, vec2 texpos, vec2 scrpos) { return vec4(Texel(tex, texpos).rgb * colour.rgb, 1); // won't work on most GLES return vec4(Texel(tex, texpos).rgb * colour.rgb, 1.0); // should work everywhere } ]]
- Gunroar:Cannon()
- Party member
- Posts: 1088
- Joined: Thu Dec 10, 2020 1:57 am
Re: Create maps in LÖVE for Android
I knew the 1 -> 1.0 thing, I triedto fix what I could . Lighting libs like lightworld don't work. I got shadöw to work barely tho. And in general I can't really find any resource/tutorial to understand shaders well enough to know what I could use them for
Re: Create maps in LÖVE for Android
bruhgeneral I can't really find any resource/tutorial to understand shaders well enough to know what I could use them for
1st page of google
https://glslsandbox.com/
- Gunroar:Cannon()
- Party member
- Posts: 1088
- Joined: Thu Dec 10, 2020 1:57 am
Re: Create maps in LÖVE for Android
That just kinda confuses me, I was talking about tutorials and how/when to use them. I read stuff in tuts-gamedev-something but it just gave really basic stuff that löve already does like drawing pictures. Plus I think uniform(or something like that) doesn't work so pushing variables to shaders on android can't work
Re: Create maps in LÖVE for Android
@grump thanks, fixed.
@Gunroar:Cannon() I learnt the basics of shaders with http://blogs.love2d.org/content/beginners-guide-shaders
@Gunroar:Cannon() I learnt the basics of shaders with http://blogs.love2d.org/content/beginners-guide-shaders
Re: Create maps in LÖVE for Android
Maybe when you need it?
Like, from that site you can see that, with shaders you practically draw anything, with 1 drawback, that shaders like use ALOT of perfomance
So if you need to achieve some effect and you can't do that without shader, then use shader
If you can achieve that without shader and it will take less perfomance, than don't use it
UhPlus I think uniform(or something like that) doesn't work so pushing variables to
Then adapt code of pure GLSL to love's
Why?pushing variables to shaders on android can't work
https://www.love2d.org/wiki/Shader:send
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 206 guests