Events
Nov 19, 11 PM - Nov 21, 11 PM
Ganhe a vantagem competitiva de que precisa com poderosas soluções de IA e Cloud ao participar online do Microsoft Ignite.
Registe-se agoraThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Evaluates at the pixel centroid with an offset.
numeric EvaluateAttributeSnapped(
in attrib numeric value,
in
int2 offset
);
value [in]
Type: attrib numeric
The input value.
offset [in]
Type: int2
A 2D offset from the pixel center using a 16x16 grid.
The range for the offset parameter must be defined by the following byte code.
Only the least significant 4 bits of the first two components (U, V) of the pixel offset are used. The conversion from the 4-bit fixed point to float is as follows (MSB...LSB), where the MSB is both a part of the fraction and determines the sign:
Note
The left and top edges of a pixel are included in the offset; however, the bottom and right edges are not included. All other bits in the 32-bit integer U and V offset values are ignored.
An implementation can take the offset provided by the shader and obtain a full 32-bit fixed point value (28.4), which spans the valid range, by performing the following calculation:
iU = (iU<<28)>>28 // keep lowest 4 bits and sign extend, which yields [-8..7]
If an implementation must map the offset to a floating-point offset, it performs the following calculation:
fU = ((float)iU)/16
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 5 and higher shader models | yes |
This function is supported in the following types of shaders:
Vertex | Hull | Domain | Geometry | Pixel | Compute |
---|---|---|---|---|---|
x |
Events
Nov 19, 11 PM - Nov 21, 11 PM
Ganhe a vantagem competitiva de que precisa com poderosas soluções de IA e Cloud ao participar online do Microsoft Ignite.
Registe-se agora