Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


opencl samplers,colors and interpolation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 giugio   Members   -  Reputation: 215

Like
0Likes
Like

Posted 28 November 2012 - 05:28 AM

hello.
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?
thanks.

Sponsor:

#2 Yours3!f   Members   -  Reputation: 1397

Like
0Likes
Like

Posted 28 November 2012 - 01:16 PM

hi,

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_sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
__constant sampler_t the_linear_sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
__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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS