Pryme8 Posted November 20, 2017 Share Posted November 20, 2017 So what is the correct syntax to sample from a texture array? The equivalent to: vec4 tile = texture2D(sampler, texCoord); but for an Array not a single sampler2d. I have tried : vec4 tile = texture3D(sampler, vec3(texCoord.xy, 0); and the webGL 2.0 version... vec4 tile = texture(sampler, vec3(texCoord.xy, 0); But I keep dropping: 'texture' : no matching overloaded function found ERROR: 0:37: '=' : dimension mismatch ERROR: 0:37: '=' : cannot convert from 'const mediump float' to 'highp 4-component vector of float' Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 20, 2017 Author Share Posted November 20, 2017 Ok I can sample it just fine now, but it seems to drop an error reguardless: vec4 tile = texture(layers[0], texCoord); works, but drops the error: [15:11:42]: Error: ERROR: 0:37: 'texture' : no matching overloaded function found ERROR: 0:37: '=' : dimension mismatch ERROR: 0:37: '=' : cannot convert from 'const mediump float' to 'highp 4-component vector of float' Which is the same error as:http://www.babylonjs-playground.com/#NJRT3#4 Which was an example @Deltakosh put together to test texture arrays. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2017 Share Posted November 20, 2017 "Texture" is now a keyword in webgl2: https://www.babylonjs-playground.com/#NJRT3#10 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 20, 2017 Author Share Posted November 20, 2017 had to change: #ifdef LAYERS uniform highp sampler2DArray layers[LAYERS]; #endif to #ifdef LAYERS uniform sampler2D layers[LAYERS]; #endif >_<.... sometimes I feel dumb... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.