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

Author Topic: Glitter Effect with Blur  (Read 3118 times)

0 Members and 1 Guest are viewing this topic.

HiperDoo

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Glitter Effect with Blur
« on: May 10, 2021, 11:44:57 pm »
Hi! This is my first question on this forum, I hope you can help me...

I'm doing different parts of a 2D game that I have to finish for a school project.

I have a very good idea for the design of my game, but after much searching on the internet and through this forum I did not find something that worked for me either because they have not asked it or because it is outdated.

The point is that I need a way to blur a texture, for example to have Cube 1 to Cube 2 (done in JavaScript):


I would need to make the effect of blur and also modify the brightness of it to make it look better.

I would be very grateful if someone could pass me a little code that can do this (a few days ago I realized the existence of shaders) and because I have very little time to finish it.

(I can't blur the textures from the .png because they are 16px textures and because it would be too heavy)

Thank you!!!

HiperDoo

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Glitter Effect with Blur
« Reply #1 on: May 13, 2021, 02:16:26 am »
Does anyone know how to create this effect? Please

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Glitter Effect with Blur
« Reply #2 on: May 13, 2021, 01:58:33 pm »
shaders would be very, VERY better at this case. you can just look for 'blur shader glsl' in google or shadertoy, there are tons of them.

but if you want to make it directly in SFML, you could use a VertexArray with 9 tiles and stretch the borders of your texture. for example, if your texture has 16px, you could set the outer rectangles to use like 3px of the texture, and the inner would use 11px. then, for the outer pixels you set the alpha to 0.



Visit my game site (and hopefully help funding it? )
Website | IndieDB