1
$\begingroup$

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.

$\endgroup$
  • $\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 '18 at 13:43
  • $\begingroup$ @DanHulme Thanks, but how would I set the uniforms on the fragment shader? $\endgroup$ – TauCraft Jun 26 '18 at 13:45
  • $\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 '18 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.