Jump to content
  • Advertisement
Sign in to follow this  

opencl samplers,colors and interpolation

This topic is 2151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm studing opencl, in particular image processing.
is possible to create a sampler that interpolates values from two color: start and end color and the normalized coordinates from 0 to 1 in automatic mode?
I wish use bilinear interpolation.
I must create a texture with interpolated colors or is possible to set the bilinear interpolation in the creation of the sampler?
next, is possible use integer coordinates(for ex from 0px to 600px) and interpolation in the same mode?

Share this post

Link to post
Share on other sites

you can either create a on the client side, or in the cl shader, on the gpu side.
specs: http://www.khronos.org/registry/cl/specs/opencl-1.2.pdf
Client side: from page 128
gpu side: from page 292 and 326

on the gpu side, you can create the same sampler objects. Some examples:
__constant sampler_t the_normalized_sampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
__constant sampler_t the_normalized_linear_sampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;

normalized means access with texture coordinates, unnormalized is basically textureFetch from glsl. You can do the same clamping as in glsl, however you only have the linear/nearest options (so no mip mapping) as far as I know.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!