Nico de Poel
de12999cbb
Minor rearrangement for "readability"
3 years ago
Nico de Poel
2a3a8108f3
Removed the nop's before the INTPL instruction as they don't seem to be necessary.
Real hardware is fine with this too.
3 years ago
Nico de Poel
abc328430c
Undid some of the rearrangement that made the code not want to run on real hardware.
Doesn't make any difference for the optimizations made so far.
3 years ago
Nico de Poel
4e39f28228
Made use of the fact that we use monochrome lighting to combine light and UVs into a single lerp
3 years ago
Nico de Poel
07f87c4ca2
Made a custom vertex lerp macro using pure GTE assembly code
3 years ago
Nico de Poel
909b32f4c0
Some rearrangement that will hopefully allow single light values to be lerped right alongside UVs, saving on one lerp per vertex.
3 years ago
Nico de Poel
d7ec9a85a4
Interpolate vertex color and UV values using GTE instructions as well
3 years ago
Nico de Poel
cdc205f59a
First successful experiment with vertex interpolation using GTE intpl instructions.
3 years ago
Nico de Poel
7888f44bb8
Revert "Intersperse GTE instructions with vertex lerping and quad building code to mask load/store delays."
This reverts commit 4f886bd40c .
Rolling back to simpler code to facilitate conversion to GTE interpolation.
3 years ago
Nico de Poel
4f886bd40c
Intersperse GTE instructions with vertex lerping and quad building code to mask load/store delays.
Makes a noticeable difference in drawing performance.
3 years ago
Nico de Poel
e0e43d6e39
Reordered some vertex code to allow for optimized GTE load/stores
3 years ago
Nico de Poel
58b2e8dc20
Wrapped vertex copying code into a macro to make the quad drawing code more readable.
Added some generic n-bit blitting macros and started using them.
3 years ago
Nico de Poel
02b19a67dc
First implementation of near-camera polygon tessellation, which surprisingly actually worked on the first try!
Currently still rather inefficient, making no use of GTE for interpolation yet. Still only one tessellation level too.
3 years ago
Nico de Poel
5442b2d4c9
Added a draw function for flat colored quads, useful for debugging
3 years ago
Nico de Poel
21101b3287
Added a special case for drawing faces that are single triangles.
This is just as fast in DuckStation and shows a small performance increase on real hardware, so worth the effort.
3 years ago
Nico de Poel
de12e4269f
Minor stuff
3 years ago
Nico de Poel
32237fc6ec
Fixed a few issues and further optimized the quad drawing code.
3 years ago
Nico de Poel
4f2d70cc82
Added some macros to make the optimized drawing code more readable, and applied the same optimization to water drawing.
3 years ago
Nico de Poel
74a36f0938
Found a 10% performance boost by simply reordering data access when filling in polygon data, and by blitting UV and RGB values with a single copy.
3 years ago
Nico de Poel
542a81b68c
Draw lava, slime and teleporters as liquids, but not transparent.
3 years ago
Nico de Poel
314b52e99e
Added a separate CLUT for transparent surfaces, and set semi-transparency mode on water polygons.
3 years ago
Nico de Poel
ae080953f7
Rewrote the other face drawing functions to ditch the vertex copying stage too.
3 years ago
Nico de Poel
be7eb87685
Ditched the copy-to-scratch-RAM step for drawing textured faces, which apparently is no longer needed to run on real hardware.
Simpler code, less work to do, better performance. An all-round win.
3 years ago
Nico de Poel
a8d3bf567b
First pass at leaf-based rendering order:
- Sort leafs first into a linked list, before drawing their faces
- Depth value for faces is determined by the leaf order, OT position is calculated once per leaf
- Removes the need for per-primitive depth calculation & check, so those are removed
- Moved primitive buffer check out of the primitive drawing routines and to the start of each face drawing function
- Triangle drawing routines now only draw a single triangle, no loops involved
- Simplified drawing routines where possible
- Face drawing is still happening in back-to-front order, so this needs another good look at
3 years ago
Nico de Poel
812bcb6a63
Some micro-optimizations in the face drawing code. The PS1 really does favor simple counters over pointer arithmetic.
3 years ago
Nico de Poel
85a8b332c5
Some reorganization of face drawing code; allow better separation between drawing methods, and require the "enable texturing" check only once ahead of drawing.
3 years ago
Nico de Poel
c9bee9d500
Draw water surfaces as unlit textured polygons
3 years ago
Nico de Poel
73903474e4
Moved polygon drawing routines into a separate header file
3 years ago