<p>The real work horse shader looks to be the compute shader near the bottom of the list in <a href="https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/SplatUtilities.compute" rel="nofollow noreferrer">this file</a>.</p>
<p>The other shaders which has fragment and vertex code in it is in this <a href="https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianDebugRenderPoints.shader" rel="nofollow noreferrer">file</a>.</p>
<p>One of the first things it does at line 19 is:</p>
<pre><code>#include &quot;GaussianSplatting.hlsl&quot;
</code></pre>
<p>Which is a reference to the file in the question.</p>
<p>At line 32 it has:</p>
<pre><code>v2f vert (uint vtxID : SV_VertexID, uint instID : SV_InstanceID)
</code></pre>
<p>and then at line 58</p>
<pre><code>half4 frag (v2f i) : SV_Target
</code></pre>
<p>The file: <a href="https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianDebugRenderBoxes.shader" rel="nofollow noreferrer">https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianDebugRenderBoxes.shader</a> and <a href="https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianComposite.shader" rel="nofollow noreferrer">https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianComposite.shader</a></p>
<p>have similar lines.</p>
<p>It looks like the compute shader is implementing the algorithm and the other shaders are there largely, for showing the results.</p>
<p>Hope this helps.</p>

CC BY-SA 4.0
2023-10-28T09:03:57.813Z
2023-10-28T09:16:34.660Z
2023-10-28T09:16:34.660Z
pmw1234
<p>How do I tell what kind of shader this is: <a href="https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianSplatting.hlsl" rel="nofollow noreferrer">https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianSplatting.hlsl</a>
Among these options:
vs – vertex shader</p>
<p>ps – pixel shader</p>
<p>gs – geometry shader</p>
<p>ds – domain shader</p>
<p>hs – hull shader</p>
<p>cs – compute shader</p>
<p>By looking at the code?
I need to know in order to convert it to a glsl shader. Thanks.</p>

CC BY-SA 4.0
2023-10-27T14:42:37.837Z
The code from the URL looks to me like regular hlsl code... It seems like it is shader stage independent
Thomas
CC BY-SA 4.0
2023-10-27T15:01:59.220Z
Look at the meta info in those files  (files that have meta at the end)to find which file actually contain shaders. The meta file for the file linked in the question is pretty clearly functions and is listed as shader includes. Look at some of the other meta files will list actual shaders.
pmw1234
CC BY-SA 4.0
2023-10-27T16:58:41.570Z
@Thomas The thing is I'm trying to use this http://diligentgraphics.com/diligent-engine/shader-converter/standalone-converter/ to convert the shader to glsl, but it requires I give it the shader type.
Ethan
CC BY-SA 4.0
2023-10-27T17:39:06.470Z
then you have to roll them into a real shader...or figure out the includes and put them together, there is nothing complex about it. You just have to take a few minutes and do the work don't ask us to do it for you.
pmw1234
CC BY-SA 4.0
2023-10-28T06:20:01.327Z
Why don't you convert it by hand? GLSL and HLSL are not so different. These 550 lines of code would take a few hours to convert by hand including testing...
Thomas
<shader><compute-shader><hlsl>
How do I tell what kind of shader an hlsl shader is by looking at the code?
Ethan
# How do I tell what kind of shader an hlsl shader is by looking at the code?

(Asked by: username_0 on 2023-10-27)

How do I tell what kind of shader this is: <https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianSplatting.hlsl>
Among these options:
vs – vertex shader

ps – pixel shader

gs – geometry shader

ds – domain shader

hs – hull shader

cs – compute shader

By looking at the code?
I need to know in order to convert it to a glsl shader. Thanks.

**Tags:** shader, compute-shader, hlsl

> **Comments:**
> **username_1**: The code from the URL looks to me like regular hlsl code... It seems like it is shader stage independent  
> **username_2**: Look at the meta info in those files  (files that have meta at the end)to find which file actually contain shaders. The meta file for the file linked in the question is pretty clearly functions and is listed as shader includes. Look at some of the other meta files will list actual shaders.  
> **username_0**: @username_1 The thing is I'm trying to use this http://diligentgraphics.com/diligent-engine/shader-converter/standalone-converter/ to convert the shader to glsl, but it requires I give it the shader type.  
> **username_2**: then you have to roll them into a real shader...or figure out the includes and put them together, there is nothing complex about it. You just have to take a few minutes and do the work don't ask us to do it for you.  
> **username_1**: Why don't you convert it by hand? GLSL and HLSL are not so different. These 550 lines of code would take a few hours to convert by hand including testing...  

---

## 1 answers

### Answer by username_2 on 2023-10-28. Score: 2 | Accepted answer

The real work horse shader looks to be the compute shader near the bottom of the list in [this file](https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/SplatUtilities.compute).

The other shaders which has fragment and vertex code in it is in this [file](https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianDebugRenderPoints.shader).

One of the first things it does at line 19 is:

```
#include "GaussianSplatting.hlsl"

```

Which is a reference to the file in the question.

At line 32 it has:

```
v2f vert (uint vtxID : SV_VertexID, uint instID : SV_InstanceID)

```

and then at line 58

```
half4 frag (v2f i) : SV_Target

```

The file: <https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianDebugRenderBoxes.shader> and <https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Shaders/GaussianComposite.shader>

have similar lines.

It looks like the compute shader is implementing the algorithm and the other shaders are there largely, for showing the results.

Hope this helps.


---

