mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 11:24:27 +01:00
SoftGPU: Quantize fog per vertex, like the GE
The GE converts the fog factor to 8 bits per vertex, min(floor(256 * f), 255), and interpolates that linearly in screen space. Clamping after interpolation instead was up to 127 levels off on triangles that cross the fog range. Measured with gpu/probe; points and wacky values still match exactly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4582308cbf
commit
2e77b62207
3 files changed
+19
-3
No files matched your search
@@ -523,7 +523,7 @@ ClipVertexData TransformUnit::ReadVertex(const VertexReader &vreader, const Tran
|
||||
}
|
||||
|
||||
if (state.enableFog) {
|
||||
vertex.v.fogdepth = Dot43(state.posToFog, pos);
|
||||
vertex.v.fogdepth = GEFogFactor(Dot43(state.posToFog, pos)) * (1.0f / 256.0f);
|
||||
} else {
|
||||
vertex.v.fogdepth = 1.0f;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user