Advertisement

Using textures and samplers from GLSL

Started by December 19, 2020 03:03 PM
1 comment, last by Valakor 4 years, 1 month ago

Hey guys,

In HLSL, there is a possibility to specify SamplerState and Texture2D as two separate objects.

I have found sampler2D for GLSL but it seems to be a combination of Image and Sampler (ala VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER).

Is there a possibility to specify sampler and image in GLSL as two separate objects (to mimic HLSL) when using Vulkan?

Thanks!

Yes - you can specify a sampler and a texture2D as separate uniforms, and sample using something like vec4 rgba = texture(sampler2D(uTexture, uSampler), uv);.

This topic is closed to new replies.

Advertisement