Quantcast
Channel: Questions in topic: "compute shader"
Viewing all articles
Browse latest Browse all 287

Compute shader effect applied to camera output does not affect the entire output

$
0
0
This is a little confusing to explain in the title but the picture sums it up pretty well ![alt text][1] At the top and left edge of the screen the render texture for what is drawn to the screen does not appear to have been affected by the compute shader. This is my code for sending the camera output to the compute shader and the compute shader has 8x8 threads. Can anybody shed some light on what's going on here? Thanks! void OnRenderImage(RenderTexture source, RenderTexture destination) { if (currentFrame == null || currentFrame.width != source.width || currentFrame.height != source.height) { currentFrame = new RenderTexture(source.width, source.height, 0); currentFrame.enableRandomWrite = true; currentFrame.Create(); } Graphics.Blit(source, currentFrame); cameraEffectShader.SetInt("frame", Time.frameCount / 100); cameraEffectShader.SetTexture(noiseKernel, "Result", currentFrame); cameraEffectShader.SetInt("width", currentFrame.width); cameraEffectShader.SetInt("height", currentFrame.height); cameraEffectShader.Dispatch(noiseKernel, currentFrame.width / 8, currentFrame.height / 8, 1); Graphics.Blit(currentFrame, destination); } [1]: /storage/temp/201382-screenshot-1029.png

Viewing all articles
Browse latest Browse all 287

Trending Articles



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