diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-03-26 18:05:36 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-03-26 18:05:36 +0000 |
commit | f132413965a49c0554988a88edb8b101de657493 (patch) | |
tree | f0fa9cbeaad2ec5545673c989a6c6c9ea7301eca /progs/demos | |
parent | 04800374eef6eb906203e8721a2b8b208af2486f (diff) |
clamp BiasMin, BiasMax to reasonable values
Diffstat (limited to 'progs/demos')
-rw-r--r-- | progs/demos/lodbias.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c index bee06da80b..a9b5312fd7 100644 --- a/progs/demos/lodbias.c +++ b/progs/demos/lodbias.c @@ -252,6 +252,14 @@ static void Init( void ) printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias); BiasMin = -100 * maxBias; BiasMax = 100 * maxBias; + + /* Since we have (about) 8 mipmap levels, no need to bias beyond + * the range [-1, +8]. + */ + if (BiasMin < -100) + BiasMin = -100; + if (BiasMax > 800) + BiasMax = 800; } |