All Questions
Tagged with compute-shader unity-game-engine
98
questions
0
votes
1
answer
27
views
Compute shader occlusion test only works with scene camera
Using Unity 2022.3.40f1 and URP.
I'm trying to implement occlusion culling with the depth buffer in a compute shader.
I don't know what's wrong here but my code only works fine with the scene camera ...
0
votes
1
answer
34
views
Raymarching compute shader error in Unity VR
I am trying to apply a raymarching shader to my Unity VR project.
It is supposed to apply a shader to particles that represent a fluid using Smooth Particle Hydrodynamics.
However, I am running into ...
0
votes
0
answers
19
views
Perform multiple lines in atomic way in compute shader
I am implementing a marching cubes algorithm in Unity using a compute shader. In my current implementation all the necessary data is stored in RWStructuredBuffer's with a theoretical maximum size. The ...
0
votes
0
answers
21
views
Unity: Set a mesh directly on the GPU
In unity I'm constructing a mesh on the GPU. Currently, I have to write the vertices / indices back to the CPU before setting them again in the mesh. This is very inefficient and takes about 90% of ...
1
vote
0
answers
20
views
Unity compute shader thread syncing issue
So I am writing a marching cubes compute shader. It’s going reasonably well and does work. I am in the processing of modifying it to remove all duplicate vertices. I want to do this in the shader. I ...
0
votes
1
answer
74
views
How do I achieve the ping-ponging technique in HLSL compute shaders?
I am doing a fluid simulation, and implementing such simulation with the CPU is very slow, especially when the simulation grid size gets bigger or is a 3d grid. So I used shaders to get the ...
2
votes
1
answer
163
views
Load raw texture data / Getting data from compute shader
Overview
I have been working on a compute shader for awhile now. Initially it would take in 1 camera feed of 320x256 pixels. This all works great.
Now I want to be able to handle multiple cameras, ...
0
votes
2
answers
383
views
I keep getting this strange error "undeclared identifier"
So Im trying to make a compute shader for my unity game, and I keep getting this strange error:
Shader error in 'PathTracing': undeclared identifier 'intersectionPos' at kernel CSMain at PathTracing....
1
vote
0
answers
61
views
Compute Buffer of bytes to RWTexture2D float4 in Compute Shader
I'm struggling with a Compute Shader whose purpose is to take a byte array of rgba values and write them to a render texture. I'm passing in ints (as I don't believe I can use byte itself) to the ...
0
votes
0
answers
34
views
Incorrect Frustum Culling behavior
I've written a C# script and a Compute Shader that should cull the instances that are not visible by the camera. The instances are getting culled but with some weird behavior - sometimes not getting ...
0
votes
1
answer
84
views
ComputeShader in Unity : Why are the values all wrong?
Here's how the object is defined in C#, for Unity to be able to work with it :
(please note: I left all fields -- even the ones not used in this question -- in case the issue was in an seemingly-...
0
votes
1
answer
64
views
In a tree structure in Unity / C#, how do you sum calculated values from root to leaves using ComputeShaders?
This wouldn't be too hard if this wasn't mixing several worlds : the world of algorithmics, the world of C# and the world of compute shaders (in Unity).
EDIT: This is somewhat related. My scenario is ...
1
vote
0
answers
270
views
Compute shaders : How do you pass not-so-regular structures as parameters?
I am working in C#, with Unity.
I have created a compute shader to which I want to pass my array of C# data structures.
That's when I realized I might have gone overboard with fancy data structures, ...
0
votes
1
answer
83
views
Unity compute shader make pixels look weird
I am trying to generate sand with mouse input, and the behavior of the sand falling down one dot at a time in Compute Shader.but it is not working.
https://imgur.com/8svQDu9.jpg
Here is the code.
...
-1
votes
1
answer
167
views
Compute Shaders - Integers >= 65535 Issue?
I'm not very experienced with compute shaders but right now I'm having to write some for the sake of performance. I've got a simple kernel method in my compute shader here that just reinterprets a ...