1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 08:24:05 +00:00
Commit Graph

139 Commits

Author SHA1 Message Date
Amaro Martínez
d96c679436
Merge branch 'master' of https://github.com/gonetz/GLideN64 2022-03-14 00:45:28 -05:00
Sergey Lipskiy
342683d2c6 Allow to draw aux (not produced by gDPTextureRectangle) texrects
when current frame buffer is null.

Problem: FBInfo does not work when Aux buffer copy is enabled.
"Aux buffer copy" copies the buffer and removes it.
If aux buffer is the current one, the current buffer set to null.
FBinfo renders RDRAM buffer to the frame buffer using GraphicsDrawer::drawTexturedRect.
It does nothing if GraphicsDrawer::_canDraw() returns false.
_canDraw() returns false if current buffer is null.
Thus, pixels from RDRAM are not copied.

Solution: Always render aux texrects.
2022-02-20 11:16:49 +07:00
Blake Warner
0255e10db6 native port 2022-01-29 17:22:09 -05:00
Sergey Lipskiy
fd29c4386a Fix renderScreenSpaceTriangles when input vertices represent TRIANGLE_STRIP. 2022-01-16 17:24:49 +07:00
Sergey Lipskiy
21fe9d5f92 GraphicsDrawer::drawTexturedRect fixes:
* remove old hack for clamp/wrap tex coords. It seems that the hack is not necessary anymore.
necessary anymore.
* minor optimization for accurate texture path.
2021-12-05 15:18:00 +07:00
Sergey Lipskiy
46c58576e2 Code refactor. add calcShiftScaleS and calcShiftScaleT
Remove code duplication.
2021-11-06 17:14:24 +07:00
fzurita
3d5a39e647 Add a new "fast" shader path that doesn't use texelFetch in glsl 2021-10-17 10:27:44 -04:00
fzurita
f2a69be96f Remove CLIP control hack for GLES
It's not longer needed due to software vertex clipping.
2021-09-26 12:12:07 -04:00
s2s
7e8265bf20 Apply texture shift and offset on a per pixel basis. Clean texture engine code. 2021-07-29 14:06:33 +07:00
Sergey Lipskiy
66e8ff3c00 Drop render state after drawing a primitive, in gDPFullSync() and
GraphicsDrawer::copyTexturedRect to avoid wrong use of TexCoordBounds heuristics.

Fixed flickering in the starcraft intro when it transitions from picture to picture.
2021-06-06 18:57:33 +07:00
s2s
acfb569dea Use a 640x640 bounding box for screen coordinates.
A smaller bounding box allows rendering in higher resolutions. It should be made bigger if geometry is clipped.
2021-05-15 23:31:10 +07:00
s2s
acf26e613d Apply a vertex position or texture coordinate shift to approximate N64 rasterization rules 2021-04-19 21:55:00 +07:00
s2s
fe244c5560 Update widescreen hack 2021-04-19 21:55:00 +07:00
s2s
81318c5445 Use screen coordinates to render primitives 2021-04-19 21:55:00 +07:00
Sergey Lipskiy
e07b09b4d0 Add Statistics OSD info.
Show number of drawn rects, lines and triangles per frame.
2021-02-28 19:50:05 +07:00
Sergey Lipskiy
402cf6f8b6 Implement software vertex clipping. 2021-01-20 17:07:23 +07:00
Sergey Lipskiy
f9ef2bd8fb Remove old LLE code. 2020-12-27 21:48:45 +07:00
S2S
a214ab822e Standarize the number of barycentric coordinate vertex attributes.
Use only two coordinates as vertex attributes for triangles to match the number of coordinates rectangles use. The third one can be computed in the vertex shader.
2020-12-27 12:20:42 +07:00
S2S
486cf59614 Load barycentric coordinates as vertex attributes 2020-12-27 12:01:16 +07:00
fzurita
8f387f2d08 Enable blast corps hack for frame buffer fetch blending 2020-12-20 18:26:58 +07:00
Sergey Lipskiy
46c65776a0 Code refactor and cleanup:
* type cast fixes
* signed/unsigned fixes
* code formatting fixes
* class members initialization fixes
2020-11-14 16:54:28 +07:00
fzurita
f01405bc75 Implement N64 blending using framebuffer fetch extensions 2020-11-11 13:34:45 +07:00
S2S
65ad89ae3a Delay texcoord correction until multiplying by hdratio 2020-07-17 20:26:32 +07:00
Sergey Lipskiy
30e7b83e43 Correct GraphicsDrawer::_updateScreenCoordsViewport
Fixed starcraft intro movie in OnePiece bg mode.
2020-06-28 18:22:21 +07:00
Sergey Lipskiy
80b219effa Correct vertex Z calculation in GraphicsDrawer::_drawThickLine
Note: viewport transformation of Z coordinate performed in fragment shader.

