Skip to content

Commit 9d94e35

Browse files
committed
If a GLTexture is given as a sampler2D it will extract the textureData from it correctly
1 parent c33cf85 commit 9d94e35

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/gameobjects/shader/Shader.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,23 @@ var Shader = new Class({
640640
{
641641
var frame = textureManager.getFrame(textureKey);
642642
var uniform = this.uniforms[uniformKey];
643+
var source = frame.source;
643644

644645
uniform.textureKey = textureKey;
645-
uniform.source = frame.source.image;
646+
uniform.source = source.image;
646647
uniform.value = frame.glTexture;
647648

649+
if (source.isGLTexture)
650+
{
651+
if (!textureData)
652+
{
653+
textureData = {};
654+
}
655+
656+
textureData.width = source.width;
657+
textureData.height = source.height;
658+
}
659+
648660
if (textureData)
649661
{
650662
uniform.textureData = textureData;

0 commit comments

Comments
 (0)