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 framework.

  • 1
    $\begingroup$ I don't know anything about Veldrid, but usually this is accomplished by having a single full-screen quad with a trivial geometry shader. $\endgroup$
    – Dan Hulme
    Jun 26, 2018 at 13:43
  • $\begingroup$ @DanHulme Thanks, but how would I set the uniforms on the fragment shader? $\endgroup$
    – Tau
    Jun 26, 2018 at 13:45
  • 1
    $\begingroup$ From a quick look at the docs you linked I'd guess you use GraphicsDevice.UpdateBuffer on a DeviceBuffer whose type is BufferUsage.UniformBuffer. $\endgroup$
    – Dan Hulme
    Jun 26, 2018 at 16:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.