What are the semantics in HLSL?

Community Forums/Technical Discourse/What are the semantics in HLSL?

Yue(Posted May) [#1]
I have managed to create my first shaders, and I do not know what to do. So I was wondering what the semantics are.

struct colores
		float r,g,b,a:COLOR; <<<<<<

float4 mainPS() :COLOR {
 //colores salida;
 colores  salida = (colores) 0; 
 	salida.r = 255.0;
	salida.g = 0.0;
	salida.b = 0.0;
	salida.a = 1.0;
	return float4(salida);

technique mat {
	pass p0 {
		//CullMode = None;
		//VertexShader = compile vs_3_0 mainVS();
		PixelShader = compile ps_3_0 mainPS();

BlitzMan(Posted May) [#2]
Created your own Shader, but don`t know how to use it.

Yue(Posted May) [#3]
That shader just changes the color of the material, I want to know what the semantics are.

col(Posted May) [#4]

COLOR, which is the same as COLOR0 refers to the rendertarget ( or backbuffer ) to output to. If I remember correctly for shader model 3 you can bind up to 8 rendertargets which would be accessed in the shader as COLOR0 to COLOR7 which can be useful for multiple render targets.