mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
use FABSF(fogCoord) to fix fog calculation problem (Soju Matsumoto)
This commit is contained in:
parent
730fabd67a
commit
ea28a5b5b3
1 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
|
@ -109,7 +109,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
|
|||
GLuint i;
|
||||
for (i = 0; i < span->end; i++) {
|
||||
GLfloat f, oneMinusF;
|
||||
f = (fogEnd - fogCoord / w) * fogScale;
|
||||
f = (fogEnd - FABSF(fogCoord) / w) * fogScale;
|
||||
f = CLAMP(f, 0.0F, 1.0F);
|
||||
oneMinusF = 1.0F - f;
|
||||
rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
|
||||
|
|
@ -130,7 +130,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span )
|
|||
GLuint i;
|
||||
for (i = 0; i < span->end; i++) {
|
||||
GLfloat f, oneMinusF;
|
||||
f = (GLfloat) exp(density * fogCoord / w);
|
||||
f = (GLfloat) exp(density * FABSF(fogCoord) / w);
|
||||
f = CLAMP(f, 0.0F, 1.0F);
|
||||
oneMinusF = 1.0F - f;
|
||||
rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue