Skip to content

Commit

Permalink
Perspective correct texturing
Browse files Browse the repository at this point in the history
- replace calls to glOrtho with new matrix (z value becomes w)
- store w value for each vertex
- if any vertex does not have a w value set whole polygon to 1.0
- Reset vertex between draw calls to prevent stale w values persisting

- validate PGXP values using stored copy of original (allow greater variance)
- properly convert addresses before passing to plugin
- rework memory to use a single pool with offsets

- Implement floating point RTPS/RTPT transform, currently disabled.
  • Loading branch information
iCatButler committed Apr 27, 2016
1 parent 580df75 commit 153c8eb
Show file tree
Hide file tree
Showing 10 changed files with 321 additions and 127 deletions.
2 changes: 1 addition & 1 deletion libpcsxcore/gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void psxDma2(u32 madr, u32 bcr, u32 chcr) { // GPU
#endif
break;
}
GPU_pgxpMemory(madr, PGXP_GetMem());
GPU_pgxpMemory(PGXP_ConvertAddress(madr), PGXP_GetMem());
GPU_writeDataMem(ptr, size);

#if 0
Expand Down
8 changes: 6 additions & 2 deletions libpcsxcore/gte.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ int docop2(int op) {

PGXP_pushSXYZ2s(Lm_G1_ia((s64)OFX + (s64)(IR1 * h_over_sz3) * (Config.Widescreen ? 0.75 : 1)),
Lm_G2_ia((s64)OFY + (s64)(IR2 * h_over_sz3)),
SZ3);
SZ3, SXY2);

//PGXP_RTPS(0, SXY2);

MAC0 = F((s64) DQB + ((s64) DQA * h_over_sz3));
IR0 = Lm_H(m_mac0, 1);
Expand Down Expand Up @@ -889,7 +891,9 @@ int docop2(int op) {

PGXP_pushSXYZ2s(Lm_G1_ia((s64)OFX + (s64)(IR1 * h_over_sz3) * (Config.Widescreen ? 0.75 : 1)),
Lm_G2_ia((s64)OFY + (s64)(IR2 * h_over_sz3)),
SZ3);
SZ3, SXY2);

//PGXP_RTPS(v, SXY2);
}

MAC0 = F((s64) DQB + ((s64) DQA * h_over_sz3));
Expand Down
Loading

0 comments on commit 153c8eb

Please sign in to comment.