Examples: Problem with webgl_shaders_ocean

Description of the problem

I’ve discovered today that the current dev version of webgl_shaders_ocean does not work with Firefox 55.0.2 and Ubuntu 16.04 LTS. The water does not appear and i see some error messages in the browser console.

0:102(109): error: sampler arrays indexed with non-constant expressions are forbidden in GLSL 1.30 and later

And

Integer overflow trying to construct a fake vertex attrib 0 array for a draw-operation with -1 vertices. Try reducing the number of vertices.
Drawing without vertex attrib 0 array enabled forces the browser to do expensive emulation work when running on desktop OpenGL platforms, for example on Mac. It is preferable to always draw with vertex attrib 0 array enabled, by using bindAttribLocation to bind some always-used attribute to location 0.

The problem does not occur with Chromium. Besides, the live version of webgl_shaders_ocean works. So this error probably exists since the latest changes of THREE.Water, see #12167. If i revert the PR, the error does not appear.

/ping @Astrak

Three.js version
  • Dev
  • r87
Browser
  • [] All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • [] All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

4 thoughts on “Examples: Problem with webgl_shaders_ocean

  1. Unfortunately not. The logged fragment shader gets cut off after line 27 😒

    apologies for the question, but is there a […] at the end of the shader log where it gets cut off?

  2. Loop unrolling? There should be a flag or directive or something to force enable/disable it per loop

  3. I guess we could try adding a unrollLoops property to ShaderMaterial?

    if ( material.isShaderMaterial === undefined || material.unrollLoops === true ) {

Comments are closed.