• Advertisement

Archived

This topic is now archived and is closed to further replies.

Specular color sum

This topic is 5556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am attempting to evaluate: (diffuse color + specular color) * texture 0 color per pixel. Is there any way I can do this using the standard TextureStageStates? I am currently using a simple pixel shader:

ps.1.1
tex t0

add r1, v0, v1	//r1=diffuse+specular
mul r0, r1, t0

  
However, enabling specular lighting calculations with d3dDevice->SetRenderState(D3DRS_SPECULARENABLE, true); will add the specular color to the result AFTER the texture stages. Thus I will get (diffuse color + specular color) * texture 0 color + specular Is there any way I can disable the "color sum", yet still have the vertex pipeline calculate the specular color so I can use it in the texture stages? [edited by - bakery2k1 on December 2, 2002 7:31:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You add the light. So you are modulating with greate than 255 Color.

I use this Shader
// t0.rgb BaseTexture
// v0 diffuse
// v1 specular

ps.1.1
tex t0
mad_sat r0, t0, v0, v1

Share this post


Link to post
Share on other sites
You add the light. So you are modulating with greate than 255 Color.

I use this Shader
// t0.rgb BaseTexture
// v0 diffuse
// v1 specular

ps.1.1
tex t0
mad_sat r0, t0, v0, v1

Share this post


Link to post
Share on other sites

  • Advertisement