flyingsaucerinvasion
Member
Last edited:
I'm probably your biggest fan xD
Dude that looks sick as! What's next, full on nebulas?Everything I work on seems to be related to space somehow.
I was working on some 3d starfields yesterday. Since then I thought of a couple of ways of improving upon it.
https://gfycat.com/SpectacularFlawlessHoneycreeper < video
View attachment 21663
Nebulas would be neat, but I can't think of a way around needing each nebular particle to be depth sorted every frame. And then that would cause the star "flares" to need to be done differently as well.Dude that looks sick as! What's next, full on nebulas?
What if they were parallax 2D?Nebulas would be neat, but I can't think of a way around needing each nebular particle to be depth sorted every frame. And then that would cause the star "flares" to need to be done differently as well.
Actually, that gave me an interesting idea, but it would only work for very distant nebulas... farther than any stars (otherwise the star flares would still need to be done differently).What if they were parallax 2D?
Wow, I commend you for your bravery.. No dude, I'm serious! You might have meant it as a sly joke, but I'm serious! ing respect! Most people try to escape themselves, and knowing myself, I see why.. Keep on working friend!I'm currently working on myself.
I would really like to know how you did the parralax effect, and did you add the blur to the background with a shader or in photoshop?1. Coming to realization that I can't design/implement deep gameplay mechanics.
2. Fine-tweaking my rendering functions so I can get started on an exploration platformer instead. More emphasis on narrative/exploration/visual, than on mechanics.
All shaders and surfaces. The tile assets in the background are the exact same as used in the foreground. I can't run the game right now since a GMS update broke how I was using surfaces (again), but I can try and explain it anyway with images and code.I would really like to know how you did the parralax effect, and did you add the blur to the background with a shader or in photoshop?
//temporarily enable texture filtering
gpu_set_texfilter(true);
//draw background
surface_set_target(surface_canvas_1);
draw_tilemap(layer_background_tilemap,(0-cam_x), (0-cam_y));
draw_tilemap(layer_back_tilemap, 48-cam_x, 24-cam_y);
draw_sprite_ext(fog, 0, 0, 0, 3, 3, 0, c_white, fog_density); //fog
surface_reset_target();
//apply shader to background
surface_set_target(surface_canvas_2);
shader_set(shd_blur_gaussian);
shader_set_uniform_f(uRESOLUTION,600, 400);
shader_set_uniform_f(uRADIUS,blur_far);
draw_surface_ext(surface_canvas_1, 0, 0, 0.85, 0.85, 0, c_white, 1); //0.85
shader_reset();
surface_reset_target();
//draw middle
surface_set_target(surface_canvas_1);
draw_surface(surface_canvas_2, 0, 0);
draw_tilemap(layer_middle_tilemap, (0-cam_x)+6, (0-cam_y)+6);
//gpu_set_blendmode(bm_add);
draw_sprite_ext(fog, 0, 0, 0, 3, 3, 0, c_white, fog_density); //fog
draw_surface(global.layer_middle_instances_surface, 0, 0);
//gpu_set_blendmode(bm_normal);
surface_reset_target();
//apply shader to middle
surface_set_target(surface_canvas_2);
shader_set(shd_blur_gaussian);
shader_set_uniform_f(uRESOLUTION,600, 400);
shader_set_uniform_f(uRADIUS,blur_close);
draw_surface_ext(surface_canvas_1, 0, 0, 0.95, 0.95, 0, c_white, 1); //0.95
shader_reset();
surface_reset_target();
//re-disable texture filtering
gpu_set_texfilter(false);
//draw foreground
surface_set_target(surface_canvas_0);
draw_surface(surface_canvas_2, 0, 0);
draw_tilemap(layer_front_tilemap, 0-cam_x, 0-cam_y);
draw_surface(global.layer_instances_surface, 0, 0);
surface_reset_target();
Thanks for explaining! I once wrote a blur shader from Xor's tutorials, but that one was highly inefficient, and not nearly als good looking as your blur. The parallax effect reminds me of hollow knightAll shaders and surfaces. The tile assets in the background are the exact same as used in the foreground. I can't run the game right now since a GMS update broke how I was using surfaces (again), but I can try and explain it anyway with images and code.
There are three tile layers. The extreme background, the middle background, and the foreground. I use a rendering control object top do everything, and render the layers in a back-to-front order. And only the view, not the room. I juggle quite a few surfaces, and I havent worked on this project in quite a while, so I forget some details on how I made it happen.
1. Draw everything in the extreme background to 1 surface.Tiles (using draw_tilemap). Also draw other stuff like slight translucent coloration for a fog effect.
Some other details, like making sure texture filtering is on for the first few steps (because I turn it off later). And you'll notice I juggle between surface_canvas_1/2 a lot. Drawing from 1 to 2 or 2 to 1 is a lot safer than a surface drawing to itself. There is also some offsetting that I need for parallax later on, hence the -48 and -24 offset on that one line.
2. Apply a strong blur shader to the surface. Forget which shader it is exactly, I found it on the marketplace.Code://temporarily enable texture filtering gpu_set_texfilter(true); //draw background surface_set_target(surface_canvas_1); draw_tilemap(layer_background_tilemap,(0-cam_x), (0-cam_y)); draw_tilemap(layer_back_tilemap, 48-cam_x, 24-cam_y); draw_sprite_ext(fog, 0, 0, 0, 3, 3, 0, c_white, fog_density); //fog surface_reset_target();
This is also where the actual parallax happens. The line with //0.85 is where I'm redrawing the extreme background surface to the middle background, but with a scaling of 0.85. And because I did an offset of -48/-24 to the tilemap coords earlier, it's "recentered". Also, because I'm shrinking backgrounds, I have to make my background surfaces larger than my foreground surfaces, so that the edges of the backgrounds abruptly cut. My view is 480x270, but some of my surfaces are 600x400 so I can have that extra breathing room when scaling them.
3. Draw everything in the middle background to 2 surfaces.Tiles (using draw_tilemap) to one surface, and objects (using layer_script_begin/end and a custom draw event in those scripts to another surface, using event_type ev_draw). I didn't have any objects in the extreme background because I saw little point. Also do the blur and parallax again.Code://apply shader to background surface_set_target(surface_canvas_2); shader_set(shd_blur_gaussian); shader_set_uniform_f(uRESOLUTION,600, 400); shader_set_uniform_f(uRADIUS,blur_far); draw_surface_ext(surface_canvas_1, 0, 0, 0.85, 0.85, 0, c_white, 1); //0.85 shader_reset(); surface_reset_target();
4. Here I redisable texture filtering because I'm about to draw the foreground, and I want those foreground pixels sharp. No scaling or blur here.Code://draw middle surface_set_target(surface_canvas_1); draw_surface(surface_canvas_2, 0, 0); draw_tilemap(layer_middle_tilemap, (0-cam_x)+6, (0-cam_y)+6); //gpu_set_blendmode(bm_add); draw_sprite_ext(fog, 0, 0, 0, 3, 3, 0, c_white, fog_density); //fog draw_surface(global.layer_middle_instances_surface, 0, 0); //gpu_set_blendmode(bm_normal); surface_reset_target(); //apply shader to middle surface_set_target(surface_canvas_2); shader_set(shd_blur_gaussian); shader_set_uniform_f(uRESOLUTION,600, 400); shader_set_uniform_f(uRADIUS,blur_close); draw_surface_ext(surface_canvas_1, 0, 0, 0.95, 0.95, 0, c_white, 1); //0.95 shader_reset(); surface_reset_target();
There's other stuff after this, such as a color remap shader and vignetting. I remember taking this a few weeks to figure out. And a lot of experimentation. A number of other unrelated things going on, such as adding tile variation at runtime with a script.Code://re-disable texture filtering gpu_set_texfilter(false); //draw foreground surface_set_target(surface_canvas_0); draw_surface(surface_canvas_2, 0, 0); draw_tilemap(layer_front_tilemap, 0-cam_x, 0-cam_y); draw_surface(global.layer_instances_surface, 0, 0); surface_reset_target();
I like the scaling method for parallax better than just scrolling, because then I can use tiles for the background.
Obviously this won't work as a straight copy-paste, since there's the create/step events and a myriad of other scripts related to layer_script_begin/end, and because it's been so long, I don't remember exactly how much of it I hard-coded and how much I streamlined into scripts. But hopefully this can give you ideas.
Hollow Knight was my direct inspiration for this!Thanks for explaining! I once wrote a blur shader from Xor's tutorials, but that one was highly inefficient, and not nearly als good looking as your blur. The parallax effect reminds me of hollow knight
I read that the parallax effect inhollow knight is direct result of using a perspective camera in a 2D enviroment.Hollow Knight was my direct inspiration for this!
This. I want. This is retro done right.Don't have any screenshot yet but i'm working on a 'Fly Harder' clone:
Always wanted to do that kind of game.
I love it, name of your game and where can i play it please =)Chunky pixels! Buckets of fun, chunky pixels! 8-bit looove.
Dude, that's awesome!I've just retaken the Alex Kidd Tribute I started some months ago
I did more work in pixelart than programming platform mechanics and now I'm willing to make the whole first level even if I must use the original sprites for enemies.
Woah! Directional lights included or fake? Amazing!
Working on a 3D engine for GMS2.
Everything you see there is real. Nothing is pre baked.Woah! Directional lights included or fake? Amazing!
Hahaha amazing. It's funny you posted that because I'm actually working on my icon right now. Was thinking something like this: