Using the specular component in a shader
Hi everyone!
How do you compute the final color in the pixel shader with the specular component? I have diffuse and ambient just fine but I'm unsure on how to use the specular component. Thanks.
You'll need to be a little more detailed.
Do you just want to pass the vertex specular value along to the vertex shader, then to a pixel shader?
Are you using fixed function lighting/vertex processing and a pixel shader?
Are you using a vertex shader that does lighting and wanting to pass the specular to a pixel shader?
Which shader model are you using (SM3 is a bit different)?
Are you doing all per-pixel lighting?
Are you wondering how to calculate specular?
Do you have all the computation done and you're just not sure what to do with the result?
Do you just want to pass the vertex specular value along to the vertex shader, then to a pixel shader?
Are you using fixed function lighting/vertex processing and a pixel shader?
Are you using a vertex shader that does lighting and wanting to pass the specular to a pixel shader?
Which shader model are you using (SM3 is a bit different)?
Are you doing all per-pixel lighting?
Are you wondering how to calculate specular?
Do you have all the computation done and you're just not sure what to do with the result?
You just do: color = ambient + diffuse + specular?
If you're using the phong illumination model, compute (R*V)^m if R*V > 0 for the specular coefficient.
If you're using the phong illumination model, compute (R*V)^m if R*V > 0 for the specular coefficient.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement