< Previous | Contents | Next >
_tex2DVec4(tex, x, y) and _tex2DVecN(tex, x, y, order) are the default image sampling functions.
They read a float4 vector of RGBA color values from a given texture tex at the specified x and y coordinates, which are specified in pixels by default, i.e. between (0,0) and (width-1,height-1) inclusive. The coordinate space, pixel filtering, and edge behavior can be changed using the AddSampler() function with the default sampler name RowSampler.
_tex2DVecN() also takes an order parameter, which is a bitmask describing which channels to read. Pass 15 to return all four RGBA channels, or pass 1 to read just the alpha value and return it in all four RGBA channels.