wined3d: Implement vertex fog with pixel shaders

H. Verbeet hverbeet at
Fri Mar 16 07:42:16 CDT 2007

On 16/03/07, Fabian Bieler <der.fabe at> wrote:
> The clamping I removed in the vertexshader is not required:
> If we use opengl's fixed function rasterization pipeline in combination with a
> vertexshader the shader should pass the fog coordinate to the rasterizer
> (which is there used as input for the fog equation and clamped afterwards,
> regardless of the fog hint).
That's not true.

> The clamping I added in the fragmentshader is required:
> For one, I use it to disable fog to avoid shader recompilation or 2 gl shaders
> per d3d shader. Also, the value has to be clamped before mixing, as values
> outside of [0:1] result in bogus data.
Well, I think you should verify what fixed function passes to the
fragment shader in those cases.

On 16/03/07, Stefan Dösinger <stefandoesinger at> wrote:
> Am Freitag 16 März 2007 00:09 schrieb Fabian Bieler:
> This patch breaks the Dolphin DirectX8 sdk demo. It shows up completely
> blue(the fog color).
That's because the vertex shader should clamp fog coordinates :-)

More information about the wine-devel mailing list