Create maps in LÖVE for Android

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Create maps in LÖVE for Android

Post by Gunroar:Cannon() »

pgimeno wrote: Sun Aug 29, 2021 11:50 am @Gunroar:Cannon() I learnt the basics of shaders with http://blogs.love2d.org/content/beginners-guide-shaders
Hmmm..yes, helpful. Especially better than the other one I read.
GVovkiv wrote: Sun Aug 29, 2021 12:41 pm 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
Helpful...any examples when I would have to/can use shaders (besides lighting)?
Plus I think uniform(or something like that) doesn't work so pushing variables to
Uh
Then adapt code of pure GLSL to love's
pushing variables to shaders on android can't work
Why?
https://www.love2d.org/wiki/Shader:send
That's the thing, shader:send won't work because it needs a certain type of variable that I can't use on android's glsl (is it uniform or ...extern?...no...I can't remember, but one variable like that), so I can/have basically get shader code that doesn't use "send" to work.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: Create maps in LÖVE for Android

Post by GVovkiv »

Helpful...any examples when I would have to/can use shaders (besides lighting)?
uh
when you need achieve some special effects?
Wow?

You know, lighting, reflections, blur, color swaping, distortions, etc?
Or something more specific, depends on visual style in your game

This kind of things probably going to be impossible or just hard or just not worth to even try do in other than shader method
Like, as you mention earlier, for example, lighting can be done without using any shader, but then it will be probably not that good as shader, since it may be harder to implement more hard lighting-related effects, such as smooth shadows or something

For example, you can with shader generate in real-time some good looking fire effects
They will be looking good and you will be have opportunity via shader:send change their behavior at runtime
For example, that fire could "react" to wind, change direction and so on
But it will be probably worse for for perfomance, compared to, for example, static fire animation with couple frames
It only depends on what you exactly want and what cons/pros you want to achieve
That's the thing, shader:send won't work because it needs a certain type of variable that I can't use on android's glsl (is it uniform or ...extern?...no...I can't remember, but one variable like that), so I can/have basically get shader code that doesn't use "send" to work.
uh
google for GLES and you will be good
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Create maps in LÖVE for Android

Post by pgimeno »

Gunroar:Cannon() wrote: Sun Aug 29, 2021 3:45 pm That's the thing, shader:send won't work because it needs a certain type of variable that I can't use on android's glsl (is it uniform or ...extern?...no...I can't remember, but one variable like that), so I can/have basically get shader code that doesn't use "send" to work.
Please don't spread misinformation. GLES supports uniforms. 'extern' is a Löve macro that translates to 'uniform'. https://love2d.org/wiki/love.graphics.n ... r_Language

What GLES does not support is pre-initialized uniforms. That shouldn't generally be a problem: just remove the initialization and always send them a value before rendering.

Code: Select all

uniform float a = 1.0; // doesn't work in GLES
uniform float a; // works in GLES
Shaders are mostly used for advanced effects. They add sauce/polish/juice to a game. They can also be used for simpler purposes; for example I used it in the Diamond-Square example to render a texture that only has a Red channel as black&white instead of black&red.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Create maps in LÖVE for Android

Post by Gunroar:Cannon() »

Wow, this is all really great. Yeah, I experienced the slowness of shaders when I tried Shädow(shadöw? Blghrr) a while back. That pre-initializing thing helps pgimeno.
pgimeno wrote: Sun Aug 29, 2021 8:32 pm
Gunroar:Cannon() wrote: Sun Aug 29, 2021 3:45 pm That's the thing, shader:send won't work because it needs a certain type of variable that I can't use on android's glsl (is it uniform or ...extern?...no...I can't remember, but one variable like that), so I can/have basically get shader code that doesn't use "send" to work.
Please don't spread misinformation. GLES supports uniforms. 'extern' is a Löve macro that translates to 'uniform'. .
(Oh, and I did say "is it uniform or ...extern?...no...", but I see the point :) )
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 46 guests