Fluid Dynamics - GM Studio 1


Contact Publisher


This is the GM Studio 1 version of Fluid Dynamics. Click here for the GM Studio 2 version.

Click here to download a demo

Forum thread

This asset provides you with realistic fluid simulation and visualization for your games. It includes a guide, a well-commented example, and documentation for each script making it easy to implement it into your game. The physics and visualization are done with shaders, making the fluid simulation very fast. The asset is highly customizable, letting you tweak the fluids extensively. It can be used to simulate fire, smoke, gas, dye, dust, wind, water droplets, cloud formation, and much more. Development and testing has only been done with the windows VM target and the windows YYC target, you might run into problems if you use this asset with other targets.


  • Can simulate fire, smoke, gas, dye, dust, wind, water droplets, cloud formation, and much more.
  • Using new mathematics from 2014 making fluid simulation faster than ever before.
  • Instances can be pushed around by the velocity field of the simulation.
  • Custom collision masks from sprites and surfaces.
  • Can be tweaked to imitate versions of explosions and tornadoes.
  • 9 different example implementations of fluids.
  • Can be used in small, large and infinite game worlds.
  • Everything is highly customizable, built on top of a fundamental fluid simulation.
  • Custom shaders.
  • Choose between two shader languages, HLSL 9 and GLSL ES.
  • A guide for implementation.
  • Commented and organized code.
  • Fast and optimized, made with efficiency in mind.
  • Custom time step.
  • Customizable acceleration equation.
  • Optional dissipation of fluid velocity and material.
  • All in GML, HLSL 9, and GLSL ES.

Note: You might run into some shader errors after importing the asset due to a GameMaker marketplace import bug, but this can easily be solved by following the instructions in the "readme" script provided with the asset.

End User Licence Agreement (EULA).

Changes in 1.3.3

Fixed a bug in the internal fd_x and fd_y scripts.

Version 1.3.3. Published February 9, 2018

Created with GameMaker: Studio v1.4.1772

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Steven R 17 February 2018


This is an amazing asset. Well-documaneted code. Great examples where you can easily adjust several parameters that affect the properties of the fluid in real time. Can't wait to get this implemented in some of my apps!

Update: I am disappointed that implementation into Android is not seamless. I'm guessing that the shaders don't quite work the same way. The velocity surface has a tendancy of moving everything towards to the top left corner of the screen. Granted, the author did state that the asset was only tested on Windows, but I'm wondering if this is code for "Doesn't really work well on other platforms." My exctement level to use this asset has dropped a few notches. (Although I can't bring myself to lower my rating of 5 stars.)


Mytino (Publisher) 30 September 2017

Thank you for the great review.

I assume you are the one who sent the email about this issue not too long ago. It seems like the graphics related code doesn't work as intended on Android. What I meant in the asset description is that I only made sure it worked well on the Windows VM target and the Windows YYC target, and that I didn't test the asset on other targets. I have updated the descriptions to better state this.


Constantin G 02 June 2017

Fantastic effect

The effect is really fantastic and can be set up in half an hour or less. Really great stuff, thanks a lot!

This review was left for a previous version of this asset.


Alex M 11 May 2017

Amazing! GMS2 Incompatible at the moment.

I mean its the best 2D fluid dynamics you will find anywhere. Would love to have this working in GMS 2!!

This review was left for a previous version of this asset.


Mytino (Publisher) 17 May 2017

Thank you. A GM Studio 2 version is now available at https://marketplace.yoyogames.com/assets/5402/fluid-dynamics-gm-studio-2.


Bridie D 26 April 2017


This is a very cool asset that is really well documented, so it's pretty easy to get up and running! I also had a little problem, and the dev responded to me very quickly and was really helpful! I thoroughly recommend this :)

This review was left for a previous version of this asset.


Cem B 01 April 2017


Dude! What magic is this? I don't need it but still bought it to support the dev. Good job.

This review was left for a previous version of this asset.


Gilles P 31 March 2017

Amazing stuff Expert Level Asset

It took me 1 hour to import the asset, first fix the shader type as per instructions and then copy and simplify every bit of code for the effect I wanted from the main demo object to my own simpler controller. I would give a -1 for the huge demo object BUT +1 for how easy it was to navigate my way through, finding each case statement for the demo in every event. The room end is missing a destroy BTW

I removed the unwanted arrays that obfuscated the obvious... I now have an instance for the effect I want. I tweaked the code so that I can have multiple rectangle instances, side by side, tiled through the room. Had to tweak the coord mapping code to allow x,y position other than absolute 0,0 position... Will need to also adjust for the stretching...

