Commit Graph

156 Commits

Author SHA1 Message Date
Flyinghead e54ac36544 Texture cache optimization for frequent palette updates
Some old 2D games change palettes very frequently, which causes the
texture to be updated for each render.
This change uses a hash of the palette to detect changes, and include
the palette type in the cache key to distinguish textures of different
depth.
2018-09-06 12:11:55 +02:00
Flyinghead 4a08856775 Render-to-texture upscaling must be accounted for when clipping 2018-09-05 15:07:30 +02:00
Flyinghead f202b3b143 Add new ExtraDepthScale setting to scale huge Z values.
Use 1e26 for Samurai Shodown 6 (NAOMI)
2018-09-04 18:37:59 +02:00
Flyinghead 239e178226 Simplify framebuffer drawing and fix OSD 2018-09-03 15:05:37 +02:00
Flyinghead 228b40136f Only do color clamp when fog is on 2018-09-02 22:57:59 +02:00
Flyinghead 96e9bce0e0 (Fog) Color clamping support 2018-09-01 12:56:37 +02:00
Flyinghead e59d7eaf3d Direct framebuffer writes support 2018-08-26 16:58:10 +02:00
Flyinghead ba78184461 Fix per-polygon sort option 2018-08-20 15:51:55 +02:00
Flyinghead ffb25a470d Fix Wacky Races missing half screen 2018-08-17 18:33:24 +02:00
Flyinghead f3bbb06d8c GL: Missing float precision qualifier in Bump Map calc 2018-08-13 18:21:52 +02:00
Flyinghead 65a759b3fe Merge branch 'fh/mymaster' of https://github.com/reicast/reicast-emulator into fh/mymaster 2018-08-07 09:45:10 +02:00
Flyinghead c0c06ed8ff Renderer: select shader at runtime based on the GL context version
The GL renderer now detects the version of the current GL context and
compiles the shaders accordingly. Supports GLES2, GLES3 and desktop GL.
Android: use 8,8,8 framebuffer instead of 5,6,5. Requests a 8-bit
stencil buffer (modifier volumes)
2018-08-07 09:44:52 +02:00
Flyinghead 7ff93f9256 OSX: disable OpenMP as it's not available. Time to deprecate Apple... 2018-08-04 19:10:53 +02:00
Flyinghead fddf56c5a2 Fix TA overrun detection. Bump up verts to 2 MB, idx to 120K and TR
polys to 8K
2018-08-03 09:55:53 +02:00
Flyinghead feaca43b25 Build fixes 2018-08-02 18:44:51 +02:00
Flyinghead 85781e96ec Use OpenMP instead of ctpl for multithreading 2018-08-02 17:31:38 +02:00
Flyinghead 3a7a08f3fb Do not clear the framebuffer before rendering. Fix scissoring coords.
The framebuffer is cleared by the background plane using global clipping
coordinates. This allows multiple rendering to different locations on
the framebuffer.
Fixes flashing menus in Vanishing Point, loading screens in Test Drive
Le Mans and Vigilante 8.
Better rear view mirror in Metropolis Street Racer.
2018-08-02 17:20:18 +02:00
Flyinghead 31d8c1f091 Backport texture upscaling with xBRZ 2018-08-01 19:43:01 +02:00
Flyinghead 1533091151 Clipping: do pixel scaling only when not rendering to a texture 2018-07-30 18:57:32 +02:00
Flyinghead 63a70e0f62 isinf not available in GLES 2 2018-07-29 19:24:14 +02:00
Flyinghead 0e881254ef Fix clipping when pixel_double is on.
Fixes 4 Wheel Thunder split screen issue.
2018-07-29 17:31:14 +02:00
Flyinghead b1686a8f6a Do not allow inf z value in the vertex shader. Clamp w to a very small value.
Fixes ground triangles clipping in Soulcalibur intro sequence.
2018-07-24 16:55:48 +02:00
Flyinghead 07a36ee256 avoid named struct initializers 2018-07-24 11:22:56 +02:00
Flyinghead 09eab8cb03 Saturate alpha channel for YUV textures 2018-07-18 22:35:55 +02:00
Flyinghead e637dcf8f9 reinstate line deleted by previous commit 2018-07-18 16:07:17 +02:00
Flyinghead cc8569fcf8 Fix 8888 high-quality textures on GLES/arm
GLES doesn't support uint 8888 so bytes must be swapped on little endian
architecture.
2018-07-18 16:01:40 +02:00
Flyinghead dc835dd64d Dump shaders source if compile fails 2018-07-16 16:52:11 +02:00
Flyinghead 0284d635d2 Upscale rendered-to textures
Increase the size of RTT textures by a given integer factor. Defaults to
1.
This gives much better quality textures, particularly visible when used
fullscreen for transition or pause screens.
2018-07-16 16:28:48 +02:00
Flyinghead bb2d860902 Use red channel for fog table in GL but continue using alpha channel in
GLES. Alpha channel is supported only in GL compat mode, not core.
2018-07-14 10:48:16 +02:00
Flyinghead 87f8c5194f Better fix for texture cache key needing StrideSel
StrideSel and ScanOrder are no longer part of the texture cache key
since that breaks RTT texture matching. But they are updated at lookup
time so they will be used if the tex is updated later.
Fixes RTT-based xfade screens in Skies of Arcadia.
2018-07-11 22:08:10 +02:00
Flyinghead d5d711cf32 Clipping scissor fix: x offset must only be added once 2018-07-11 20:06:43 +02:00
Flyinghead 1be4203ffe Far plane is at depth 0 in classic renderer. 2018-07-09 23:25:18 +02:00
Flyinghead c035635341 Clipping scissor Y coordinates must be inverted when rendering to screen
Fixes top of screen missing in San Francisco Rush 2049
2018-07-09 23:22:13 +02:00
Flyinghead 889f722e73 Fix PAL4 textures 2018-07-09 19:20:33 +02:00
Flyinghead 18b2d8273f Improve paletted and YUV texture quality.
Paletted textures using a 32-bit palette and YUV textures are now
converted to 8888 format, which results in a lossless conversion.
Fixes background texture quality in Alone in the Dark.
2018-07-09 14:59:53 +02:00
Flyinghead a89ff1e432 Ignore depth func for autosort TR polys.
This was a remain of the previous Always depth hack.
2018-07-07 08:46:29 +02:00
Flyinghead e067534f26 When sorting translucent triangle, keep the third vertex in place.
In flat shading mode, the third vertex of a triangle defines its color
so we must maintain its index.
Fixes the remaining color polygons seen in Evolution - The World of
Sacred Device.
2018-07-06 20:02:43 +02:00
Flyinghead a1997637bb Trilinear filtering limited implementation.
Fixes lighter field areas in NFL 2K2
2018-07-03 20:36:13 +02:00
Flyinghead 3c4913a35a Merge remote-tracking branch 'upstream/master' 2018-07-03 15:46:25 +02:00
Flyinghead 69263eddc0 Bump mapping support 2018-07-02 15:23:47 +02:00
Flyinghead 295395c680 Flat shading support 2018-07-01 20:25:06 +02:00
Flyinghead 3ddcc272bf Fix autosort/presort mode selection. Per render pass sort mode.
The previous algorithm to determine the sort mode for TR polys was
faulty. And the sort mode can vary between passes for multipass
rendering. This also removes the need for the hack to support Always
depth mode with autosorted TR polys. Should fix the Resident Evil 3 menu
problem.
2018-06-30 12:33:11 +02:00
Flyinghead 7ecd384612 StrideSel is now part of the texture cache and must be set by RTT 2018-06-29 19:03:43 +02:00
Flyinghead f18aa63a67 Add stride and scan order to texture cache key as they are used to update the texture
Fixes glitchy FMV title screen in Bomberman Online
2018-06-29 11:59:48 +02:00
Flyinghead a94f01ee78 Force autosort TR triangles using depth func Always to be drawn on top of others
When autosorting triangles, ignore the depth of triangles using the depth func Always and force
them to be on top. Seems to help Psyvariar 2.
2018-06-28 13:21:40 +02:00
Flyinghead 6871061ca0 Modifier Volumes: summing up with triangles is faster than using a quad. 2018-06-26 15:38:55 +02:00
Flyinghead 7c93727b5e Improve modifier volume parsing and drawing logic.
Parse modifier volumes similarily to other polys (first, count, params).
Draw all triangles in one shot and use quad to sum up instead of
redrawing entire strip. Use OR operation for open volumes/quads
(Soulcalibur).
2018-06-26 14:45:58 +02:00
Flyinghead 846d02d9d2 Optimize RTT to VRAM. Add US version of THPS2 to per-game settings. 2018-06-25 16:55:22 +02:00
Flyinghead 3256e02813 Workaround for Virtua Tennis ball color problem.
There's a texture corruption of the tennis ball and other textures,
notably the players' bags in the first intro sequence. The corruption is
due to render to texture squashing existing textures. Not sure what's
going on but this avoids the texture corruption. The original problem
remains.
2018-06-25 15:53:28 +02:00
Flyinghead 08b8d30589 Implement clipping. Enabled by default. 2018-06-09 18:11:47 +02:00