Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question
    
do you need single value (same for all pixels) or do you need value per vertex? –  Notabene Jun 6 '11 at 12:24
    
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... –  Randomman159 Jun 6 '11 at 13:38
add comment

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
What if i just need an integer? I don't really need a multidimensional float. –  Randomman159 Jun 6 '11 at 12:18
    
@Randomman: I'm pretty sure that you can give any input value TEXCOORD. semantics. –  DeadMG Jun 6 '11 at 12:34
    
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. –  Randomman159 Jun 6 '11 at 13:39
    
Marked as answer thanks again –  Randomman159 Jun 6 '11 at 13:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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