lets say i have the following structure defined in a header (for reusage):

struct VertexShaderInput
    float3 Position: POSITION;
    float3 Normal: NORMAL;
    float2 UV: TEXCOORD;
    float4 Color: COLOR;

however, some meshes dont have normals or colors and some passes (such as Depth PrePass) doesn't need Normal or Color.

Is there a way to keep the struct definition above in my shaders and simply sending "zero" bytes for Normals and Colors?

  • \$\begingroup\$ What happens when you try sending zeroes as you describe? \$\endgroup\$ – DMGregory Jun 13 '20 at 22:33

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.