Fog Problem - Urgent help required.

Started by
2 comments, last by Tarique 24 years, 1 month ago
Well, we finally delivered our 'final' version of the software to our client and their testers have come back with a list of problems. Most of them I have now fixed. The only one that remains is a problem that occurs only on certain cards. Any help in identifying how to get aorund this problem would be appreciated. The problem occurs on a RagePro card and a Diamond Viper 330. Basically what's happening is that alpha transparent textures are only being fogged to black, even though I'm fogging to white. Our underwater scene fogs to a blue hue. However, I have seaweed which is alpha masked anf that only fogs to black. Bare in mind this only happens on a couple of cards. Most cards I've tested render them fine. Any clues as to what I can look at to get around this? Once this is solved, I'm home and dry! And the title will be released at which point I can tell you what it is and show you some screen shots. It's looking quite good now. Please help!!!! Cheers, Taz. Edited by - Tarique on 3/7/00 4:07:26 PM
---------------------------------Tarique NaseemCTOVRX Technologies Ltd.http://www.vrxtechnologies.com
Advertisement
Further to my post above, the render state stuff is below:-

wgtd3ddev->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
wgtd3ddev->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
wgtd3ddev->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
wgtd3ddev->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
wgtd3ddev->SetRenderState(D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD);

if(PR_D3D_Caps.AlphaBlend)
{
wgtd3ddev->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
wgtd3ddev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
wgtd3ddev->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);

wgtd3ddev->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); <<---- THIS

wgtd3ddev->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA);
wgtd3ddev->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA);
wgtd3ddev->SetRenderState(D3DRENDERSTATE_ALPHATESTENABLE, FALSE);
wgtd3ddev->SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, FALSE);
}

If I comment out the ALPHABLENDENABLE (labelled above as ''THIS''), the fogging works, ie it fogs to the specified fog colour. However, obviously the alpha blending no longer works! Commenting it back in again forces the polygons to fog to black, regardless of the current fog colour.

I have tried to force the fog colour (as a test) within this renderstate function, but it still doesn''t work.

Any help would be appreciated.

The testers have found this problem on the following cards:-

Diamond Viper 330 (4MB AGP)
Video Logic Grafix Star 560 (4MB - AGP)

and I have managed to get this problem on my RagePro card.

They also state that they have downloaded the latest drivers for the cards and the problems persist.

Is there anything I can try to get around this?

Thanks for any help received!

Cheers,
Taz.


---------------------------------
Tarique Naseem
Technical Director
Maelstrom Virtual Productions Ltd.
http://www.maelstrom.com
---------------------------------Tarique NaseemCTOVRX Technologies Ltd.http://www.vrxtechnologies.com
This doesn''t sound like anything you or I can fix. Maybe those cards just don''t support color fogging with alpha blending. It is easier to fog to black since you just decrease the color values at each vertex.

Making an option in your application to disable fog is probably all you can do.

Chris
Author of Power Render (http:/www.powerrender.com)

This is basically what I have told them. Let''shope they fall for it and pay the last installment for the project.

---------------------------------Tarique NaseemCTOVRX Technologies Ltd.http://www.vrxtechnologies.com

This topic is closed to new replies.

Advertisement