Asset - Extension Water Physics - GM Studio 2 and 1

Dragon47

Member


Download demo: https://goo.gl/EALvdu


There's also a simplified demo: https://goo.gl/o3nMb6
This lets you see your highest FPS potential. It's recommended that you download the other demo first.


Marketplace link: https://marketplace.yoyogames.com/assets/4795/water-physics

This asset provides you with realistic water physics and water visualization for your 2D game. 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 water simulation very fast. You can have more than a million blocks of water simulated simultaneously with great frame rates. The asset is highly customizable, letting you tweak the water extensively.

The asset is compatible with GM Studio 2 and GM Studio 1.

Features:
  • Water currents (water can push objects around).
  • Water pressure (water can be pushed up through e.g. pipes).
  • Highly customizable reflections (reflections are optional in case you prefer no reflections).
  • Light source reflection (letting e.g. the sun and moon have longer reflections in water).
  • Textured water.
  • Adjustable colors (for water bodies, water surfaces, and falling water).
  • Refraction (making the water's background look distorted through the water).
  • Reflection displacement (different types of distortions to apply to reflections).
  • Customizable waves.
  • Waterfalls.
  • Four gravity directions.
  • Choose between two shader languages (if you're using GM Studio 1), HLSL 9 and GLSL ES. GM Studio 2 has GLSL ES only.
  • Reading/writing of volume and velocity, allowing e.g. a player to swim and splash the water around.
  • Reading of pressure (e.g. to damage a player if he has dived too deep without diving equipment).
  • Synchronization system between GPU memory and RAM.
  • Saving/loading of water from files.
  • A guide for implementation.
  • Commented and organized code.
  • Fast and optimized, made with efficiency in mind.
  • Supports logic and display separation.
  • Irrespective of room speed, dependent on delta_time (and easily convertable to other game loops if need be).
  • All in GML and GLSL ES, and HLSL 9 if you're using GM Studio 1.
Note: You might run into some shader errors after importing the asset in GM Studio 1 due to a GameMaker marketplace import bug, but this can easily be solved by following the instructions in the "before you start" section of the "guide" script provided with the asset.

Gifs and screenshots:











 
Last edited:

Conbeef

Member
Code:
___________________________________________
############################################################################################
FATAL ERROR in Fragment Shader compilation
ShaderName: sh_wp_update_1_down_hlsl_9

C:\Users\DAnzo\AppData\Local\Temp\IXP000.TMP\memory(31,9): error X5608: Compiled shader code uses too many arithmetic instruction slots (159). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (171). Max. allowed by the target (ps_2_0) is 96.

at gml_Script_wp_rectangle_update_simulation
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_wp_rectangle_update_simulation (line 0)
gml_Object_obj_example_main_Step_0
RIP my wait. Is there anyway I can fix this? I'm already up to date with directX(so the installer says).
 

Dragon47

Member
Code:
___________________________________________
############################################################################################
FATAL ERROR in Fragment Shader compilation
ShaderName: sh_wp_update_1_down_hlsl_9

C:\Users\DAnzo\AppData\Local\Temp\IXP000.TMP\memory(31,9): error X5608: Compiled shader code uses too many arithmetic instruction slots (159). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (171). Max. allowed by the target (ps_2_0) is 96.

at gml_Script_wp_rectangle_update_simulation
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_wp_rectangle_update_simulation (line 0)
gml_Object_obj_example_main_Step_0
RIP my wait. Is there anyway I can fix this? I'm already up to date with directX(so the installer says).
It looks like you have quite an old shader model. I uploaded an exe that uses GLSL ES instead of HLSL 9. Can you try to run that one and post the error if you still get one?

Edit: If it doesn't work I can try to make an option to split up shaders to get less instructions per shader, but this will probably be slightly slower on the performance side.
 
Last edited:

Conbeef

Member
Code:
############################################################################################
FATAL ERROR in Fragment Shader compilation
ShaderName: sh_wp_update_1_down_glsl_es

C:\Users\DAnzo\AppData\Local\Temp\IXP000.TMP\memory(118,4): error X5608: Compiled shader code uses too many arithmetic instruction slots (145). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (157). Max. allowed by the target (ps_2_0) is 96.

at gml_Script_wp_rectangle_update_simulation
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_wp_rectangle_update_simulation (line 0)
gml_Object_obj_example_main_Step_0
I guess my computer isn't compatible huh?
 

Dragon47

Member
Code:
############################################################################################
FATAL ERROR in Fragment Shader compilation
ShaderName: sh_wp_update_1_down_glsl_es

C:\Users\DAnzo\AppData\Local\Temp\IXP000.TMP\memory(118,4): error X5608: Compiled shader code uses too many arithmetic instruction slots (145). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (157). Max. allowed by the target (ps_2_0) is 96.

at gml_Script_wp_rectangle_update_simulation
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_wp_rectangle_update_simulation (line 0)
gml_Object_obj_example_main_Step_0
I guess my computer isn't compatible huh?
It seems like the graphics card isn't compatible. I'll try to make a compatible version later today.
 

Jaqueta

Member
I tested the Demo here, all my feedback is based on the demo, so: Don't take my word too seriously, since currently, I can't review the code.

Performance:
CPU: 4-Cores 1.8Ghz (i3-3217U)
GPU: Onboard (Intel HD 4000)
RAM: 4GB

It was playable, with reflections on, I got a stable 30 FPS, and with the reflections off, a stable 60 FPS, if you're going to implement it into your game, make sure to add an option to turn off reflections, like the demo. The other options didn't had a significant impact on performance, even refraction, nice.

My opinions based on the Demo:
The physics, are great, and the water looks gorgeous! But, due the performance on low-end computers, you might want to implement this only if it's part of the main mechanics of the game. Maybe this issue can be solved if there's a way to increase the performance by having less but bigger particles.
 

Dragon47

Member
I tested the Demo here, all my feedback is based on the demo, so: Don't take my word too seriously, since currently, I can't review the code.

Performance:
CPU: 4-Cores 1.8Ghz (i3-3217U)
GPU: Onboard (Intel HD 4000)
RAM: 4GB

It was playable, with reflections on, I got a stable 30 FPS, and with the reflections off, a stable 60 FPS, if you're going to implement it into your game, make sure to add an option to turn off reflections, like the demo. The other options didn't had a significant impact on performance, even refraction, nice.

My opinions based on the Demo:
The physics, are great, and the water looks gorgeous! But, due the performance on low-end computers, you might want to implement this only if it's part of the main mechanics of the game. Maybe this issue can be solved if there's a way to increase the performance by having less but bigger particles.
Thank you for the feedback. The reflections are relatively efficient as there's no raytracing going on, but I can see how it can impact low-end computers. Making the particles bigger will make the physics simulation of the water faster, the particles used in the demo are 8x8 px, but e.g. 16x16 px works as well. For even higher performance, there are several "#define"s around in the shader code that can be used to enable and disable certain features like e.g. the white gradient at the surface of the water, surface waves, and the waterfall texture. It could probably be made faster for low-end computers by disabling a few visual features. I might add a low-end demo to the thread later today.
 

makas

Member
I will probably buy this, I have been following this project for some time now :) it looks amazing I just still want some gameplay examples with of course water interactions good work!
 

Dragon47

Member
I will probably buy this, I have been following this project for some time now :) it looks amazing I just still want some gameplay examples with of course water interactions good work!
Thank you! The example code already cover several types of interactions with water. Do you have any specific gameplay examples you want to see?
 

Jaqueta

Member
Nice.
Also, I noticed a couple nice features within the demo as well, such as a lighting system, autotiling, and the tilesets themselves look great. I suppose that the Demo Source is included in the asset right? That's pretty awesome.

I tested the Demo now in my actual PC, and the performance was pretty good!
Here are the results if anyone is interested:
PC Specs:
CPU: i5 760 2.80Ghz
GPU: MSI GeForce GTX 960 2GD5T OC
RAM: 4GB DDR3 1333hz

FPS with reflections: ~930
FPS without reflections: ~1145
FPS without anything: ~1182

FPS on simplified demo: from ~1900 to ~2100

Budget Laptop Specs:
CPU: i3-3217U 4-Cores 1.8Ghz
GPU: Onboard (Intel HD 4000)
RAM: 4GB DDR3

FPS with reflections: ~30
FPS without reflections: ~56
FPS without anything: ~60

FPS on simplified demo: ~110

Also, even when the level filled with water, the Frame Rate was still pretty much the same, nice.
 
Last edited:

Dragon47

Member
Nice.
Also, I noticed a couple nice features within the demo as well, such as a lighting system, autotiling, and the tilesets themselves look great. I suppose that the Demo Source is included in the asset right? That's pretty awesome.

I tested the Demo now in my actual PC, and the performance was pretty good!
Here are the results if anyone is interested:
PC Specs:
CPU: i5 760 2.80Ghz
GPU: MSI GeForce GTX 960 2GD5T OC
Ram: 4GB DDR3 1333hz

