@@gamingreverends-devcorner1379 I have a question if you could help me. I've been about 5 hours now trying to impplement the water line/water foam distortion into a circular shape since in my case the water is part of a circular planet. So in this case for the water line, instead of a line I use a circle outline. I have been able to add the effect however since the distortion map moves in the x and y axis, the effect doesn't work well at angles. I think distortionig the distortion map so it makes a circle that closes all the time(Stuff goes from outside to the middle) or/and ;this time easier; making it go in circles around the central point of the surface (Which is the central point of the planet) would work well(R in a direction, G in the opposite,and B going inwards). However I've been unable to find the tools of way to do that. I know the key is in this part of the fragment shader: *"distort_sample.r = texture2D(distort_tex, fract(v_vPosition_R)).r;"* and *"distort_sample.r = texture2D(distort_tex, fract(v_vPosition_R)).r;"* Maybe making the uv coordinates go in circle based on an angle passed to the shader with sin and cos.. but I cannot make it work. Could you throw me a little help? If it is too much don't worry, I'll keep working on it and let you know if I get it, but if you can I will love you forever hahaha Thanks for all your work! *I think I can't post any link here but I have uploaded two gifs of my progress on that on yoyogsmes forum under and you can watch it if you lool for "Rotation of uv coordinates" in the latest post.
@@SitoKal I think you'd need to or can change alot for the effect you want. But I doubt you need to rotate the uvs. you need to rotate the distortion direction. So for each fragment find a distortion strength as a float based on the distortion maps red and green (probably no need for blue). Let's say your shader calculates the distortion strength is 0.01. Now create a vector from that where x is the distortion strength and y is 0. Then turn that vector by the angle the current fragment is relative to the centre of the circle. Now the distortion will always be from the centre of the circle.
@@gamingreverends-devcorner1379 So I have tryed this but makes strange stuff instead of going in circles if you can check it(No need to, just if you want,I understand): ·vec2 dir_to_center = vec2(in_Position.x-centro.x,in_Position.y-centro.y); ·float angle = degrees(acos(dot(normalize(vec2(1,0)),normalize(dir_to_center))));//Calculate angle between vec2"center" and "inPosition.xy" in degrees ·float distance_to_center= length(dir_to_center)/200.0; ·v_vPosition_R = (in_Position.xy + vec2(water_shift_RGB.r*distance_to_center*sin(angle), water_shift_RGB.r*distance_to_center*cos(angle))) / pattern_size; //Move anti-clockwise ·v_vPosition_G = (in_Position.xy + vec2(water_shift_RGB.g*distance_to_center*sin(angle), (water_shift_RGB.g*distance_to_center*cos(angle))) / pattern_size; //Moves clockwise ·v_vPosition_B = (in_Position.xy - vec2(0.0, water_shift_RGB.b)) / pattern_size; //Same as original
As always, thank you so much for another beautiful tutorial! How would you suggest to make a water shader for a top-down view game? Would it be better to apply the shader on a tileset layer or have objects drawing the area where there should be water with the shader?
@@Chickfilae Unfortunately I don't have a solution for you since I don't have time to code one. you need to figuere out where in the drawing and/or shader code you need to apply the camera zoom factor and maybe the cameras position.
At the moment I have no plans to return to blur shaders. but if you watch all the blur videos in this series you should be able to create motion blur and radial blur without a problem really - so just stat creating one :)
This is such an amazing work. Thank you so much for it. I really enjoyed the video.
All the best to you, man.
Thank you very much
YOU'RE AMAZING. Man, I've been seing your videos a you're the best to learn advanced GM!!
Thank you :)
@@gamingreverends-devcorner1379 I have a question if you could help me.
I've been about 5 hours now trying to impplement the water line/water foam distortion into a circular shape since in my case the water is part of a circular planet.
So in this case for the water line, instead of a line I use a circle outline.
I have been able to add the effect however since the distortion map moves in the x and y axis, the effect doesn't work well at angles. I think distortionig the distortion map so it makes a circle that closes all the time(Stuff goes from outside to the middle) or/and ;this time easier; making it go in circles around the central point of the surface (Which is the central point of the planet) would work well(R in a direction, G in the opposite,and B going inwards). However I've been unable to find the tools of way to do that.
I know the key is in this part of the fragment shader:
*"distort_sample.r = texture2D(distort_tex, fract(v_vPosition_R)).r;"* and *"distort_sample.r = texture2D(distort_tex, fract(v_vPosition_R)).r;"*
Maybe making the uv coordinates go in circle based on an angle passed to the shader with sin and cos.. but I cannot make it work.
Could you throw me a little help? If it is too much don't worry, I'll keep working on it and let you know if I get it, but if you can I will love you forever hahaha
Thanks for all your work!
*I think I can't post any link here but I have uploaded two gifs of my progress on that on yoyogsmes forum under and you can watch it if you lool for "Rotation of uv coordinates" in the latest post.
@@SitoKal I think you'd need to or can change alot for the effect you want. But I doubt you need to rotate the uvs. you need to rotate the distortion direction. So for each fragment find a distortion strength as a float based on the distortion maps red and green (probably no need for blue).
Let's say your shader calculates the distortion strength is 0.01. Now create a vector from that where x is the distortion strength and y is 0. Then turn that vector by the angle the current fragment is relative to the centre of the circle. Now the distortion will always be from the centre of the circle.
@@gamingreverends-devcorner1379 that sounds promisong! Thanks a lot man, you're the best 😊😊
@@gamingreverends-devcorner1379 So I have tryed this but makes strange stuff instead of going in circles if you can check it(No need to, just if you want,I understand):
·vec2 dir_to_center = vec2(in_Position.x-centro.x,in_Position.y-centro.y);
·float angle = degrees(acos(dot(normalize(vec2(1,0)),normalize(dir_to_center))));//Calculate angle between vec2"center" and "inPosition.xy" in degrees
·float distance_to_center= length(dir_to_center)/200.0;
·v_vPosition_R = (in_Position.xy + vec2(water_shift_RGB.r*distance_to_center*sin(angle), water_shift_RGB.r*distance_to_center*cos(angle))) / pattern_size; //Move anti-clockwise ·v_vPosition_G = (in_Position.xy + vec2(water_shift_RGB.g*distance_to_center*sin(angle), (water_shift_RGB.g*distance_to_center*cos(angle))) / pattern_size; //Moves clockwise ·v_vPosition_B = (in_Position.xy - vec2(0.0, water_shift_RGB.b)) / pattern_size; //Same as original
Holy cow that water looks fantastic
Thank you :)
Amazing, thanks!
Thank you as well :)
Does it work with GM 1.4, too?
That AWESOME thank you a lot for your content !
these are the best!!!!!
Thank you very much :)
any suggestions on how to do a top-down one?
As always, thank you so much for another beautiful tutorial! How would you suggest to make a water shader for a top-down view game? Would it be better to apply the shader on a tileset layer or have objects drawing the area where there should be water with the shader?
Really great looking shader but the sliders make it a bit confusing to follow for me
Are you using a different camera in GMS?
very rarely and never in this shder series
@@gamingreverends-devcorner1379 when I have the camera zoomed in the reflection moves from directly below to the left or right side
@@Chickfilae Unfortunately I don't have a solution for you since I don't have time to code one. you need to figuere out where in the drawing and/or shader code you need to apply the camera zoom factor and maybe the cameras position.
Can you do a motion blur shader next? it seems no one else has yet
At the moment I have no plans to return to blur shaders. but if you watch all the blur videos in this series you should be able to create motion blur and radial blur without a problem really - so just stat creating one :)
Do you have a yyz files with all these shaders and not just the base ones?
Wait nvm
walter
@@ChrisPriceMusicSamples guess you found it then :)