Commit 32d40f7
committed
Improve fog vertex interpolation
The old var_TexCoords.t (fraction of distance between viewer and vertex
inside fog) was a ratio which does not give the correct
result when linearly interpolating between vertexes. Use instead the
previous numerator of that fraction, which gives a true result when
linearly interpolated.
Effects:
- Reduces the extent of artifacts at the intersection of the fog
plane and a model (when viewed from inside the fog).
- Models that use larger triangles (more than a few qu) look better.
- Incorrectly set up fog volumes which can be entered from more than one
plane can now be rendered when viewed from the opposite side of the
designated fog plane. For example Pulse, 2609 -4097 -2109 -1 4
- The edges of BSP surfaces near the fog plane are slightly more fogged
when viewed from outside the fog. (Not clearly good or bad.)1 parent f812b98 commit 32d40f7
File tree
2 files changed
+20
-26
lines changed- src/engine/renderer/glsl_source
2 files changed
+20
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
40 | 52 | | |
41 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
105 | 87 | | |
106 | 88 | | |
107 | 89 | | |
| |||
0 commit comments