FPS with reflections: ~930
FPS without reflections: ~1145
FPS without anything: ~1182

Also, even when the level filled with water, the Frame Rate was still pretty much the same, nice.
Yes, they're included. Thank you for the results.

I've edited the main topic to include a simplified demo. You'll probably get much higher FPS with that one.
 

makas

Member
I would like to see swimming, navigation of a boat or something like that :) are those possible with your engine?
 

Dragon47

Member
I would like to see swimming, navigation of a boat or something like that :) are those possible with your engine?
They're both possible. Swimming is already part of the example. There's a variable in the example code which says if the player is in water or not (obtained from one of the scripts), you can use that to switch between your own custom swimming mechanics (if in water) and walking mechanics (if not in water). Navigation of a boat can be done in a similar way. If you have a boat object you can check if the boat is in water, and if it is just let it float upward until it's not in water anylonger. It will end up floating on the water's surface. And you can have the boat sprite slightly offset down into the water so that it looks like the bottom part of the boat is under water. Controlling it right and left is similar to normal movement code.
 

JaimitoEs

Member
Is maded with grid cells? Surely yes but, if is compatible with physics fixtures or poligons :



If is not compatible, SHUT UP AND TAKE MY MONEY ANYWAY!!
 
Last edited:

Dragon47

Member
Is maded with grid cells? Surely yes but, if is compatible with physics fixtures or poligons :



If is not compatible, SHUT UP AND TAKE MY MONEY ANYWAY!!
x) The water is not directly compatible with physics fixtures or poligons, but if you know what you're doing you might be able to do some trickery to make the two work together.
 

Dragon47

Member
Code:
############################################################################################
FATAL ERROR in Fragment Shader compilation
ShaderName: sh_wp_update_1_down_glsl_es

C:\Users\DAnzo\AppData\Local\Temp\IXP000.TMP\memory(118,4): error X5608: Compiled shader code uses too many arithmetic instruction slots (145). Max. allowed by the target (ps_2_0) is 64.
(1,1): error X5609: Compiled shader code uses too many instruction slots (157). Max. allowed by the target (ps_2_0) is 96.

at gml_Script_wp_rectangle_update_simulation
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_wp_rectangle_update_simulation (line 0)
gml_Object_obj_example_main_Step_0
I guess my computer isn't compatible huh?
I've spent several hours trying to put together a version with less instructions per shader. I managed to reduce the count in some shaders by lowering the visual quality slightly, and split up two of them so that the instructions were less than 64 and 96, but it seems like it's going to be difficult and take a really long time to do this with all of them, and I'm not even sure if it will work for you because it seems like your graphics card compiles the shaders into more instructions than my graphics card anyway, so it's difficult to know if the instruction count would be less than 64 and 96 for you too. If you have another computer or laptop close by there's a good chance the asset will work on that one. And I'm pretty sure you don't need a new computer to run this, just a new graphics card, and it doesn't have to be an expensive graphics card, just one that's a bit more up to date.
 

Galladhan

Member
And I'm pretty sure you don't need a new computer to run this, just a new graphics card, and it doesn't have to be an expensive graphics card, just one that's a bit more up to date.
I can confirm this: i have a 7yo core 2 duo e8500 at 3.16 ghz + Ati Radeon 6870 and the demo works perfectly.

Told this, my huge compliments to @Dragon47 for this amazing asset: i'm gonna buy it as soon as i recharge my pre-paid card (probably today). I already own the autotile system (which is one of my favourite MP assets), but this water is too good, i can't resist. :D
 

Dragon47

Member
I can confirm this: i have a 7yo core 2 duo e8500 at 3.16 ghz + Ati Radeon 6870 and the demo works perfectly.

Told this, my huge compliments to @Dragon47 for this amazing asset: i'm gonna buy it as soon as i recharge my pre-paid card (probably today). I already own the autotile system (which is one of my favourite MP assets), but this water is too good, i can't resist. :D
Thank you for the compliments :) I appreciate it
 

Conbeef

Member
I've spent several hours trying to put together a version with less instructions per shader. I managed to reduce the count in some shaders by lowering the visual quality slightly, and split up two of them so that the instructions were less than 64 and 96, but it seems like it's going to be difficult and take a really long time to do this with all of them, and I'm not even sure if it will work for you because it seems like your graphics card compiles the shaders into more instructions than my graphics card anyway, so it's difficult to know if the instruction count would be less than 64 and 96 for you too. If you have another computer or laptop close by there's a good chance the asset will work on that one. And I'm pretty sure you don't need a new computer to run this, just a new graphics card, and it doesn't have to be an expensive graphics card, just one that's a bit more up to date.
Yes it does work on my bro's laptop :D. I didn't know my computer sucked that much ;(. I'll update the graphics card.
 
Is this with tilemap? If yes, i'll buy it before x-mas (maybe, cuz wan't to implement into my game and have more fps than now (around 200))!
 

Dragon47

Member

JaimitoEs

Member
@Dragon47 I extremly recomend you make a video to put in the tittle description and the Marketplace, yes, you have a demo but people can ignore this, first thing when people watch assets is directly play the video!
 

Sammi3

Member
This looks nice. I'm considering purchasing this (I think this would be the 2nd thing I've bought from you and the 3rd asset from you that I have downloaded). Does this work with ds_grids to store the location of the water blocks or does it use GM objects?
 

Dragon47

Member
This looks nice. I'm considering purchasing this (I think this would be the 2nd thing I've bought from you and the 3rd asset from you that I have downloaded). Does this work with ds_grids to store the location of the water blocks or does it use GM objects?
The asset uses DS grids for blocks, but water is updated on the GPU and is hence stored in surfaces (which can be backed up on the CPU). You don't have to deal with surfaces though, there's a script that lets you check if there is water at a certain place, and another script that lets you add a specified region of water to the world, as well as scripts that let you load/save the water to a file, so it should be easy to manage.
 

Sammi3

Member
I think I understand how this works. My current project procedurally generates the land and water so I'll probably have to play around with it to integrate with the generation part of my game but good work. Your tile lighting, autotile and now this will have saved me a lot of time. I'm not that good with shaders. I can use them for effects but definitely not for simulating fluids so I'm really thankful that you made this. Although, you seem like the type of person who gets a kick out of a challenge. Anyway, in the process of moving but I'll definitely purchase this really soon!
 

Dragon47

Member
I think I understand how this works. My current project procedurally generates the land and water so I'll probably have to play around with it to integrate with the generation part of my game but good work. Your tile lighting, autotile and now this will have saved me a lot of time. I'm not that good with shaders. I can use them for effects but definitely not for simulating fluids so I'm really thankful that you made this. Although, you seem like the type of person who gets a kick out of a challenge. Anyway, in the process of moving but I'll definitely purchase this really soon!
Thank you for the kind words, I appreciate it :) good luck with your games and with moving!
 
P

Pipsy

Guest
Broooooo, I'm no amateur in gamemaker but your engines kinda blew my mind. I didn't realize this was even possible without crazy amount of sprites.

