Did you check if the clamping is required?
On Friday 16 March 2007 08:40, H. Verbeet wrote:
Did you check if the clamping is required?
Which clamping do you mean, the clamping in the vertexshader I removed or the clamping in the fragmentshader I added?
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). If we use use a fragmentshader, the blending factor is clamped by it.
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.
Fabian
On 16/03/07, Fabian Bieler der.fabe@gmx.net 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@gmx.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 :-)