Anyway.. long story short, I have a start on this. took an hour to figure it out. I'll be playing with this for a few days. lots of fun ahead

This review was left for a previous version of this asset.

Package contents

Total size 119 KB

Fluid Dynamics - GM Studio 1.extension.gmx 15.7 KB Fluid Dynamics - GM Studio 1
Backgrounds Fonts Objects Rooms Scripts
fd_draw_self_to_collision_mask_surface.gml 942 Bytes fd_draw_sprite_to_collision_mask_surface.gml 1.08 KB fd_draw_surface_to_collision_mask_surface.gml 1.06 KB fd_GUIDE.gml 7.4 KB fd_README.gml 485 Bytes fd_rectangle_add_material.gml 833 Bytes fd_rectangle_add_velocity.gml 1.26 KB fd_rectangle_assure_surfaces_exist.gml 2.94 KB fd_rectangle_clear.gml 352 Bytes fd_rectangle_create.gml 2.12 KB fd_rectangle_create_view.gml 1.29 KB fd_rectangle_destroy.gml 502 Bytes fd_rectangle_draw.gml 755 Bytes fd_rectangle_draw_part.gml 3.99 KB fd_rectangle_draw_stretched.gml 844 Bytes fd_rectangle_draw_view.gml 1.13 KB fd_rectangle_enums.gml 569 Bytes fd_rectangle_get_acceleration_a.gml 232 Bytes fd_rectangle_get_acceleration_b.gml 232 Bytes fd_rectangle_get_acceleration_x.gml 232 Bytes fd_rectangle_get_acceleration_y.gml 232 Bytes fd_rectangle_get_collision_mask_sprite.gml 252 Bytes fd_rectangle_get_collision_mask_sprite_image.gml 257 Bytes fd_rectangle_get_collision_mask_surface.gml 381 Bytes fd_rectangle_get_initial_value_pressure.gml 248 Bytes fd_rectangle_get_material_dissipation_type.gml 254 Bytes fd_rectangle_get_material_dissipation_value.gml 256 Bytes fd_rectangle_get_material_height.gml 238 Bytes fd_rectangle_get_material_maccormack_weight.gml 267 Bytes fd_rectangle_get_material_surface.gml 792 Bytes fd_rectangle_get_material_time_step.gml 240 Bytes fd_rectangle_get_material_type.gml 230 Bytes fd_rectangle_get_material_width.gml 236 Bytes fd_rectangle_get_pressure_height.gml 238 Bytes fd_rectangle_get_pressure_iteration_type.gml 250 Bytes fd_rectangle_get_pressure_width.gml 236 Bytes fd_rectangle_get_repeat.gml 224 Bytes fd_rectangle_get_shader_language.gml 234 Bytes fd_rectangle_get_velocity_dissipation_type.gml 254 Bytes fd_rectangle_get_velocity_dissipation_value.gml 256 Bytes fd_rectangle_get_velocity_height.gml 238 Bytes fd_rectangle_get_velocity_maccormack_weight.gml 256 Bytes fd_rectangle_get_velocity_surface.gml 989 Bytes fd_rectangle_get_velocity_time_step.gml 240 Bytes fd_rectangle_get_velocity_width.gml 236 Bytes fd_rectangle_get_visualization_shader.gml 244 Bytes fd_rectangle_inherit_velocity.gml 1.38 KB fd_rectangle_material_surface_was_created.gml 563 Bytes fd_rectangle_replace_material.gml 837 Bytes fd_rectangle_replace_material_advanced.gml 852 Bytes fd_rectangle_replace_velocity.gml 1.26 KB fd_rectangle_reset_target.gml 1.01 KB fd_rectangle_set_acceleration.gml 1.84 KB fd_rectangle_set_collision_mask_sprite.gml 813 Bytes fd_rectangle_set_collision_mask_surface.gml 493 Bytes fd_rectangle_set_initial_value_pressure.gml 495 Bytes fd_rectangle_set_material_dissipation_type.gml 864 Bytes fd_rectangle_set_material_dissipation_value.gml 473 Bytes fd_rectangle_set_material_maccormack_weight.gml 848 Bytes fd_rectangle_set_material_size.gml 691 Bytes fd_rectangle_set_material_time_step.gml 526 Bytes fd_rectangle_set_material_type.gml 819 Bytes fd_rectangle_set_pressure_iteration_type.gml 2.79 KB fd_rectangle_set_pressure_size.gml 613 Bytes fd_rectangle_set_repeat.gml 389 Bytes fd_rectangle_set_shader_language.gml 3.37 KB fd_rectangle_set_target.gml 2.93 KB fd_rectangle_set_velocity_dissipation_type.gml 965 Bytes fd_rectangle_set_velocity_dissipation_value.gml 477 Bytes fd_rectangle_set_velocity_maccormack_weight.gml 708 Bytes fd_rectangle_set_velocity_size.gml 613 Bytes fd_rectangle_set_velocity_time_step.gml 561 Bytes fd_rectangle_set_visualization_shader.gml 1.33 KB fd_rectangle_shift_content.gml 1.45 KB fd_rectangle_update.gml 286 Bytes fd_rectangle_update_material.gml 10.9 KB fd_rectangle_update_velocity.gml 6.17 KB fd_rectangle_update_view.gml 694 Bytes fd_x.gml 204 Bytes fd_y.gml 204 Bytes
sh_fd_add_velocity_glsl.shader 1.22 KB sh_fd_add_velocity_hlsl.shader 1.53 KB sh_fd_advect_material_a_16_glsl.shader 2.93 KB sh_fd_advect_material_a_16_hlsl.shader 3.13 KB sh_fd_advect_material_a_8_glsl.shader 2.61 KB sh_fd_advect_material_a_8_hlsl.shader 2.82 KB sh_fd_advect_material_rgba_16_glsl.shader 3.19 KB sh_fd_advect_material_rgba_16_hlsl.shader 3.4 KB sh_fd_advect_material_rgba_8_glsl.shader 2.65 KB sh_fd_advect_material_rgba_8_hlsl.shader 2.83 KB sh_fd_advect_velocity_0_glsl.shader 3.23 KB sh_fd_advect_velocity_0_hlsl.shader 3.42 KB sh_fd_advect_velocity_1_glsl.shader 3.39 KB sh_fd_advect_velocity_1_hlsl.shader 3.57 KB sh_fd_calculate_pressure_jacobi_glsl.shader 1.43 KB sh_fd_calculate_pressure_jacobi_hlsl.shader 1.6 KB sh_fd_calculate_pressure_srj_glsl.shader 1.65 KB sh_fd_calculate_pressure_srj_hlsl.shader 1.83 KB sh_fd_calculate_velocity_divergence_glsl.shader 1.27 KB sh_fd_calculate_velocity_divergence_hlsl.shader 1.48 KB sh_fd_example_create_acceleration_field.shader 488 Bytes sh_fd_replace_material_advanced_glsl.shader 853 Bytes sh_fd_replace_material_advanced_hlsl.shader 1.14 KB sh_fd_subtract_pressure_gradient_glsl.shader 1.59 KB sh_fd_subtract_pressure_gradient_hlsl.shader 1.77 KB sh_fd_visualize_colorize_glsl.shader 652 Bytes sh_fd_visualize_colorize_hlsl.shader 864 Bytes sh_fd_visualize_pixel_art_fiery_smoke_glsl.shader 1.03 KB sh_fd_visualize_pixel_art_fiery_smoke_hlsl.shader 1.24 KB sh_fd_visualize_pixel_art_fire_glsl.shader 984 Bytes sh_fd_visualize_pixel_art_fire_hlsl.shader 1.17 KB sh_fd_visualize_pressure_glsl.shader 697 Bytes sh_fd_visualize_pressure_hlsl.shader 907 Bytes sh_fd_visualize_thick_smoke_glsl.shader 1.66 KB sh_fd_visualize_thick_smoke_hlsl.shader 1.82 KB sh_fd_visualize_velocity_divergence_glsl.shader 780 Bytes sh_fd_visualize_velocity_divergence_hlsl.shader 992 Bytes sh_fd_visualize_velocity_glsl.shader 2.39 KB sh_fd_visualize_velocity_hlsl.shader 2.61 KB
spr_fd_example_button_change_room.sprite.gmx 701 Bytes spr_fd_example_button_dissipation_type.sprite.gmx 786 Bytes spr_fd_example_circle_gradient.sprite.gmx 698 Bytes spr_fd_example_circle_gradient_large.sprite.gmx 706 Bytes spr_fd_example_circle_gradient_small.sprite.gmx 704 Bytes spr_fd_example_dropdown.sprite.gmx 758 Bytes spr_fd_example_fluid_collision_mask_big.sprite.gmx 709 Bytes spr_fd_example_fluid_collision_mask_normal.sprite.gmx 884 Bytes spr_fd_example_initial_material.sprite.gmx 704 Bytes spr_fd_example_leaf.sprite.gmx 687 Bytes spr_fd_example_slider.sprite.gmx 1.05 KB spr_fd_example_text.sprite.gmx 693 Bytes spr_fd_example_toggle_box.sprite.gmx 899 Bytes images

What is the issue?

Back to Top