Skip to content

Video texture example shows black screen #658

@CarstenHoyer

Description

@CarstenHoyer

Hi

Video example shows balck screen: https://regl-project.github.io/regl/www/gallery/video.js.html

I looked at #469, and it seems like the fix is not working anymore. At least for me in Safari 15 and Chrome 105 I am seeing a black screen.

Autoplay without sound gives me a video that plays, but it doesn't seem to go into the sampler2D.

Shortened example:

const frag = glsl(`
  precision highp float;

  uniform float time;
  uniform sampler2D video;

  varying vec2 vUv;

  void main () {
    vec4 t = texture2D(video, vUv);
    vec3 color = 0.5 + 0.5 * cos(time + vUv.xyx + vec3(0.0, 2.0, 4.0));
    gl_FragColor = vec4(color, 1.0);
  }
`);

createShader({
    gl,
    frag,
    uniforms: {
      video: regl.texture(video).subimage(video),
      time: ({ time }) => time
    }
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions