• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Shaders How is the shader added to the layer?

L

ltzibaozhe

Guest
Hello everyone!
I found an "overlay" blend mode shader (simulating Photoshop's blending effect) it's great! But there is a fatal problem. It's in full screen and can't be added to the specified layer, it follows the camera movement, which drives me crazy...
(I need the Blendmode effect. I have tried using gpu_set_blendmode_ext(bm_dest_colour, bm_dest_colour) but not good)
I am a beginner and need some help and advice. This is my test file.https://1drv.ms/u/s!AlT3jyrarIBic_GUXsP0aIub1mI?e=MI4mSY
 

Attachments

L

ltzibaozhe

Guest
There are functions for calling a script at the beginning and end of the rendering of a layer, specifically designed for this kind of thing:

https://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/rooms/layers/layer_script_begin.html

So, make two scripts, one to set your shader and one to end the shader, then call them in the layer begin/end script functions linked above.
No effect, maybe I have errors using uniform. . I feel this shader is a bit special. . But you let me know the layer_script_begin method, Thank you man !
 
Top