2
\$\begingroup\$

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.

Thanks

\$\endgroup\$
  • \$\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\$ – Randomman159 Jun 6 '11 at 13:38
  • \$\begingroup\$ gamedev.stackexchange.com/questions/70821/… \$\endgroup\$ – GeneralGDA Feb 2 '15 at 16:18
5
\$\begingroup\$

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

http://msdn.microsoft.com/en-us/library/bb509647(VS.85).aspx

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

\$\endgroup\$
  • \$\begingroup\$ What if i just need an integer? I don't really need a multidimensional float. \$\endgroup\$ – Randomman159 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\$ – Randomman159 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.