<p>Having an HLSL shader like this:</p>

<pre><code>struct FragmentIn
{
    float4 Position : SV_Position;
    float4 Color : COLOR0;
};

struct Oct
{
    ...
};

float3 Camera;
float heading;
Oct data[9];

float4 FS(FragmentIn input) : SV_Target0
{
    ...
}
</code></pre>

<p>... how would one supply the uniforms and execute it directly for all pixels?</p>

<p>Using the <a href="https://mellinoe.github.io/veldrid-docs/index.html" rel="nofollow noreferrer">Veldrid</a> framework.</p>

CC BY-SA 4.0
2018-06-26T13:43:47.550Z
I don't know anything about Veldrid, but usually this is accomplished by having a single full-screen quad with a trivial geometry shader.
Dan Hulme
CC BY-SA 4.0
2018-06-26T13:45:54.653Z
@DanHulme Thanks, but how would I set the uniforms on the fragment shader?
Tau
CC BY-SA 4.0
2018-06-26T16:11:44.287Z
From a quick look at the docs you linked I'd guess you use GraphicsDevice.UpdateBuffer on a DeviceBuffer whose type is [BufferUsage.UniformBuffer](https://mellinoe.github.io/veldrid-docs/articles/shaders.html#uniform-buffer).
Dan Hulme
<fragment-shader><uniform-buffer-object>
Veldrid: Only execute fragment shader
Tau
# Veldrid: Only execute fragment shader

(Asked by: username_0 on 2018-06-26)

Having an HLSL shader like this:

```
struct FragmentIn
{
    float4 Position : SV_Position;
    float4 Color : COLOR0;
};

struct Oct
{
    ...
};

float3 Camera;
float heading;
Oct data[9];

float4 FS(FragmentIn input) : SV_Target0
{
    ...
}

```

... how would one supply the uniforms and execute it directly for all pixels?

Using the [Veldrid](https://mellinoe.github.io/veldrid-docs/index.html) framework.

**Tags:** fragment-shader, uniform-buffer-object

> **Comments:**
> **username_1**: I don't know anything about Veldrid, but usually this is accomplished by having a single full-screen quad with a trivial geometry shader.  
> **username_0**: @username_1 Thanks, but how would I set the uniforms on the fragment shader?  
> **username_1**: From a quick look at the docs you linked I'd guess you use GraphicsDevice.UpdateBuffer on a DeviceBuffer whose type is [BufferUsage.UniformBuffer](https://mellinoe.github.io/veldrid-docs/articles/shaders.html#uniform-buffer).  

---

## 0 answers

