Quantcast
Channel: Questions in topic: "hlsl"
Viewing all articles
Browse latest Browse all 206

[Compute Shader] Pixel Data from Texture Coordinates

$
0
0
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; }

Viewing all articles
Browse latest Browse all 206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>