Fixed #2237 Mario Artist - Polygon Studio: line3D bug (HLE)
2020-06-28 17:36:20 +07:00
Sergey Lipskiy
ed1648c438 Disable dual blending in Texrect Drawer Mode. 2020-06-14 11:51:33 +07:00
S2S
c48841cfeb Implement dual source blending.
Fixes Donkey Kong 64: Gate textures change from a distance. #585
Fixes Pokemon Stadium wrong transparency in warning sign #728
2020-06-14 11:51:33 +07:00
S2S
4834359ec1 Delay texture coordinate normalization. Adapt texture filter to texture engine. 2020-05-10 16:24:28 +07:00
Sergey Lipskiy
a140f0a989 Disable cull_face in GraphicsDrawer::drawScreenSpaceTriangle
It was removed by mistake in 0bc6cf7a11

Fixed #2251 Zelda: OnePiece backgrounds broken
2020-05-10 15:56:47 +07:00
Sergey Lipskiy
03b404bd4e Use noperspective shade color only for triangles with screen-space coordinates.
noperspective works incorrect for polygons, which are partially out of view.

Fixed #2240 SM64 strange green textures
2020-05-04 20:20:58 +07:00
Sergey Lipskiy
0bc6cf7a11 New LLE render. 2020-04-27 17:05:42 +07:00
Sergey Lipskiy
a73da69e10 Always use clip ratio 1 for rects and screen-space triangles. 2020-04-06 20:01:54 +07:00
S2S
2c51fb096f Magnify clipping space by ClipRatio.
Fixed #190 Cruis'n World: wrong logo
2020-04-06 20:01:53 +07:00
Sergey Lipskiy
022b375614 RE2 related fixes:
* fixed gSPModifyVertex for case when primitive depth enabled
* fixed GraphicsDrawer::isRejected for case when coordinates of vertex set by gSPModifyVertex
* fixed writeDepth() shader for RE2

Fixed various issues mentioned in #2152
2020-03-18 14:50:45 +07:00
Sergey Lipskiy
1fdd028bc6 Fix conditions to activate texturedRectDepthBufferCopy.
Fixed #2101 Multiplayer camera rotation issue in Conkers Bad Fur Day
2020-03-07 18:27:32 +07:00
Sergey Lipskiy
0692abea4a Re-implement slower N64 depth compare synchronization method,
which requires only core OpenGL 4.2 without shader_interlock extensions.

Fixed N64 depth compare with older AMD GPU.
2020-02-09 19:03:53 +07:00
Sergey Lipskiy
25b270492e Revert "Don't use glGetTexLevelParameteriv to determine texture size"
This reverts commit b31e510932.
2019-11-30 15:31:43 +07:00
fzurita
b31e510932 Don't use glGetTexLevelParameteriv to determine texture size 2019-11-29 15:56:22 +07:00
Sergey Lipskiy
86a227308e Implement copy depth to main depth buffer. It is necessary for correct work of some Reshade shaders. 2019-09-27 19:33:18 +07:00
Sergey Lipskiy
3d11a21a40 Correct GraphicsDrawer::isRejected.
According to manual, ClipRatio must be at least 2.

Fixed #2023, Chou Kuukan Nighter Pro Yakyuu King 2 (J) missing polygons in HLE
2019-03-13 18:29:21 +07:00
Sergey Lipskiy
a40afaf5bd Enable texturedRectDepthBufferCopy for Turok.
Code refactoring.

Fixed Turok 64 Missing lens flare #2009

Note: Turok lens flare works correct only when depth buffer copied from VRAM.
Software depth render produces incorrect result because it does not discard pixels,
which should be discarded by alpha test.
2019-02-22 15:45:04 +07:00
Sergey Lipskiy
5063ad7292 Fix address for depth buffer copy in texturedRectDepthBufferCopy 2019-02-22 12:17:27 +07:00
Sergey Lipskiy
2b7f78c9f8 Fix depth buffer clear when otherMode.depthCompare enabled.
Fixed 1080 Snowboarding (JU) FB off breaks games ( regression) #1976
2019-02-03 18:01:01 +07:00
Sergey Lipskiy
f79f8d406a Add bgMode config setting. 2019-02-02 19:10:50 +07:00
Sergey Lipskiy
f31cb4b00d GraphicsDrawer::drawTexturedRect - always use TexrectDrawer if m_bBGMode enabled. 2019-02-02 18:34:12 +07:00
Sergey Lipskiy
a3613b42ae Draw backgrounds with TexrectDrawer. 2019-02-02 18:34:09 +07:00
Sergey Lipskiy
7f68ae71f1 Correct texturedRectBGCopy in order to new Bg1Cyc command work with Yoshi Story 2019-02-02 18:34:09 +07:00
Sergey Lipskiy
0d3c3c151d Correct reject box implementation: add special flag for it in gDP.changed flags.
Fixed Rejection process issues #1954
2018-12-09 16:49:23 +07:00
Sergey Lipskiy
bb8c13ccce Implement rejection processing, see 25.3.2 of programming manual
Fixed Mario Party: Coin Block Blitz ground flicker / darkening #1912
2018-12-06 17:31:50 +07:00
Sergey Lipskiy
087ac76536 Correct commit e4b6224 for culling in Mortal Kombat 4.
Disable cullboth for F3DLX.Rej version 1 since this ucode does not support cullboth.
2018-11-11 16:06:23 +07:00