Looking for realistic water shader

I’m terribly sorry for bumping this topic, but it is the only thing I found with reference to this issue.

Very important blog post: https://phaser.io/phaser3/devlog/146

On it, Shader Gameobject is explained.

But! since we are talking about ShaderToy,
all I had to do was

  • create a new file (e.g: my_shader.glsl)
  • add the following code:
precision mediump float;
uniform vec2 resolution;
uniform float time;
  • (copy paste the shadertoy code)
  • add a main function:
void main() {
    mainImage(gl_FragColor, gl_FragCoord.xy);
}

Now, the key thing that will make you save time. REFACTOR iResolution to resolution, iTime to time, etc. Then you have a very awesome, simple texture in modern phaser 3, without any pipelines.

1 Like