pixijs / lights

Adds dynamic lighting via deferred shading to PixiJS
https://pixijs.io/lights/docs/index.html
MIT License
198 stars 29 forks source link

renderer.resize does not resize diffuseTexture and normalsTexture #11

Closed tststs closed 6 years ago

tststs commented 8 years ago

Hi there,

just played a bit with pixi-lights but after calling the resize method of the renderer it looks like this:

before: bildschirmfoto 2015-08-23 um 14 03 09

after: bildschirmfoto 2015-08-23 um 14 03 20

I fixed the problem by resizing diffuseTextureand normalsTexture.

resize: function (width, height)
    {
      PIXI.WebGLRenderer.prototype.resize.call(this, width, height);

      if (this.diffuseTexture && this.normalsTexture) {

        this.diffuseTexture.resize(width, height);
        this.normalsTexture.resize(width, height);
      }
    },

I don't know exactly if this solves the problem entirely and it surely could be made better than checking for this.diffuseTexture && this.normalsTexture so there is no pull request.

i did the check because WebGLRenderer.prototype._initContext calls the resize method before this.diffuseTexture and this.normalsTexture are instantiated.

greeting from berlin, tststs

ivanpopelyshev commented 6 years ago

not a case for v4.