Since I'm broke and am trying to learn more of the areas that are more foreign to me (if you don't mind me asking):
1) How does this water stuff work? Triangles + shaders? Where do you even begin to keep track of this (in order to create ripples and whatnot)?
2) I've seen this type of lighting a lot, but I always wonder, how do you make this shapeable blending dark mass? More shaders?
 

Dragon47

Member
Broooooo, I'm no amateur in gamemaker but your engines kinda blew my mind. I didn't realize this was even possible without crazy amount of sprites.

Since I'm broke and am trying to learn more of the areas that are more foreign to me (if you don't mind me asking):
1) How does this water stuff work? Triangles + shaders? Where do you even begin to keep track of this (in order to create ripples and whatnot)?
2) I've seen this type of lighting a lot, but I always wonder, how do you make this shapeable blending dark mass? More shaders?
Haha, shaders and surfaces have helped me a lot. The water is actually several surfaces where every pixel in the surface corresponds to a 8x8px area on the screen. So you could say the water is divided into 8x8 water blocks on a grid. There's not much going on with vertices here, there's only rectangle shapes. I have a surface for velocity, a surface for pressure and volume, a surface for marking solid areas where the water collides, and a fourth surface for visualization data. To update the movement of water I have to update the velocity and volume/pressure surfaces. This is done with shader code by rendering the surfaces to "themselves" (actually to temporary surfaces which are then swapped with the old ones). This is done in three draw passes (in HLSL 9) if all features are enabled. The visualization is done by using visualization data to determine what water is falling (turning it white), and interpolation which together with a volume threshold (as in, everything above a certain volume is rendered) allows the water to look smooth and not blocky. The visualization data also holds the distance to the surface which is used to find the reflection point and a gradient noise normal map is used to displace the reflection to make it look distorted. The visualization takes care of the waves in the water as well and are separate from the physics code.

As for your second question, it's shaders here as well. I render all blocks as black pixels to a small surface, the rest as white. Then blur the surface, multiply the result by two and draw it at 16x scale with interpolation enabled and with a multiply blend mode. I have a free marketplace asset for this: https://marketplace.yoyogames.com/assets/880/block-lighting-2d

It's difficult to explain everything without writing a ton of text so this is more of a summary. Just continue asking if you have more questions.
 

rIKmAN

Member
Thought I'd give the demo a quick go after reading what @chance said - and was blown away.
Does this work with GMS2, or are you planning to have it work?

Great stuff, amazing!
 
P

Pipsy

Guest
Haha, shaders and surfaces have helped me a lot. The water is actually several surfaces where every pixel in the surface corresponds to a 8x8px area on the screen. So you could say the water is divided into 8x8 water blocks on a grid. There's not much going on with vertices here, there's only rectangle shapes. I have a surface for velocity, a surface for pressure and volume, a surface for marking solid areas where the water collides, and a fourth surface for visualization data. To update the movement of water I have to update the velocity and volume/pressure surfaces. This is done with shader code by rendering the surfaces to "themselves" (actually to temporary surfaces which are then swapped with the old ones). This is done in three draw passes (in HLSL 9) if all features are enabled. The visualization is done by using visualization data to determine what water is falling (turning it white), and interpolation which together with a volume threshold (as in, everything above a certain volume is rendered) allows the water to look smooth and not blocky. The visualization data also holds the distance to the surface which is used to find the reflection point and a gradient noise normal map is used to displace the reflection to make it look distorted. The visualization takes care of the waves in the water as well and are separate from the physics code.

As for your second question, it's shaders here as well. I render all blocks as black pixels to a small surface, the rest as white. Then blur the surface, multiply the result by two and draw it at 16x scale with interpolation enabled and with a multiply blend mode. I have a free marketplace asset for this: https://marketplace.yoyogames.com/assets/880/block-lighting-2d

It's difficult to explain everything without writing a ton of text so this is more of a summary. Just continue asking if you have more questions.
Dang, thanks so much! Also one more questions: how did you make the reflections correspond and reflect whatever above it -- especially light like the sun?
 

Dragon47

Member
Dang, thanks so much! Also one more questions: how did you make the reflections correspond and reflect whatever above it -- especially light like the sun?
The water is placed in a grid, and each cell of this grid holds a "distance to surface"-value. This value is set to 0 if there's no water in the cell (0 volume). Otherwise it is set to the "distance to surface"-value of the cell above it plus a little bit which makes the "distance to surface"-value propagate and increase downward to eventually give an accurate value of the distance from the cell to the surface. This value can be used when visualizing the water. With interpolation enabled, the distances of the cells will be interpolated which gives an accurate distance value for each pixel on the screen. If you subtract this distance from the y-coordinate of the pixel, you'll get to the surface of the water, then subtract it again and you'll get to the reflection point (the pixel coodinate mirrored by the water surface). You can then use the texture of the screen at this position for the reflection. Doing this for every pixel creates the reflection you can see in the water.

For reflections of the sun, it's a bit different. It's a fake reflection. The shaders don't turn the sun into the distorted shapes it has in the reflection, instead this distorted shape is an already existing sprite that is drawn to an invisible surface together with other light sources that should be reflected extra strongly. This surface is then used in the reflection shader. After you've found the reflection coordinate as explained above, you use this to pick both the color of the screen and the color of this invisible light surface.
The color used is the maximum of these two colors for each color component.
 
P

Pipsy

Guest
The water is placed in a grid, and each cell of this grid holds a "distance to surface"-value. This value is set to 0 if there's no water in the cell (0 volume). Otherwise it is set to the "distance to surface"-value of the cell above it plus a little bit which makes the "distance to surface"-value propagate and increase downward to eventually give an accurate value of the distance from the cell to the surface. This value can be used when visualizing the water. With interpolation enabled, the distances of the cells will be interpolated which gives an accurate distance value for each pixel on the screen. If you subtract this distance from the y-coordinate of the pixel, you'll get to the surface of the water, then subtract it again and you'll get to the reflection point (the pixel coodinate mirrored by the water surface). You can then use the texture of the screen at this position for the reflection. Doing this for every pixel creates the reflection you can see in the water.

For reflections of the sun, it's a bit different. It's a fake reflection. The shaders don't turn the sun into the distorted shapes it has in the reflection, instead this distorted shape is an already existing sprite that is drawn to an invisible surface together with other light sources that should be reflected extra strongly. This surface is then used in the reflection shader. After you've found the reflection coordinate as explained above, you use this to pick both the color of the screen and the color of this invisible light surface.
The color used is the maximum of these two colors for each color component.
.

Crazy. Amazing job on this, man, and thanks for the help. :)
 
The engine is beautiful, the physics are gorgeous BUT the water falls need more water particles and water drops. Cascades for example will seem to rush like a river with water and in your case, the cascades look like mist. We do not really feel the ffect of filling space with water.

Another interesting thing that would be great is that the player could interact with the falls having the water react to it as an obtacle instead of passing through. Besides that, I REALLY love what you've done.
 

Dragon47

Member
The engine is beautiful, the physics are gorgeous BUT the water falls need more water particles and water drops. Cascades for example will seem to rush like a river with water and in your case, the cascades look like mist. We do not really feel the ffect of filling space with water.

Another interesting thing that would be great is that the player could interact with the falls having the water react to it as an obtacle instead of passing through. Besides that, I REALLY love what you've done.
Thank you. The latter can be achieved with user code, but might look a bit strange either way. More detail could probably be added to the waterfalls, but this would also make it slower. Maybe I'll try it sometime.
 

Sammi3

Member
I was looking at the preview of the files and I was wondering if this would break my game that uses your block lighting engine in the event that you do some water calculations with the bl_rectangle_* scripts as I have edited them in my project that used your tile lighting in order for it to function with some of the rules of my game. Sorry if anything I have said was incoherent, I haven't slept in over 32 hours.
 

Dragon47

