D
Drenathor
Guest
What I'm trying to achieve:
I want to make a waterfall object which applies a shader to everything appearing under it so that tiles, assets and objects occluded (even partially) would have a distortion applied.
What I'm Doing:
I'm creating a new surface for the waterfall, copying the area directly behind it from the application_surface and then applying the shader to that surface.
My Issues:
However I have 2 issues, first is that when my viewport height and width are not the same as my camera height and width the data copied from the application surface is 2x the size I would expect causing it to appear zoomed in. - edit this is solved now
The second and this appears to be specific to game maker studio 2 is that my application surface appears to be mirrored. I've run some test code in both Studio 1 and Studio 2 to show the difference:
Studio 1 (notice how the reflection is facing the same direction)
Studio 2 (notice how the reflection is backwards)
The Creation Code:
The Draw End Code:
Any help would be really appreciated
P.S. My Camera is 480x270 and my viewport is 960x540
I want to make a waterfall object which applies a shader to everything appearing under it so that tiles, assets and objects occluded (even partially) would have a distortion applied.
What I'm Doing:
I'm creating a new surface for the waterfall, copying the area directly behind it from the application_surface and then applying the shader to that surface.
My Issues:
The second and this appears to be specific to game maker studio 2 is that my application surface appears to be mirrored. I've run some test code in both Studio 1 and Studio 2 to show the difference:
Studio 1 (notice how the reflection is facing the same direction)
Studio 2 (notice how the reflection is backwards)
The Creation Code:
Code:
globalvar water_surface;
water_surface = surface_create( sprite_get_width(sprite_index), sprite_get_height(sprite_index));
Code:
// 2x what I want it to be in both Studio 1 & 2 and reversed in Studio 2
surface_copy_part( water_surface, 0, 0, application_surface, x, y, 81, 81 );
// this is wrapped in my shader code
draw_surface( water_surface, x, y );
// I've got an empty draw statement to prevent this from being drawn 2x.
draw_sprite( spr_waterfall, 0, x, y );
P.S. My Camera is 480x270 and my viewport is 960x540
Last edited by a moderator: