M
MirthCastle
Guest
Hey All,
I have been trying to recreate the MoonLighter night cycle in GMS - I think I am CLOSE - but not quite there... I'm missing something i can't put my finger on... My goal is to have a dynamic day-night cycle - where the nighttime ends up looking like Moonlighter.
Please See Moonlighter:
https://dl.dropboxusercontent.com/s/iea6qbtti4r5asb/SNAG_0000_1155.mp4
There is a few things happening in that scene -
#1 - The glowy multilayer lights - got-em - though my colors are off it seems
#2 - the "Inner glow" of the multilayer lights - dont-got-em (help)
#3 - Fireflies - don't-got-em (yet) - I think they really make the scene!
#4 - Nighttime ambient light - got-it - but not well (help)
Here is my scene:
https://dl.dropboxusercontent.com/s/7ogecvum4wnrch7/SNAG_0000_0001.mp4
I can't quite put my finger on it - Notice how mine has the blue - but it seems exactly like I just put a layer above the world colored blue with alpha lolol - ?
Q: What is happening in MoonLighter where theirs doesn't look like that???
One theory I have is they are using separate "nighttime" sprites that have the dark blue hue to them.
If they are - is there a way we can manipulate the scene to "recolor" all the sprites into a nighttime version? This would make it so there isn't a need for an overlay surface - then i could just add the lights to a layer above and call it woot!
If it HAS to be a different sprite - I would also like to be able to re-render all my sprites with the correct hue and save the sprite.. can you help me produce this with gamemaker to batch recolor?
Can you have a look at my shader and process and suggest improvements? I would like to get as close to the Moonlighter scene as possible? Help a brother out?
////Making the surface (I didn't stop here - this is where I have ended up - maybe I need a better blend-mode? Ive tried Subtracting, Max, Add - etc
/// @desc Make Surface
if ( surface_exists(skySurf) ) {
///Shader (here i'm just using the additive method for the surface, then setting alpha based on how white it ends up - I am also coloring the light and the world based on the white-to-black
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
For the lights - I am using a simple 35% grey circle to achieve the layers themselves
I have been trying to recreate the MoonLighter night cycle in GMS - I think I am CLOSE - but not quite there... I'm missing something i can't put my finger on... My goal is to have a dynamic day-night cycle - where the nighttime ends up looking like Moonlighter.
Please See Moonlighter:
https://dl.dropboxusercontent.com/s/iea6qbtti4r5asb/SNAG_0000_1155.mp4
There is a few things happening in that scene -
#1 - The glowy multilayer lights - got-em - though my colors are off it seems
#2 - the "Inner glow" of the multilayer lights - dont-got-em (help)
#3 - Fireflies - don't-got-em (yet) - I think they really make the scene!
#4 - Nighttime ambient light - got-it - but not well (help)
Here is my scene:
https://dl.dropboxusercontent.com/s/7ogecvum4wnrch7/SNAG_0000_0001.mp4
I can't quite put my finger on it - Notice how mine has the blue - but it seems exactly like I just put a layer above the world colored blue with alpha lolol - ?
Q: What is happening in MoonLighter where theirs doesn't look like that???
One theory I have is they are using separate "nighttime" sprites that have the dark blue hue to them.
If they are - is there a way we can manipulate the scene to "recolor" all the sprites into a nighttime version? This would make it so there isn't a need for an overlay surface - then i could just add the lights to a layer above and call it woot!
If it HAS to be a different sprite - I would also like to be able to re-render all my sprites with the correct hue and save the sprite.. can you help me produce this with gamemaker to batch recolor?
Can you have a look at my shader and process and suggest improvements? I would like to get as close to the Moonlighter scene as possible? Help a brother out?
////Making the surface (I didn't stop here - this is where I have ended up - maybe I need a better blend-mode? Ive tried Subtracting, Max, Add - etc
/// @desc Make Surface
if ( surface_exists(skySurf) ) {
surface_set_target(skySurf);
draw_clear_alpha(c_black, 1);
with ( obj_light ) {
surface_reset_target();
} else {draw_clear_alpha(c_black, 1);
with ( obj_light ) {
gpu_set_blendmode(bm_add);
draw_sprite_ext(spr_gradient3, -1, x, y, scale2, scale2, 0, c_white, 1);
draw_sprite_ext(spr_gradient3, -1, x, y, scale1, scale1, 0, c_white, 1);
gpu_set_blendmode(bm_normal);
}draw_sprite_ext(spr_gradient3, -1, x, y, scale2, scale2, 0, c_white, 1);
draw_sprite_ext(spr_gradient3, -1, x, y, scale1, scale1, 0, c_white, 1);
gpu_set_blendmode(bm_normal);
surface_reset_target();
skySurf = surface_create(room_width,room_height);
}///Shader (here i'm just using the additive method for the surface, then setting alpha based on how white it ends up - I am also coloring the light and the world based on the white-to-black
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 colour = texture2D( gm_BaseTexture, v_vTexcoord );
float total = ( colour.r + colour.g + colour.b ) / 3.0;
colour.a = clamp(colour.a - total, 0.15, 0.7);
gl_FragColor = colour;
}float total = ( colour.r + colour.g + colour.b ) / 3.0;
colour.r = mix(16.0 / 255.0, 224.0 / 255.0, total );
colour.g = mix(16.0 / 255.0, 128.0 / 255.0, total );
colour.b = mix(64.0 / 255.0, 0.0 / 255.0, total );
colour.g = mix(16.0 / 255.0, 128.0 / 255.0, total );
colour.b = mix(64.0 / 255.0, 0.0 / 255.0, total );
colour.a = clamp(colour.a - total, 0.15, 0.7);
gl_FragColor = colour;
For the lights - I am using a simple 35% grey circle to achieve the layers themselves
Last edited by a moderator: