Shaders Rescaling problem: blur

Dupletor

Member
Hello, I'm using a tutorial in order to make a flag effect:


Everything was good, and if I apply my modified shader to a large picture, this happens:
1585854327607.png
Which is around the effect I want.
However, if I apply it to a smaller picture, without changing the distort map (which is 256x256):
1585854765463.png

It gets blurry, and hard limited on the left and down:
1585854529122.png . . . 1585854913119.png


The hard limit I fixed by giving empty borders on the image, and applying the distort map on the empty borders.

Is it possible to apply the shader on a large picture, rescale it to the smaller size, and then draw it smaller on application surface without this blur, or something?
 
Last edited:

Dupletor

Member
Got it!
The problem was, the drawing object from the tutorial simply drew the sprite, without taking scale into consideration, so I replaced the object image with the bigger image, and inside the draw event called for draw_self() instead, with a reduced image_xscale, image_yscale:
It applied the shader to the bigger sprite and drew with reduced scale, instead of applying the shader on the reduced image. No blur!

I could probably just apply any drawing function that takes the increased sprite and scale into consideration, it was a simpler problem than imagined.

1585860053448.png
 
Last edited:
Top