Archived

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

FantasyGuy

D3DTOP_ADD not working!!!

Recommended Posts

Hi, I am rendering an object with specular lighting. I''m using two texture stages. The first is to modulate the texture with the diffuse and the second is to add the specular to the result. When I use D3DTOP_ADD for the second stage to add the specular to the result, I get a black object with only the specular light. As if the texture stage is doing a D3DTOP_SELECTARG1. I tried changing the operation to D3DTOP_ADDSMOOTH and it worked perfectly. I checked the caps of my video card (which is a GeForce II MX 400) and I found that D3DTOP_ADD is supported. The same application worked fine on other video cards and it gave the same problem on another machine with a GeForce2. What might be the cause of such a problem? Could it be true that the GeForce2 doesn''t support D3DTOP_ADD, and if so, why the caps viewer is showing the opposite? Thanks in advance. My site

Share this post


Link to post
Share on other sites
1. Try ValidateDevice(), just because D3DTOP_ADD is shown as supported in the caps, it doesn''t mean that all combinations of operations using that are actually supported by the hardware!


2. Try new drivers - drivers do have bugs - they do get fixed in different versions..


3. Why are you adding specular on in your texture stages anyway ?. If you set the D3DRS_SPECULARENABLE render state to TRUE, then the hardware will automatically add the interpolated specular value on after the end of the texture blending cascade. This way you also save a texture stage. If you do already set this to true, then it could be the problem - ValidateDevice() will probably return "conflicting renderstate" to signal the drivers unhappiness of you trying to add it twice.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Did you try inverting your arguments? Some cards will only support texture as the first argument (or the second, i can''t remember.) I saw that once in Direct3D doc and got this problem on some crappy 16bits hardware once. I''m just a little surprised that a card such as a Geforce2 would do that (?)

Anyway, just try it, it won''t cost you anything.

Share this post


Link to post
Share on other sites