3
\$\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\$
3
  • \$\begingroup\$ do you need single value (same for all pixels) or do you need value per vertex? \$\endgroup\$
    – Notabene
    Jun 6, 2011 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, 2011 at 13:38
  • \$\begingroup\$ gamedev.stackexchange.com/questions/70821/… \$\endgroup\$
    – GeneralGDA
    Feb 2, 2015 at 16:18

1 Answer 1

6
\$\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\$
3
  • \$\begingroup\$ What if i just need an integer? I don't really need a multidimensional float. \$\endgroup\$
    – Joel
    Jun 6, 2011 at 12:18
  • \$\begingroup\$ @Randomman: I'm pretty sure that you can give any input value TEXCOORD. semantics. \$\endgroup\$
    – DeadMG
    Jun 6, 2011 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, 2011 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .