Dan
28-09-2005, 07:33 AM
I'm using Clootie's headers for D3D in Delphi
and was trying to make fog (just a simple linear fog)
but it just won't appear...
Here's what I did:
var
fogStart, fogEnd: single;
...
Device.SetRenderState(D3DRS_FOGENABLE, ITRUE);
Device.SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_LINEAR);
Device.SetRenderState(D3DRS_FOGCOLOR, $00ff0000);
Device.SetRenderState(D3DRS_FOGSTART, PDWORD(@fogStart)^);
Device.SetRenderState(D3DRS_FOGSTART, PDWORD(@fogEnd)^);
After this the geometry is rendered normally without any fog... :roll:
//edit: D3DRS_FOGSTART twice!!! How could I be so stupid :D !!!
and was trying to make fog (just a simple linear fog)
but it just won't appear...
Here's what I did:
var
fogStart, fogEnd: single;
...
Device.SetRenderState(D3DRS_FOGENABLE, ITRUE);
Device.SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_LINEAR);
Device.SetRenderState(D3DRS_FOGCOLOR, $00ff0000);
Device.SetRenderState(D3DRS_FOGSTART, PDWORD(@fogStart)^);
Device.SetRenderState(D3DRS_FOGSTART, PDWORD(@fogEnd)^);
After this the geometry is rendered normally without any fog... :roll:
//edit: D3DRS_FOGSTART twice!!! How could I be so stupid :D !!!