Questions tagged [compute-shader]
The compute-shader tag has no usage guidance.
30
questions with no upvoted or accepted answers
3
votes
0
answers
54
views
issue with Compute Shader macbeth chart
I'm trying to generate a macbeth chart using the compute shader, but there seems to be an issue with the output image.
here is the glsl code:
...
2
votes
1
answer
2k
views
Send an array of struct to compute shader
I am using Unity to send two types of data to the Compute Shader:
A struct:
struct Flock
{
public Vector3 position;
public Vector3 velocity;
}
And an ...
2
votes
0
answers
445
views
Creating the Vertices and Triangle Indices for Voxel Generated Mesh
I am running into a problem with a compute shader I am writing to generate the vertices and triangle indices for a voxel generated mesh.
Currently, I am creating an ...
2
votes
1
answer
1k
views
Problem unrolling loop in compute shader
I'm pretty new to compute shaders and shader writing in general. I'm trying to write a compute shader for a procedural generation project I'm working on, it's purpose is to blend biomes together. The ...
2
votes
0
answers
44
views
How to generate a star onto a render texture with spherical warping
How would one proceduraly generate a star in a compute shader that looks like one of thes two at any size needed. Also any way transfer this into a spherical map, would be appreciated.
Goal is to ...
2
votes
0
answers
472
views
Vulkan imageLoad data of r32f format in compute shader
I am doing add with a compute shader. All input-output data are stored in VkImage, the format is VK_FORMAT_R32_SFLOAT. In the shader, the corresponding layout is r32f.
I have two questions about this:
...
2
votes
0
answers
469
views
RWTexture3D in Compute Shader on Intel HD 4000
I'm having some weird issues running a Compute Shader with DirectX 11 on an Intel HD 4000 GPU.
The goal is to write different shapes into a DXGI_FORMAT_R32_FLOAT 3D Texture with a size of ...
1
vote
0
answers
276
views
Generating Shader Includes via script at compile time
I'm experimenting with compute shaders in Unity. A pretty typical thing you wanna do is marshal a buffer of structs back and fourth between C# and HLSL land. Ordinarily you'd have to manually define ...
1
vote
0
answers
958
views
OpenGL Compute Shader vs Fragment Shader device support
I have a game with massively parallelizable logic, which I intend to write calculate on the GPU (Java/LibGDX).
I am planning to implement a logic for it through a fragment shader, instead of a compute ...
1
vote
0
answers
93
views
GLSL link fails with C9999 (too many buffer declarations?)
I'm receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), ...
1
vote
0
answers
879
views
Unity Direct Compute: Setting a struct of arrays
The NVIDIA Direct Compute programming guide lists some best practices for memory management on the GPU. One tip they give on page 8 ("Structured Buffers") is to use a 'structure of arrays' (SOA) ...
1
vote
0
answers
659
views
Generating Mesh using Compute Shaders
I am working on a game project in unity which has a procedurally generated terrain made up of 16*128*16 chunks of blocks. The map size is going to be finite (Possibly up to ~100*100 chunks). Currently ...
1
vote
0
answers
1k
views
How to get Pixel Coordinates of certain colors in a Texture?
I have a relatively big Texture, and I try to find a certain color pixels pattern:
eg. White, Black, White, Green .
They are lying next to each other,
If I use Texture2d.Getpixels() on every pixel ...
1
vote
0
answers
1k
views
Passing an UAV to a Pixel Shader in DirectX11
I have a compute shader which task is to take an input image and then blur it using a Gaussian filter approach. The input and output for the compute shader looks like this:
...
0
votes
0
answers
23
views
Some of the assignment operations in the directx11 compute shader are getting skipped, even though the assigned values are used later
I'm implementing an algorithm called Fast3x3 SVD on my compute shader. However, while I was debugging my compute shader in RenderDoc, I noticed some assignment operators were completely getting ...
0
votes
0
answers
43
views
What are the Godot equivalent to these Unity types and Functions for graphics processing?
Here are some unity types in this script: https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Runtime/GaussianSplatRenderer.cs
which I am trying to convert to Godot:
...
0
votes
0
answers
119
views
Unity Compute Shader InterlockedMin Max not work on Android
I have a Compute Shader which uses InterlockedMin() and InterlockedMax().
The Compute Shader works very well on my PC (AMD ...
0
votes
0
answers
27
views
ComputeShader.SetTexture() isn't writing to the shader
The C# script:
...
0
votes
0
answers
36
views
Convolution matrix based minimum distance calculation
I want to detect the minimum distance to each game object within a convolution matrix in a compute shader.
I know the code is a bit to read, but the logic itself is not too complicated. I am trying to ...
0
votes
0
answers
45
views
INSANE Slowdown when implementing MSAA
I am trying to implement MSAA in my very simple raytracer. However, when I do, my program gets and insane slowdown. I am working in Metal, and on the Metal HUD, I can see that my frametimes drop from ...
0
votes
1
answer
113
views
Noise in compute shader related to threadsPerGroup
I have been working on a metaball compute shader for roughly 3 months now, and the only issue I have to resolve is noise in the output Dest[id.xy]. I also asked GPT 4 about the crux of the issue and ...
0
votes
1
answer
120
views
Is it possible to draw billboards from point data held in a compute buffer?
I'm currently trying to show a galaxy and have developed a compute shader that places/moves "stars".
Another vertex/fragment shader reads the buffer and currently places a point at each ...
0
votes
0
answers
107
views
ComputeBuffer Values messed up when calling the dispatch many times in a row
I'm having a RWStructuredBuffer called AffectedVertices give me random data instead of 1 simple value to resultAffectedVertices, ...
0
votes
0
answers
358
views
Marching cube terrain generated by compute shader gives strange error
I'm creating my own terrain terrain system for Unity using marching cubes but I've run into a problem I'm stumped on. First I'll explain how it works:
A compute shader creates an array of points ...
0
votes
0
answers
142
views
Unity, connecting unlit shader output to compute shader?
I'm hoping to learn what my options are for sharing the outputs of simple unlit shaders with compute shaders that will operate on the data.
Is my only course of action to use a render texture with the ...
0
votes
0
answers
247
views
ID3D11DeviceContext:::CopyResource is bottleneck in my particle system
I have a snow particle system and I use simplex noise for creating turbulence effect.
At first, I made calculations on the CPU, and the simplex noise calls obviously were the bottleneck.
The ...
0
votes
0
answers
351
views
Floodfilling a texture in HLSL Compute shader
I have a very large texture which I want to fill with values representing "distance in units from a river tile".
The texture is already seeded with these origin river points (meaning ...
0
votes
1
answer
250
views
Passing touch position to compute shader
I am working on a game where I have to mix colored liquids as shown here. I am working with a plugin (StableFluids) to get this effect: Effect
Problem:
The shaders used in the plugin are able to ...
0
votes
0
answers
198
views
How Lots of ComputeBuffers at Once Affect Performance Unity
How will lots ComputeBuffer instances affect performance? And why?
I know that I should call ComputeBuffer.Release() on every <...
0
votes
0
answers
424
views
GLSL Atomics With Floats
I am implementing SDSM and in a GLSL compute shader I need to min/max vec3 values to compute the shadow map bounds. The sample implementation (in HLSL) uses vectors in "light space" that spans from 0-...