sega/model2: new trilinear implementation, add support for microtextures #14433
+226
−155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.




The new trilinear implementation runs about 40% faster than the current one; most of the performance improvement comes from avoiding the slow
log2f()function and also only fetching a second bilinear texel when required.As well as running faster, the new implementation is a lot more accurate. For example, on the course select screen in Daytona USA, the maps morph into detail the same way they do on real hardware: https://youtu.be/R-4OZWhTWm0
The log table RAM has been hooked up and is used to calculate the mipmap level in conjunction with the per-pixel value of log2(z^2).
The dpdy parameter added to poly.h with the original trilinear implementation has been removed, as the new implementation does not require it.