mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 19:34:39 +01:00
SoftGPU: Clip vertex texture coordinates in GE arithmetic
The near-plane clipper's new vertices get their texture coordinates with the same float24 arithmetic as their position, not a float lerp. Fixes the texel ties under a clipped fan in a GTA frame dump (gpu/probe exp136; clipped colors and fog still differ). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b10ab1d4aa
commit
700a314542
1 file changed
+5
@@ -339,6 +339,11 @@ void ProcessTriangle(const ClipVertexData &v0, const ClipVertexData &v1, const C
|
||||
const float t = TransformUnit::NearPlaneT(in.clippos, out.clippos);
|
||||
dest.Lerp(t, in, out);
|
||||
dest.clippos = TransformUnit::NearPlanePoint(in.clippos, out.clippos, t);
|
||||
// Texture coordinates go through the same arithmetic as the position (gpu/probe exp136).
|
||||
for (int c = 0; c < 3; ++c) {
|
||||
const float delta = TruncateToFloat24(GEAdd(out.v.texturecoords[c], -in.v.texturecoords[c]));
|
||||
dest.v.texturecoords[c] = TruncateToFloat24(GEAdd(ProductToFloat24((double)t * delta), in.v.texturecoords[c]));
|
||||
}
|
||||
bool outsideRange = false;
|
||||
dest.v.screenpos = TransformUnit::ClipToScreen(dest.clippos, &outsideRange);
|
||||
dest.v.clipw = dest.clippos.w;
|
||||
|
||||
Reference in new issue
Block a user