V
Vṛka Majjā
Guest
Hey, guys. I was wondering if anybody has some motion blur scripts or shaders to blur everything visible. I can script code to motion blur individual objects and it looks great, but I'd love to see it all blur.
sp_old = -1
if keyboard_check(vk_left){
sp_old = sprite_create_from_surface(application_surface,0,0,view_wport[0],view_hport[0],0,0,0,0);
}
if(sprite_exists(sp_old))
{
shader_set(shd_mb); //motion blur shader
draw_sprite(sp_old, 0, 0, 0)
shader_reset();
}
depth = -99
sp_old = -1 //sprite_create_from_surface(application_surface,0,0,room_width,room_height,0,1,room_width/2,room_height/2);
vis = 0;
visible = vis
game_w_start = 1536
game_h_start = 864
display_set_gui_size(game_w_start, game_h_start); //fixed
window_set_size(game_w_start, game_h_start); //fixed
surface_resize(application_surface, game_w_start/4, game_h_start/4); //native resolution
if keyboard_check_pressed(vk_left){
//sp_old = sprite_create_from_surface(application_surface,0,0,view_wport[0],view_hport[0],0,0,0,0);
vis = !vis
}
visible = vis
//if(sprite_exists(sp_old))
{
shader_set(shd_mb); //motion blur shader
//draw_sprite(sp_old, 0, 0, 0)
draw_surface(application_surface, 0, 0)
shader_reset();
}
which was basically echoing what OP said:Am able to get motion blur for individual objects, but don't know how to apply it to the whole screen.
I could have a small handful of objects and apply the motion blur to them via a parent, no issues. But there are countless highly complex objects that are parented to another object, which in turn is a child to another grandparent object. I don't think it'd be wise to have a motion blur parent object added in this chain of inheritance since one would have to then keep track of this at all times and doing so for many objects is not feasible I think (at least until GMS allows multiple parents without grandparenting). This is why I was looking to apply the effect to the whole screen to capture literally every instance in the game that is currently being rendered on the screen, but do so below the HUD (which would be drawn via Draw GUI).Hey, guys. I was wondering if anybody has some motion blur scripts or shaders to blur everything visible. I can script code to motion blur individual objects and it looks great, but I'd love to see it all blur.
if keyboard_check(vk_left)
{global.Moving = true}
else
{global.Moving = false}
You can replace this entire thing withif keyboard_check(vk_left) {global.Moving = true} else {global.Moving = false}
global.Moving = keyboard_check(vk_left);
. Booleans are booleans.