SFML community forums

Help => Graphics => Topic started by: Nafffen on July 24, 2022, 10:36:59 am

Title: Alternative of shaders on Android
Post by: Nafffen on July 24, 2022, 10:36:59 am
Hello everyone,

I want to bring my sfml app on Android and I'm using a little shader to blend textures from multiple mask images (black and white, ex img: maskStone512x.png) into a VertexArray on my tilemap object (can see result with img: result.PNG).
I don't want to have a texture per tile but I want a smooth background. That's why I did it this way.

If I'm right, on Android, I can't use my personal shader because of gl es 2.0 which is not supported by sfml currently.  :'(

I need to find an alternative to this utilisation.

Actually, the tilemap texture is not changing afterwards so I thought a simple sprite/texture could be ok after the generation and transmission of the texture by the server. If I do this way, is there a maximum size of sprite/texture I should not exceed to keep a good performance on android ? Should I split the tilemap in different zone to control their draw matching the size and pos of the view ? If so what size each part ?

If you have another idea to workaround :D

Thank you very much for your help
Title: Re: Alternative of shaders on Android
Post by: eXpl0it3r on August 02, 2022, 12:29:03 am
You may be able to achieve something similar by pre-masking the gras texture and alpha blending it
Title: Re: Alternative of shaders on Android
Post by: Nafffen on September 08, 2022, 05:54:48 pm
Thank you for mentioning that, if others have a similar question I did that that way (first use of blendmode, could be better I suppose):

Mask are full alpha by defaut and color where I want to put material (see attachement)

(click to show/hide)