Member
I was looking at the preview of the files and I was wondering if this would break my game that uses your block lighting engine in the event that you do some water calculations with the bl_rectangle_* scripts as I have edited them in my project that used your tile lighting in order for it to function with some of the rules of my game. Sorry if anything I have said was incoherent, I haven't slept in over 32 hours.
The block lighting is only used in the example implementation. The resources in the example folders are only needed for learning purposes, so you can ignore them and import all the other folders (those without example in the name) when you want to add the asset to your game. But the first time you check out the asset, I recommend that you start a new clean project and import everything including the example to see and learn how it can be implemented.
You should go sleep. I should too, it's almost 8 am, good night x)
 

Sammi3

Member
I just purchased this but I'm getting errors. I'm using 1.4.1763. Here are the errors that show up:
Error : [V]Shader_sh_wp_update_0_right_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_1_right_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_2_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_0_down_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_1_down_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_2_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_0_up_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_1_up_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_0_left_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_update_1_left_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_0_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_1_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_2_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_3_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_4_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_5_horizontal_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_0_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_1_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_2_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_3_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_4_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_visualize_5_vertical_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_precalculate_reflections_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_replace_volume_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_add_volume_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_replace_velocity_hlsl_9(3) : '' : syntax error
Error compiling vertex shader:
Error : [V]Shader_sh_wp_add_velocity_hlsl_9(3) : '' : syntax error
EDIT: Just checked the guide and saw that I had to change the shaders to hlsl.
EDIT 2: I get an issue when running with the YYC:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Draw Event
for object obj_example_main:


REAL argument incorrect type 3
############################################################################################
--------------------------------------------------------------------------------------------
called from - gml_Script_wp_rectangle_draw (line 38)
called from - gml_Script_example_draw_with_reflections (line 25)
called from - gml_Script_example_draw_world (line 8)
called from - gml_Object_obj_example_main_Draw_0 (line 12)
 
Last edited:

Dragon47

Member
I just purchased this but I'm getting errors. I'm using 1.4.1763. Here are the errors that show up:


EDIT: Just checked the guide and saw that I had to change the shaders to hlsl.
EDIT 2: I get an issue when running with the YYC:
Thank you for telling me. I've now updated the asset with a new version (1.0.2) which compiles successfully with windows YYC.
The bug was caused by a direct "==" check between a texture and a real, which is not accepted with YYC. There was also an initialization bug caused by some unused code in an example script.
 

Sammi3

Member
Thank you for telling me. I've now updated the asset with a new version (1.0.2) which compiles successfully with windows YYC.
The bug was caused by a direct "==" check between a texture and a real, which is not accepted with YYC. There was also an initialization bug caused by some unused code in an example script.
Thank you. Works like a charm. Are there some HLSL shaders that do things the GLSL shaders don't? Or will it be perfectly fine if I deleted all the HLSL shaders?
 

Dragon47

Member
Thank you. Works like a charm. Are there some HLSL shaders that do things the GLSL shaders don't? Or will it be perfectly fine if I deleted all the HLSL shaders?
They do they same, but the GLSL shaders are slightly slower, but not by much. You should be able to delete the HLSL shaders, but if you use YYC you might have to also comment out the lines of code that refer to these shaders. I guess you can "save as" a new project and test it.
 

Sammi3

Member
Screenshot 1, recording fps was low
Screenshot 2, recording fps is 33
This is how it looks so far in the game. Haven't included reflections or refractions yet (have to make my tile system work with this) but it really was plug n' play. Great asset. 10/10.
 
Last edited:

Macube

Member
Don't work for me (With YYC and/or without YYC) : ( I have the GM Studio - Version 1.4.1763 )

Reading project file....Error compiling vertex shader:
In Shader sh_wp_update_0_right_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_1_right_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_2_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_0_down_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_1_down_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_2_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_0_up_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_1_up_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_0_left_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_update_1_left_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_0_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_1_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_2_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_3_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_4_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_5_horizontal_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_0_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_1_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_2_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_3_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_4_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_visualize_5_vertical_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_precalculate_reflections_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_replace_volume_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_add_volume_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_replace_velocity_hlsl_9 at line 3 : '' : syntax error
Error compiling vertex shader:
In Shader sh_wp_add_velocity_hlsl_9 at line 3 : '' : syntax error
Compile Failed - Please check the Compile window for any additional information
 
Top