Quantcast
Channel: AMD Developer Forums: Message List - OpenGL & Vulkan
Viewing all articles
Browse latest Browse all 631

Re: GLSL textureOffset using sampler2DArrayShadow compilation error

$
0
0

I Think your problem don't come from the offset format but from the texture coordinate format.

 

OpenGL documentation :

gvec textureOffset(gsamplersampler​, vectexCoord​, ivecoffset​[, float bias​]); 

The texCoord​ will have its value offset by offset​ texels before performing the lookup. Cubemap, multisample, and buffer samplers are not allowed as types for gsampler.

The type ivec has the same type, but in integers, as vec. So when accessing a 2D sampler, vec is "vec2" and ivec is "ivec2". When accessing a 1D sampler, vec is "float" and ivec is "int".

 

 

You are using a sampler2D texture so there is just 2 dimension for your texture coordinate. Your variable shadowPos must be a vec2


Viewing all articles
Browse latest Browse all 631

Trending Articles