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

Problem with ComputeShader and RHalf RenderTexture

$
0
0
There is a simply compute shader: #pragma kernel CSMain RWTexture2D _Texture; [numthreads(32, 32, 1)] void CSMain (uint2 id : SV_DispatchThreadID) { _Texture[id] += 0.1; } Code which creates a RHalf RW texture: texture = new RenderTexture( 32, 32, 0, RenderTextureFormat.RHalf, RenderTextureReadWrite.Linear ); texture.enableRandomWrite = true; texture.filterMode = FilterMode.Point; texture.Create(); And shader using: shader.SetTexture( 0, "_Texture", texture ); shader.Dispatch( 0, texture.width/32, texture.height/32, 1 ); But I'm getting a strange behavior. ![alt text][1] ![alt text][2] Why is it? RFloat works good. Also just setting constant value works good. But reading and writing RHalf doesn't work. [1]: /storage/temp/73043-1.png [2]: /storage/temp/73044-2.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>