Learning shaders at the moment and mainly only one thing at the beginning that confuses me. I am basing everything I ask now just on what's described at:
(1.) If I set o.pos just to v.vertex, the model disappears (can see the wireframe is I highlight in properties). Why is this if everything is at default anyways?
(2.) Probably related to the first but if I change the vertex signature to just take in a COLOR parameter with no mention of the position, the model won't disappear but will instead revert back to a pink color until I add in a position. I thought whatever you ignore is just sent out as it is, default.
(3.) In the context of Cg and Unity, can anyone just tell me the difference between SV_POSITION and POSITION? Changing it around but not seeing any change.
In terms of #1, here's a better example of my confusion.
v.vertex = mul (UNITYMATRIXMVP, v.vertex);v.color = v.normal * 0.5 + 0.5;
Why wouldn't the above work? It doesn't The POSITION semantic is being sent in and being returned as output along with the color. I judge that it's not working as the color isn't changing.
First off: Congrats on learning shaders! Once you wrap your head around them you'll start having a ton of fun with various techniques :)
answered Dec 12, 2011 at 05:45 PM
Have you forgotten adding the fragment code?
answered Mar 09, 2013 at 08:55 AM