Home | History | Annotate | Download | only in swrast

Lines Matching refs:Fog

35  * Used to convert current raster distance to a fog factor in [0,1].
42 switch (ctx->Fog.Mode) {
44 if (ctx->Fog.Start == ctx->Fog.End)
47 d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
48 f = (ctx->Fog.End - z) * d;
51 d = ctx->Fog.Density;
56 d = ctx->Fog.Density;
61 _mesa_problem(ctx, "Bad fog mode in _swrast_z_to_fogfactor");
85 * Template code for computing fog blend factor and applying it to colors.
87 * \param COMPUTE_F code to compute the fog blend factor, f.
125 * Apply fog to a span of RGBA pixels.
126 * The fog value are either in the span->array->fog array or interpolated from
127 * the fog/fogStep values.
128 * They fog values are either fog coordinates (Z) or fog blend factors.
140 /* compute (scaled) fog color */
142 rFog = ctx->Fog.Color[RCOMP] * 255.0F;
143 gFog = ctx->Fog.Color[GCOMP] * 255.0F;
144 bFog = ctx->Fog.Color[BCOMP] * 255.0F;
147 rFog = ctx->Fog.Color[RCOMP] * 65535.0F;
148 gFog = ctx->Fog.Color[GCOMP] * 65535.0F;
149 bFog = ctx->Fog.Color[BCOMP] * 65535.0F;
152 rFog = ctx->Fog.Color[RCOMP];
153 gFog = ctx->Fog.Color[GCOMP];
154 bFog = ctx->Fog.Color[BCOMP];
158 /* The span's fog values are fog coordinates, now compute blend factors
159 * and blend the fragment colors with the fog color.
161 switch (ctx->Fog.Mode) {
164 const GLfloat fogEnd = ctx->Fog.End;
165 const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
166 ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
185 const GLfloat density = -ctx->Fog.Density;
204 const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
222 _mesa_problem(ctx, "Bad fog mode in _swrast_fog_rgba_span");
227 /* The span's fog start/step/array values are blend factors in [0,1].