When calling Shader.setRenderToTexture() it will now draw the shader just once, immediately to the texture, to avoid the texture being blank for a single frame (thanks Kyle)

This commit is contained in:
Richard Davey 2019-09-19 23:32:40 +01:00
parent 9f8e9d2afc
commit bc5c7cf7ab
2 changed files with 18 additions and 0 deletions

View file

@ -6,6 +6,10 @@
* `GameConfig.antialiasGL` is a new boolean that allows you to set the `antialias` property of the WebGL context during creation, without impacting any subsequent textures or the canvas CSS.
### Updates
* When calling `Shader.setRenderToTexture()` it will now draw the shader just once, immediately to the texture, to avoid the texture being blank for a single frame (thanks Kyle)
### Bug Fixes
* `SpineCanvasPlugin.shutdown` would try to dispose of the `sceneRenderer`, but the property isn't set for Canvas.

View file

@ -454,6 +454,20 @@ var Shader = new Class({
}
}
// And now render at least once, so our texture isn't blank on the first update
if (this.shader)
{
var pipeline = renderer.currentPipeline;
renderer.clearPipeline();
this.load();
this.flush();
renderer.rebindPipeline(pipeline);
}
return this;
},