Jump to content

GLSL sampler2DArray support


MackeyK24
 Share

Recommended Posts

Do we have now or are we going to support the webgl (version 2 i think ) sampler2DArray.

I know we have the sampler2D[x] approach that actual take a array of separate babylon textures... But i think each texture STILL counts against the MAX_TEXTURE_IMAGE_UNITS and the new sampler2DArray approach counts against a MAX_COMBINED_TEXTURE_IMAGE_UNITS as well as the sampler2DArray 

approach allow for tiling in your texture atlas... Here is sample WEBGL texture array code:

uniform sampler2DArray myTextureSampler;  
in vec2 UV;
in int index;
out vec3 out_Color;
        

void main(void)
{
//Use the texture coordinates as usual but the different textures are indexed by the third component of a vec3
out_Color = texture2DArray(myTextureSampler, vec3(UV, index)).rgb;
}

 

Can we support this now... or in the near future ???

@Deltakosh @NasimiAsl @Sebavan @RaananW and anybody else :)

 

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...