Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Apply a Gaussian blur effect to a 2D element

LaVache

New member
Joined
Oct 26, 2020
Messages
44
Reaction score
12
Points
0
hello everyone, wanted to know if anyone had a method to apply a gausian blur effect on a 2D element like a rect or a circle or any other shape, I looked around to see if there had a way to do this in openGL but i couldn't find anything and i'm not very good at openGL, i only know the basics. if you don't see what i want to do i put a picture and basically i want to do like this any shape on minecraft


rectBlur.png

ah noted I have already tried to import an image it works but it is not suitable for all sizes and I can not create 50 images for each shape
it takes up too much space in my client and it's not great for xd optimization
 

Attachments

  • rectBlur.png
    rectBlur.png
    70.2 KB · Views: 209
[QUOTE = "Kuqs, message: 61265, membre: 80"]
pour dropshadow: https://www.dreamincode.net/forums/topic/186937-drop-shadow-2d-opengl/

pour un flou, la méthode de flou existante, qui existe depuis la 1.8.8, y compris le shader de flou, devrait être suffisante.
[/CITATION]

it's not really the help that I expected but I will manage, thank
from an earlier thread i noticed that the "Jello Source Leak" contains a method that makes rects blur directly. You could for example just copy paste them.
 
from an earlier thread i noticed that the "Jello Source Leak" contains a method that makes rects blur directly. You could for example just copy paste them.

except i need to do this for any roundRect circle rect triangle shapes
I already use blur but not for such complex forms glScissor does not allow me to do that
 
First of all u need to do an custom Fragment Gaussian Shader then u gonna draw the whole Minecraft Framebuffer and apply first Horizontally the Gaussian Shader into it and then u apply on the Horizontally Blurred Minecraft Buffer to an Vertical FrameBuffer which u also gonna blur then u bind the Minecraft buffer and draw the horizontal buffer aswell as the vertical buffer where u gonna stencil all Components out which is drawn into an Framebuffer.
 
First of all u need to do an custom Fragment Gaussian Shader then u gonna draw the whole Minecraft Framebuffer and apply first Horizontally the Gaussian Shader into it and then u apply on the Horizontally Blurred Minecraft Buffer to an Vertical FrameBuffer which u also gonna blur then u bind the Minecraft buffer and draw the horizontal buffer aswell as the vertical buffer where u gonna stencil all Components out which is drawn into an Framebuffer.


OK but can I use this for all types of forms?
 
yes1606494748117.png would look like this then
 

Attachments

  • 1606494748117.png
    1606494748117.png
    565.4 KB · Views: 167
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top