compute shader in order access of pixels
I'm working on a compute shader for a 3d texture where I want to evaluate pixels in a specific order, is there any way to do this? let's say that I have made a texture using the following code; tex =...
View ArticleDirectCompute 1byte data type... Is it exist?
Need to load into compute shader byte array and work with it per byte computation, but I couldn't find 1 byte datatype!!! Help me, please!
View ArticleGraphics.drawProcedural in normal render queue
I'm using a compute shader to create a particle system and draw it using Graphics.DrawProcedural on the Camera.OnRenderObject function. Unfortunately, according to the Unity documentation:> Note...
View ArticleChange parts of compute shader at runtime
Hey there! In a current project I use a compute shader to run a simulation. I pass several Agents into the shader and calculate their velocity. I want to be able to chance the way of calculation at...
View ArticleLerp() and compute shader
Hello, I got a buffer full of vector data (=points) in Unity that I would like to increase in resolution by doing interpolation. So say I would have a 2 by 2 point array, I would like it to become a 3...
View ArticlePass to ComputeShader my define value
I have the Compute Shader: #pragma kernel CSRed #pragma kernel CSGreen #pragma kernel CSBlue RWTexture2D _Texture; //#define SIZE 32 [numthreads(SIZE,SIZE,1)] void CSRed (uint2 id :...
View ArticleSet compute shader platform target
Now that compute shaders are going to be multiplatform, is there a way to set the compilation for DX11 only ? I'm trying to use Append buffers but since Unity 5.1 I get error messages, I guess its...
View ArticleIs it possible to profile compute shaders?
As the title says, I'm wondering if it is possible to profile compute shaders. I want to know the time each compute kernel took in one frame. The Unity Profiler does not show this as it only tracks CPU...
View ArticleBuffers and Compute Shaders
I am new to these, and I can't really find any good definition that is really clear on exactly what these are for. So what are buffers used for in Compute Shaders, and in what situations should they be...
View ArticleHow can I speed up ComputeBuffer.GetData() ?
Since Texture2D.readpixels is awfully slow, I tried using ComputeBuffers instead. Currently I'm writing the colors of certain pixels into a RWStructuredBuffer in a custom ImageEffect i fill wiht...
View ArticleAppend and consume same compute buffer
Hi, I would like to know if it is possible to consume and append the same compute buffer. I have made a simple particle system with compute shaders, and I would like to implement a particle emmiter....
View ArticleCan't get Math Functions to Work in Compute Shader
I have a compute shader that currently only draws to textures. But I want to use the same script to do the math that the cpu is doing. However when I try the code below, nothing happens. I know I am...
View ArticleExclude renderer from compute shader compilation
Since Unity 5.1 there is this OpenGL compilation for compute shaders [see here][1]. Unfortunately this broke many of my complex compute shaders I'm currently working on. In Unity 5.0, when selecting...
View ArticleDepthNormalsTexture access in Compute Shader
is there a way to pass an _CameraDepthNormalsTexture or _CameraGBufferTexture(1,2,3..) in compute shader ? currently i create copy this RT as camera image effect and it is costly...
View ArticleHow can I read in the actual elements from an Append Compute Buffer?
I have a Compute Shader in my game that runs every FixedUpdate() call. It has two passes/kernels: 1) clears out an Append buffer by "consuming" every element 2) appends several new elements into said...
View ArticleHow do I implement ScreenPointToRay in a compute shader?
I've been scratching my head for a while trying to figure this one out. The nearest I can figure is that you take the XY of the screen position, feed it to the projection matrix and the...
View ArticleAdvance mesh alteration: Whittling wood
I am looking to make a demo to prove that this concept works. The demo will have a stick and knife where you can cut and shape the stick, making it pointy/shorter/etc. So i'm wondering how to go about...
View ArticleHow to work with more than 1024 elements in a buffer in a compute shader ?
So the compute shader has a maximum of 1024 threads. How do I work on a buffer with more than 1024 elements ? Can I iterate an arbitrary amount of elements of a buffer in a single thread ?
View ArticleMatrix multiplication in compute shader ?
I get a type mismatch error from the following line in my compute shader: float3 p = result.location + vertex * result.rotation; result.location as well as vertex are float3, result.rotation is a...
View ArticleAlpha Problems With Render Textures
I'm trying to render an image overlay with an alpha channel using a compute shader and render textures. I don't believe there to be a problem with the compute shader because everything uses float4's....
View Article