Hello everyone. I have created a simple 2D water surface shader as the title says.
I am a solo dev, but basically more of an artist, I can do basic defold things and some lua scripting, but I had little to no experience with shaders.
I started with a review of defold and GLSL at Shaders and Lua, Sergey Lerg, Spiral Code Studio: LiM'19 talk 4 - YouTube.
Here is the result of my first prototype.
First prototype video
well…it’s a great “surface” expression. Anyway, I got the fundamentals.
Next, I searched shadertoy to find something close to my ideal. I was looking for something that was easy to understand the source code and easy to modify, even for a beginner.
I decided to port to Shader - Shadertoy BETA
As you all know, to port from shadertoy to defold, we have to do a number of tweaks. I relied on the following sources to make small adjustments.
- Shadertoy to Defold tutorial
- Shadertoy - uniform variables needs explanation (SOLVED) - #4 by sven
- 2D pixelated grass waving shader - #40 by 88.josh
The final source code and material setup took the following form.
–
(Edited: removed my code because the licence was not clearly stated in the original code.)
This post shows how a shader novice like myself traced the path to a simple yet effective water surface effect. As indicated in the sources above, this forum and manuals were of great help. sergey.lerg’s video and post in particular were a great first step, and Pawel’s post on the forum gave me many tips.
I hope this post will be helpful to others.