# Is centroid sampling / interpolation possible with custom HLSL?

**URL:** <https://forums.unrealengine.com/t/is-centroid-sampling-interpolation-possible-with-custom-hlsl/488921>\
**Category:** Rendering\
**Tags:** Mobile, msaa, unreal-engine, hlsl, question\
**Created:** [September 17, 2021, 11:08am UTC](https://forums.unrealengine.com/t/is-centroid-sampling-interpolation-possible-with-custom-hlsl/488921 "2021-09-17T11:08:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Renyro188](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Renyro188](https://forums.unrealengine.com/u/Renyro188)\
**Post date:** [September 17, 2021, 11:08am UTC](https://forums.unrealengine.com/t/is-centroid-sampling-interpolation-possible-with-custom-hlsl/488921/1 "2021-09-17T11:08:36Z")

</div>

I´m trying to render an Atlas Texture with precise UV Mapping but with MSAA enabled there are many visible artifacts. I know of a fix in Unity where you enable centroid sampling in the shader like so:

```
  float2 uv : TEXCOORD0_centroid;

```

I tried to make something similiar in custom HLSL and modfications in the engine material files but can´t get it to work. I´m no expert with shader programming maybe it´s not possible in UE but there is this mentioning of centroid in the default shader that makes me think it could be enabled?

```
#define INPUT_POSITION_QUALIFIERS linear noperspective centroid

```

from _Engine\Shaders\Private\MaterialTemplate.ush_ and also in the genereated HLSL Code in the editor.
