Compute Shaders and For Loops !?
Hi, i', trying to make super simple GPU RayTracer using Compute Shader. It works well, however there is something strange to me. I am not familiar with shaders to much. So i have a loop body with...
View ArticleHow do you see the results of compute shaders in the debugger?
I'm trying to write some particularly complex functionality on the gpu that would be really good if I could at least see the raw data but I have no idea how. Initially i thought my code was broken...
View ArticleCompute Shader Pass RWStructuredBuffer by Reference
I was curious if there is a way to pass a structured buffer around by reference. With both structured buffers and arrays I don't want them to be copied entirely when passed to a function, because this...
View Articleadvice for computing and rendering many, many line segments ?
I'm thinking about a unity port of my iOS app "[Prism HD][1]". The fundamental rendering task each frame is this: 1. Compute a whole bunch of line segments to simulate optical effects. " many" = maybe...
View Articlefragment shader different color for every vertex?
can i make different colors fore every instance of this shader? do i have to send instance to o.output or something? how can i do it? StructuredBuffer buf_Points; StructuredBuffer buf_Positions; struct...
View ArticleComputer Shader parsing
I am trying to set a StructuredBuffer from a C# file. I'm not sure how I would do this as C# as far as i'm aware does not support the float3 type, so I was thinking that maybe it would be a Vector3...
View ArticleHow to get the Cascaded Shadows' split spheres positions?
Hello! In order to compute the directional cascaded shadows in a shader (as in Internal-PrePassCollectShadows.shader or UnityCG.cginc) we need several informations easily findable through the...
View ArticleDrawProcedural draws nothing although buffers are assigned properly
Hi, it's the first time I acually need help from you guys. I have a compute shader that calculates the mesh for a tube along a spline. The resulting mesh looks like this: ![alt text][1] This was drawn...
View ArticleUnity Shader Stream Output Stage
Do Unity 5 shaders have access to the stream output stage in the DX11 pipeline? Reference: https://msdn.microsoft.com/en-us/library/windows/desktop/bb205121%28v=vs.85%29.aspx I want to compute new vert...
View ArticlePosible Bug with Compute Shaders and DirectX11?
Hi everyone. I am experiencing some kind of bug. I am using the Capture Panorama Asset on my project. It is quite simple, so no big deal is involved. I have taken several pictures with said asset on...
View ArticleSetting color for compute shader structure trough c#
I have shader that has structure struct Particle { float3 position; float3 velocity; float3 color; }; And is used here o.color = particleBuffer[instance_id].color; Here's my c# structure public struct...
View ArticleHow can you detect judder in VR?
I've been working in OpenVR (the Steam API), and every once and a while I will get some judder. Is there a way to detect exactly what frames juddered/when juddering will occur? I'd like to minimize...
View ArticleProblem with ComputeShader and RHalf RenderTexture
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...
View ArticlePass Matrix4x4 to ComputeShader?
How can I pass a Matrix4x4 parameter to a ComputeShader? Materials have the SetMatrix method but ComputeShaders lack this. I thought maybe SetFloats to pass the Matrix4x4 as a float array like I would...
View Articlegetting texture from shader into c# script. Also: best way to get values from...
Dear unity community as I am pretty new to unity I would be happy for some guidance into the right direction. I use a shader to modify an image sequence in runtime. This shader is applied as a texture...
View ArticleDo uninitialized RenderTexture areas lead to wrong texturing (tiled...
I am working on a procedural planet engine and face a problem when creating a tiled RenderTexture which can hold e.g. a NormalMap for a larger number of planet planes. Now I am trying to implement a...
View ArticleComputeShader buffer, change count at runtime
Is it possible to change the buffer count, once it's been initialized? For example every update call (sometimes the point cloud is bigger or smaller than the init value) buffer = new ComputeBuffer (...
View ArticleComputeBuffer low-level access in Direct3D 11 in Unity 5.5.0B3
Hi all, I just discovered **ComputeBuffer.GetNativeBufferPtr** in Unity 5.5.0B3. Very very awesome!! I'm trying to use the ID3D11Buffer with CUDA interop but it keeps crashing. When looking at the...
View ArticleGeometry Shader is drawing triangles in wrong vertex positions
Hi, After learning about shaders in past couple of weeks, I wanted to try something on my own. So I tried to draw a face for a cube using Compute Shader and Geometry Shader. Compute shader is...
View ArticleUVs are not mapped properly in my unity surface shader
Hi, I am trying to use compute shaders with surface shaders with dx11 tesselation shaders ( Using unity's distance base tesselation example from unity guide ). I copied the generated code from surface...
View Article