Skip to content

Commit 30ea09f

Browse files
committed
Fixed issue with setting wrapping mode on textures
1 parent d216793 commit 30ea09f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

v3/src/renderer/webgl/WebGLRenderer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ WebGLRenderer.prototype = {
122122

123123
createTexture: function (source, width, height)
124124
{
125+
width = source ? source.width : width;
126+
height = source ? source.height : height;
125127
var pot = ((width & (width - 1)) == 0 && (height & (height - 1)) == 0);
126128
var gl = this.gl;
127129
var filter = gl.NEAREST;
@@ -139,7 +141,7 @@ WebGLRenderer.prototype = {
139141
filter = gl.NEAREST;
140142
}
141143

142-
if (typeof width === 'number' && typeof height === 'number')
144+
if (!source && typeof width === 'number' && typeof height === 'number')
143145
{
144146
source.glTexture = this.resourceManager.createTexture(
145147
0,

0 commit comments

Comments
 (0)