Fog Problems of certain view angles 
Author Message
 Fog Problems of certain view angles

To clarify, I forgot to say that the code snippet I used starts with the fog
turned off (improperly commented as true). At another point in the program I
turn it on with
g_dev.SetRenderState D3DRS_FOGENABLE, 1 ' True

Quote:
> On certain camera view angles (as I rotate the camera) my scene turns off
> the fog, but only on two or three angles within a complete rotation. All
> else in the scene appears normal, and these view angles appear normal with
> the fog turned off. Is this a bug in dx, or are there some settings to
tweak
> that might fix it.

> I'm using the fog settings from the Dolphin project as follows:

> Dim fFogStart  As Single
> Dim fFogEnd As Single
> fFogStart = 1
> fFogEnd = 15

> g_dev.SetRenderState D3DRS_FOGENABLE, 0 ' True
> g_dev.SetRenderState D3DRS_FOGCOLOR, WATER_COLOR
> g_dev.SetRenderState D3DRS_FOGTABLEMODE, D3DFOG_NONE
> g_dev.SetRenderState D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR
> g_dev.SetRenderState D3DRS_RANGEFOGENABLE, 0 'False
> g_dev.SetRenderState D3DRS_FOGSTART, FtoDW(fFogStart)
> g_dev.SetRenderState D3DRS_FOGEND, FtoDW(fFogEnd)

> Thanks, Randy W



Fri, 15 Apr 2005 13:33:46 GMT  
 Fog Problems of certain view angles
Taken directly from the SDK documentation:

Sometimes, using fog can introduce graphic artifacts that cause objects to
be blended with the fog color in nonintuitive ways. For example, imagine a
scene in which there are two visible objects: one distant enough to be
affected by fog, and the other near enough to be unaffected. If the viewing
area rotates in place, the apparent fog effects can change, even if the
objects are stationary.
Range-based fog is another, more accurate, way to determine the fog effects.
In range-based fog, Direct3D uses the actual distance from the viewpoint to
a vertex for its fog calculations. Direct3D increases the effect of fog as
the distance between the two points increases, rather than the depth of the
vertex within in the scene, thereby avoiding rotational artifacts.

Finally, you should check the caps of your hardware to make sure the fogging
methods you use are supported.

--
Eric DeBrosse
http://www.mvps.org/vbdx/
Microsoft DirectX MVP

The opinions expressed in this message are my own personal views and
do not reflect the official views of Microsoft Corporation. The MVP program
does not constitute employment or contractual obligation with Microsoft.


Quote:
> To clarify, I forgot to say that the code snippet I used starts with the
fog
> turned off (improperly commented as true). At another point in the program
I
> turn it on with
> g_dev.SetRenderState D3DRS_FOGENABLE, 1 ' True


> > On certain camera view angles (as I rotate the camera) my scene turns
off
> > the fog, but only on two or three angles within a complete rotation. All
> > else in the scene appears normal, and these view angles appear normal
with
> > the fog turned off. Is this a bug in dx, or are there some settings to
> tweak
> > that might fix it.

> > I'm using the fog settings from the Dolphin project as follows:

> > Dim fFogStart  As Single
> > Dim fFogEnd As Single
> > fFogStart = 1
> > fFogEnd = 15

> > g_dev.SetRenderState D3DRS_FOGENABLE, 0 ' True
> > g_dev.SetRenderState D3DRS_FOGCOLOR, WATER_COLOR
> > g_dev.SetRenderState D3DRS_FOGTABLEMODE, D3DFOG_NONE
> > g_dev.SetRenderState D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR
> > g_dev.SetRenderState D3DRS_RANGEFOGENABLE, 0 'False
> > g_dev.SetRenderState D3DRS_FOGSTART, FtoDW(fFogStart)
> > g_dev.SetRenderState D3DRS_FOGEND, FtoDW(fFogEnd)

> > Thanks, Randy W



Sat, 16 Apr 2005 02:26:36 GMT  
 Fog Problems of certain view angles
For those who are interested, this problem was due to the size of the water
surface faces which made these glow brighter at certain view angles when fog
was turned on. Using more and smaller faces solved it. Fog range had no
effect.

Quote:
> On certain camera view angles (as I rotate the camera) my scene turns off
> the fog, but only on two or three angles within a complete rotation. All
> else in the scene appears normal, and these view angles appear normal with
> the fog turned off. Is this a bug in dx, or are there some settings to
tweak
> that might fix it.

> I'm using the fog settings from the Dolphin project as follows:

> Dim fFogStart  As Single
> Dim fFogEnd As Single
> fFogStart = 1
> fFogEnd = 15

> g_dev.SetRenderState D3DRS_FOGENABLE, 0 ' True
> g_dev.SetRenderState D3DRS_FOGCOLOR, WATER_COLOR
> g_dev.SetRenderState D3DRS_FOGTABLEMODE, D3DFOG_NONE
> g_dev.SetRenderState D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR
> g_dev.SetRenderState D3DRS_RANGEFOGENABLE, 0 'False
> g_dev.SetRenderState D3DRS_FOGSTART, FtoDW(fFogStart)
> g_dev.SetRenderState D3DRS_FOGEND, FtoDW(fFogEnd)

> Thanks, Randy W



Tue, 19 Apr 2005 00:01:05 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem with Pixel Fog

2. Help! Hiding only certain columns in list view

3. create fog on a stills picture

4. Fog in VB DX8

5. procedure to find certain files from a certain date on harddisk

6. Number of certain records problem...

7. Problems displaying certain data in Crystal Reports 3.0.

8. Know problem with VB4-16bit / Win95 / Shell / and certain OCX's

9. Draw Text on an angle

10. change the angle of a control in the form

11. angle bouncing?

12. (random) angle bouncing?

 

 
Powered by phpBB® Forum Software