phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.95k stars 7.08k forks source link

[3.53.1] RenderTexture generates [.WebGL-0x7fd824064400]RENDER WARNING: there is no texture bound to the unit 0 #5603

Closed jacola closed 1 year ago

jacola commented 3 years ago

Version

Description

On macOS with Chrome (does not reproduce with Safari), calling just RenderTexture.startDraw() followed by RenderTexture.endDraw() generates [.WebGL-0x7fd824064400]RENDER WARNING: there is no texture bound to the unit 0 Screen Shot 2021-03-15 at 21 23 14

My teammates report that the issue does not reproduce on Linux or Windows.

Example Test Code

https://codepen.io/jacola/pen/GRNezEg

var config = {
  type: Phaser.AUTO,
  width: 800,
  height: 600,
  scene: {
    preload: preload,
    create: create,
    update: update,
  },
};

var rf = null;
var game = new Phaser.Game(config);

function preload() {
  this.load.image(
    "ms",
    "https://examples.phaser.io/assets/sprites/phaser-dude.png"
  );
}

function create() {
  this.add.image(100, 100, "ms");

  rf = this.make.renderTexture({
    x: 0,
    y: 0,
    width: 100,
    height: 100,
    add: true,
  });
}

function update() {
  rf.beginDraw();
  rf.endDraw();
}

Additional Information

If you do not have something rendered to the screen, the error will not reproduce. I can gather any additional information required.

jedateach commented 3 years ago

This issue also shows up in the official examples: https://phaser.io/examples/v3/view/game-objects/render-texture/erase-part-of-render-texture

photonstorm commented 1 year ago

Just to say this doesn't happen in 3.60 (although I cannot get it to duplicate in 3.53.1 either anymore, so maybe a Chrome thing at the time?) - however, it definitely doesn't happen any longer. Tested on Chrome and Safari on mac OS Ventura.