ATI_fragment_shader + fog

When using ATI_fragment_shader with fogging, I don’t see any fog.(Radeon 9700 with Cat3.6 Win2K) Is this expected behaviour? (Nvidia’s register combiners still allow for fog as a post operation)

I am aware that ARB_fragment_program requires you to specify the fogging option in the program.(Perhaps in the 9700 driver ATI_fragmnet_shader uses this code path?)

I would like to use the same code-path for all ATI cards (8500/9000/9700) so I am curious why this does not work. (I cannot test the older cards at the moment- another ATI bug is causing a lockup)

Fog operations must be performed manually, just like for NV_register_combiner (though it gives you a specific place for it). You can get the fog coordinate and fog colors, but you have to actually perform the fog computations yourself.

Sorry Korval, but my understanding is that the fog computations (the e^(-f*d) stuff) are done in fixed function for register combiners. (You then just decide how the fog is applied with it’s color)

I just worked around the ATI bug on my 8500 and fogging is working as expected with ATI_fragment_shader. (ie. the fogging factor is calculated and blended with the result of the shader) Now the only issue is that the same code path does not produce fogging with the 9700.

The fragment shader stage replaces the texturing stage. Color sum and fog are still applied after fragment shading. At least, it should (according to the specification).

sqrt[-1],

I’m having the same problems. No fog on a 9500Pro w active ATI_fragment_shader. This exact same code has been working sometime in the past.

Fog shows up just fine if I resort to ARB_texture_env_combine, but that’s obviously not a solution.

edit:
Using Cat 3.6
My R200 works as expected, same driver.
(Athlon XP, VIA Chipset, just tested Win98SE and Win2k with equal results)

[This message has been edited by zeckensack (edited 08-12-2003).]

Probably a driver bug then.
And so the standard reply: email devrel@ati.com about it.

Done.

Sorry Korval, but my understanding is that the fog computations (the e^(-f*d) stuff) are done in fixed function for register combiners. (You then just decide how the fog is applied with it’s color)

Isn’t that what I said? “You can get the fog coordinate and fog colors, but you have to actually perform the fog computations yourself.” The fog coordinate being the interpolated, per-vertex fog coordinate, and the ‘fog computations’ being the actual use of the fog coordinate and color in determining the final pixel color.

Now the only issue is that the same code path does not produce fogging with the 9700.

Oh… Sounds like ATi just forgot to have their fragment shaders do that final computation on their newer hardware (as they are likely emulating ATI_fragment_shader with their newer, more powerful, version).

Originally posted by Korval:
Fog operations must be performed manually, just like for NV_register_combiner

If I understand this sentence like sqrt[-1], then you’re wrong.
The fragment shader stage does NOT take into account the fog contribution. It’s true for NV_rc, but not for ATI_fs

Exactly.

<…>
The fragment shader replaces the traditional texture environment by exposing a fragment shading model which provides a very general means of expressing fragment color blending and dependent texture address modification.

And that’s it. The extension spec doesn’t even contain the word “fog”.

[This message has been edited by zeckensack (edited 08-15-2003).]