I'm pretty sure it's possible but i have no idea how.

Could anyone tell me how to make a custom semantic for a pixel shader.


  • \$\begingroup\$ do you need single value (same for all pixels) or do you need value per vertex? \$\endgroup\$ – Notabene Jun 6 '11 at 12:24
  • \$\begingroup\$ Each vertex has a value set for it, just a texture index (basically it is which texture should be used on that vertex) and then each pixel needs its color set depending on the texture index. So yeah i just need an integer passed through the vertexshader and into the pixel shader... \$\endgroup\$ – Joel Jun 6 '11 at 13:38
  • \$\begingroup\$ gamedev.stackexchange.com/questions/70821/… \$\endgroup\$ – GeneralGDA Feb 2 '15 at 16:18

Typically, you just use TEXCOORD for any data that DX doesn't understand.


This page suggests that the system doesn't give a crap, effectively, what semantics you give to your pixel shader inputs.

  • \$\begingroup\$ What if i just need an integer? I don't really need a multidimensional float. \$\endgroup\$ – Joel Jun 6 '11 at 12:18
  • \$\begingroup\$ @Randomman: I'm pretty sure that you can give any input value TEXCOORD. semantics. \$\endgroup\$ – DeadMG Jun 6 '11 at 12:34
  • \$\begingroup\$ Yep k i got it :D ill just use it as a Vertex2D using the x value, because i have a feeling i will change it to need two values later anyway. \$\endgroup\$ – Joel Jun 6 '11 at 13:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.