Problem with Pixel Fog 
Author Message
 Problem with Pixel Fog

I have a problem when trying to define the start and end
of the pixel fog.

I setup the fog with the following lines (more or less):

g_dev.SetRenderState D3DRS_FOGENABLE, 1
g_dev.SetRenderState D3DRS_FOGTABLEMODE, D3DFOG_LINEAR
g_dev.SetRenderState D3DRS_FOGSTART, Start
g_dev.SetRenderState D3DRS_FOGEND, End

But the problem is that when I'm using Z-Based Depth, I
have to define "Start" and "End" between 0.0 and 1.0. The
SetRenderState function only accept a long as parameter,
so I can only set 0 or 1. I've found a help function
(FtoDW) which it's said to encapsulate a float into a
long, but neither this way the results are as expected.

I've also tried to use Vertex Fog, but when rendering in
software, the text using g_d3dx.DrawText doesn't appear in
the color I defined, but does in the color of the fog.
I've been told that this is problem can be solve changing
the scale of all the objects, but I don't know if I should
make everything smaller of bigger. Now, I'm using a space
more or less between 0 and 900.

If someone have any idea about what can be the problem,
please, don't hesitate and tell it to me.

Thanks in advance.

       Hugo Marquez



Sun, 22 Aug 2004 17:51:04 GMT  
 Problem with Pixel Fog

Quote:
> SetRenderState function only accept a long as parameter,
> so I can only set 0 or 1. I've found a help function
> (FtoDW) which it's said to encapsulate a float into a

D3DRS_FOGSTART and D3DRS_FOGEND do expect
floats, so you need to use the FtoDW helper function when
setting these render states. Other than this, your code looks
to be OK.

Quote:
> long, but neither this way the results are as expected.

Pixel fog implementations are driver specific, not sure there is
a real standard of what can be expected.

Quote:
> I've also tried to use Vertex Fog, but when rendering in
> software, the text using g_d3dx.DrawText doesn't appear in
> the color I defined, but does in the color of the fog.

You could turn the fog off, before rendering your text, then turn
it back on for the next pass.

--
Eric DeBrosse
http://www.blown.com/dx/
Microsoft Visual Basic 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.



Mon, 23 Aug 2004 00:43:51 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Fog Problems of certain view angles

2. PIXELS, PIXELS, PIXELS

3. create fog on a stills picture

4. Fog in VB DX8

5. Pixel by Pixel Scrolling in QBasic

6. Rotate one pixel around another pixel...

7. BMP output mapping BMP-pixel to printer-pixel 1:1

8. Print PicBox pixel by pixel?

9. How to change True color pixel to 256 color pixel, @Thanks

10. full screen graphics, pixel by pixel control

11. Problem capturing pixels

12. More on my pixel scrolling problem

 

 
Powered by phpBB® Forum Software