- Home /
Question by
Major · Jan 05, 2016 at 02:01 AM ·
scripting problemshaderprogramminglogichlsl
[Compute Shader] Pixel Data from Texture Coordinates
I have an HLSL shader where I want to access neighboring pixels, get their color (float4), and do some averaging to create a blur effect. Where color is assigned is the problem spot. Instead of getting the pixel color at id.x and (id.y+10), it instead will move the image by 10 pixels in the y direction... So how do I obtain the color of adjacent pixels to the id value?
[numthreads(8,8,1)]
void CSMain (uint2 id : SV_DispatchThreadID)
{
float4 color;
color = texture[int2(id.x, id.y + 10)];
texture2[id] = color;
}
Comment