aboutsummaryrefslogtreecommitdiff
path: root/src/GPU3D_Soft.cpp
Commit message (Collapse)AuthorAge
* Edge fill rules for swapped polygons + a few minor fixes to edge cases (#1815)Jaklyy2023-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix edge fill rules for swapped polygons also fixes translucent polygons not being always edge filled. * fix right edge fill rule * fix right edge fill rule for realsies * fix a few more glitchy polygons specifically quads similar to: (-67,40) (64, 160) (192, 160), (8, 111) * fix one edge case pixel i hate this so much * fix "flat bottom" edge fill * fix regression + apply changes to shadow masks fix a regression with certain line polygons not rendering; there seems to be an exception made by the ds' gpu in order for these polygons to render properly. also apply these changes to shadow masks because i forgot to * forgot to remove a line --------- Co-authored-by: Arisotura <thetotalworm@gmail.com>
* Fix Incorrect Polygon Swapping Behavior and Implement Correct Rules for ↵Jaklyy2023-08-27
| | | | | | | | | | | | | | Shifting Right Edges Left (#1816) * fix polygons being swapped incorrectly "borrowed" this from noods needs verification that the >= and <= signs aren't actually supposed to be > and < * proper rules for moving vertical right slopes left * nvm most of that was actually pointless that's on me for not checking
* Fix aa being upside down on swapped y-major slopes (#1803)Jaklyy2023-08-27
| | | | | | | | | | | | | * fix aa being upside down on swapped y-major slopes * further improvements to swapped aa in addition to fixing swapped y-major slope aa, now fixes: swapped x-major slope aa swapped vertical slope aa * use templates instead + style/comment tweaks should force the compiler to precompile if statements like i want it to do, instead of just hoping it does so on its own
* Small Fix to Anti-Aliasing + Edge Marking Behavior (#1680)Jaklyy2023-08-27
| | | | | | | | | | | * Anti-Alias All Edges Changing a bunch of 0x3s to 0xF since I figure if they're checking the left and right edge they wanna be checking the top and bottom too now that they're gonna be aa'd. also copy that if statement over since otherwise there won't be anything to blend with. * small optimization its probably a tiny bit faster? idk id need actual benchmarking tools. doesn't break anything at least.
* check lower pixel when top pixel ignores fog (#1808)Jaklyy2023-08-13
|
* update copyright headersArisotura2022-01-09
|
* finally decouple Config from the core. baahhahahahahArisotura2021-11-18
|
* use std::swap 🔃RSDuck2021-08-21
|
* addition to last commitRSDuck2021-08-04
|
* GPU3D soft: prevent out of bounds readRSDuck2021-05-24
|
* set instead of or stencil buffer for left edgesRSDuck2021-05-08
|
* update copyright year and add missing GPL headersRSDuck2021-03-12
|
* avoid leaking threads in NDSCart_SRAMManagerRSDuck2021-03-11
| | | | also atomics
* try to fix build when the compiler is stricterRSDuck2021-02-11
|
* use std::function in Thread_Create so we can revert back to using itRSDuck2021-02-11
|
* Allow for a more modular renderer backends (#990)Wunk2021-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Draft GPU3D renderer modularization * Update sources C++ standard to C++17 The top-level `CMakeLists.txt` is already using the C++17 standard. * Move GLCompositor into class type Some other misc fixes to push towards better modularity * Make renderer-implementation types move-only These types are going to be holding onto handles of GPU-side resources and shouldn't ever be copied around. * Fix OSX: Remove 'register' storage class specifier `register` has been removed in C++17... But this keyword hasn't done anything in years anyways. OSX builds consider this "warning" an error and it stops the whole build. * Add RestartFrame to Renderer3D interface * Move Accelerated property to Renderer3D interface There are points in the code base where we do: `renderer != 0` to know if we are feeding an openGL renderer. Rather than that we can instead just have this be a property of the renderer itself. With this pattern a renderer can just say how it wants its data to come in rather than have everyone know that they're talking to an OpenGL renderer. * Remove Accelerated flag from GPU * Move 2D_Soft interface in separate header Also make the current 2D engine an "owned" unique_ptr. * Update alignment attribute to standard alignas Uses standardized `alignas` rather than compiler-specific attributes. https://en.cppreference.com/w/cpp/language/alignas * Fix Clang: alignas specifier Alignment must be specified before the array to align the entire array. https://en.cppreference.com/w/cpp/language/alignas * Converted Renderer3D Accelerated to variable This flag is checked a lot during scanline rasterization. So rather than having an expensive vtable-lookup call during mainline rendering code, it is now a public constant bool type that is written to only once during Renderer3D initialization.
* fixes to the threadedness of the sw rasteriserRSDuck2021-01-26
| | | | also fix #639 and fix #880
* use C++ style structs everywhereRSDuck2021-01-02
|
* Merge vram dirty trackingRSDuck2020-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit b463a05d4b909372f0cd1ad91caa0c77a25e5901 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 01:55:35 2020 +0100 minor fix commit ce73cebbdf5da243d7ebade82d8799ded9cd6b28 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 00:43:08 2020 +0100 fix dirty flags of BG/OBJ mappings not being reset commit fc5d73a6178e3adc444398bdd23de8314b5ca8f8 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 30 00:11:13 2020 +0100 use flat vram for gpu2d everywhere commit 34ee9fe2bf04fcfa2a5a1c8d78d70007e606f1a2 Author: RSDuck <rsduck@users.noreply.github.com> Date: Sat Nov 28 19:10:34 2020 +0100 mark VRAM dirty for display capture commit e8778fa2f429c6df0eece19d6a5ee83ae23a0cf4 Author: RSDuck <rsduck@users.noreply.github.com> Date: Sat Nov 28 18:59:31 2020 +0100 use flat VRAM for textures and texpals also skip rendering if nothing changed and a bunch of fixes commit 53f2041e2e1a28b35702a2ed51de885c36689f71 Author: RSDuck <rsduck@users.noreply.github.com> Date: Fri Nov 27 18:29:56 2020 +0100 use vram dirty tracking for extpals also preparations to take this further commit 4cdfa329e95aed26d3b21319c8fd86a04abf20f7 Author: RSDuck <rsduck@users.noreply.github.com> Date: Mon Nov 16 23:32:22 2020 +0100 VRAM dirty tracking
* make platform objects typesafer and add mutexRSDuck2020-11-09
|
* * rework GPU's settings interface, make it config-agnosticArisotura2020-05-28
| | | | | * make video settings dialog functional, sorta * fix dialogs that were resizable
* update copyright yearsArisotura2020-02-14
|
* software renderer: fix rendering of line polygons. fixes #350Arisotura2019-06-11
|
* welp.Arisotura2019-05-21
| | | | progress
* BAHAHAHHHHArisotura2019-05-16
| | | | HARK HARK HARK
* BAHAHAHAHAHAHAHAAArisotura2019-05-16
|
* de-hardcode the GL renderer.Arisotura2019-05-12
| | | | | init framebuffer to black. fix bugs.
* hires hax. somewhat functionalArisotura2019-05-08
|
* first attempt at thingsArisotura2019-04-01
| | | | (also fix softrenderer reset)
* also, update copyright nameArisotura2019-01-22
|
* some work on extreme/degenerate shit in GPUStapleButter2018-12-20
| | | | | | * clip against Z then Y then X. apparently, fixes #310. I had also observed hints that the hardware does it this way. * truncate W to 24 bits before viewport transform. * mark any polygons that have a W=0 at that point as degenerate. do not render.
* implement proper support for POWCNT1.StapleButter2018-12-18
| | | | fixes #260
* 3D: in Z-buffering mode, margin for 'equal' depth test mode is +-0x200, not ↵StapleButter2018-12-13
| | | | | | +-0xFF fixes #274
* 3D: keep the rasterizer from accidentally going out of bounds when given ↵StapleButter2018-11-04
| | | | | | | | very flat X-major edge slopes. this, by a fucking shitshow of butterfly effect, ends up fixing #234. technically, the rasterizer was going out of bounds, which, under certain circumstances, caused interpolation to shit itself and generate Z values that were out of range (but still ended up in the zbuffer). sometimes those values ended up negative, which caused these glitches when polygons had to be drawn over those. about fucking time.
* 3D: attempt at fixing that shadow/AA interaction bug in the MKDS character ↵StapleButter2018-10-22
| | | | select screen
* fixor copyright years.StapleButter2018-09-15
|
* this TODO item is already done, idiotStapleButter2017-10-02
|
* 3D: blend translucent pixels with bottom pixels when needed.StapleButter2017-08-28
| | | | fixes antialiasing within shadows, under translucent polygons, etc
* 3D: move shadow mask rendering to separate function, optimize it (it doesn't ↵StapleButter2017-08-28
| | | | need to interpolate all vertex attributes)
* fix antialiasing along Y-major edgesStapleButter2017-08-28
|
* 3D:StapleButter2017-08-28
| | | | | * more accurate polygon edges (still not perfect. heh) * antialiasing (doesn't always work)
* 3D: faster and more accurate interpolationStapleButter2017-08-17
|
* 3D: revise fog calculation to match hardware (emulate precision loss and ↵StapleButter2017-08-16
| | | | overflow with big shifts)
* * FPS counter displays target framerateStapleButter2017-07-21
| | | | * fix potential hang and out-of-bounds drawing when VCount is modified during drawing
* separate polygonID attributes for opaque and translucent pixels.StapleButter2017-07-15
| | | | | | rendering translucent pixels preserves opaque polygonID and edge flags for edgemarking. fixes edgemarking malfunctions, like #80 or black dots in Pokémon games
* apply the interpolation fix to Z interpolation.StapleButter2017-07-14
| | | | | | more accurate conversion of Z values. but this doesn't fix the horrendous Z-fighting in Pokémon B/W because of course it doesn't >_<
* fix potential overflow in fog density calculationStapleButter2017-07-14
|
* * actually fix linear interpolation when y0>y1StapleButter2017-07-13
| | | | * change the backfacing attribute bit, so that it doesn't mess with edgemarking
* attempt to fix interpolation when y0>y1StapleButter2017-07-10
|
* 3D:StapleButter2017-07-06
| | | | | * undo 'winding sorting' hypothesis * special depth test rules: 'less than' function becomes 'less or equal' when rendering front-facing polygon pixels against back-facing opaque pixels