Jump to content

ShaderMaterial Set Vec2 Array


Pryme8
 Share

Recommended Posts

I see the method setArray3
but I assume thats for vector3 arrays I do not see a method for vector2's


I need to be able to fill this in:
#ifdef SHEETS
uniform sampler2D sprites[SHEETS];
uniform vec2 inverseSheetSizes[SHEETS];
#endif

I use:
_setSheets : function(){
        this.shader.setTextureArray('sprites', this._assignedSheets);
    },

To set the texture array, now I am looking to set the inverseSizes (which I store on the texture) at the same time so effectively:
_setSheets : function(){
var ia = [];
for(var i=0; i<this._assignedSheets; i++){
ia.push(this._assignedSheets.inverseSize);
}
      this.shader.setTextureArray('sprites', this._assignedSheets);
      this.shader.setArray2('inverseSheetSizes', ia);
    },


But I cant find any information on how to set a array of vector2's

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...