Hi all

I'm implementing vertex fog, but it's not working correctly.
Here is my code:

[pascal]
fogstart := 1;
fogend := 5;
with fD3DDevice do
begin
SetRenderState(D3DRS_FOGENABLE,1);
SetRenderState(D3DRS_RANGEFOGENABLE,1);
SetRenderState(D3DRS_FOGCOLOR,D3DCOLOR_XRGB(128,12 8,12);
SetRenderState(D3DRS_FOGVERTEXMODE,D3DFOG_LINEAR);
SetRenderState(D3DRS_FOGSTART,PDWORD(@FogStart)^);
SetRenderState(D3DRS_FOGEND,PDWORD(@FogEnd)^);
end;
[/pascal]

I have tried many value's for fogstart and fogend. When the values are too high, the whole scene was rendered without fog and when i set the too low, the whole scene was rendered gray.

When i finetuned the values, the scene was fogged but all objects (far and near) were fogged with the same density/value/grayness.
When i used values (1,1.5) the fog seemed to look better.
The only problem was that the position of the clear circle was the area pointed by the lookat vector of my camera.
So i can see a circle of my scene with fog around it.
the camera must be IN that circle and must not look at it... it just drives me crazy. :x

Can a weird camera setting be the cause of this, or some wierd matrices. Or are my fog settings wrong

Can someone help me out?? :?

{maybe i can post some pics later}