Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Alternative of shaders on Android  (Read 1683 times)

0 Members and 1 Guest are viewing this topic.

Nafffen

  • Newbie
  • *
  • Posts: 20
    • View Profile
Alternative of shaders on Android
« 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Alternative of shaders on Android
« Reply #1 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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nafffen

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Alternative of shaders on Android
« Reply #2 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)