49 Commits (be7eb8768544d0aeec6e844bd83c7d83404a9cdb)

Author SHA1 Message Date
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. 3 years ago
Nico de Poel ba83d78aa8 Removed the need for global variables for sorting leafs and faces 3 years ago
Nico de Poel 4d138b4199 Added an extra face sorting step so we can draw faces in front-to-back order: 3 years ago
Nico de Poel a8d3bf567b First pass at leaf-based rendering order: 3 years ago
Nico de Poel 5e738340b8 Added box-frustum test code, used to experiment with more accurate per-leaf bounding box frustum culling. 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 b0893a902d Added support for leaf-based frustum culling, but leaving it disabled for now. 3 years ago
Nico de Poel ea2b963653 Implemented per-node frustum culling based on bounding spheres. 3 years ago
Nico de Poel 0f450cf6b1 Added initial frustum calculation based on screen parameters and view matrix. 3 years ago
Nico de Poel b1e568e5c3 Added check to backface culling to see if the face is behind the camera. 3 years ago
Nico de Poel 7232e061d7 Added a fast face drawing routine, which is basically what we had before: 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
Nico de Poel 3b5a59dae6 Geometry, textures and lighting now all working correctly. 3 years ago
Nico de Poel ebbc01c672 Overhaul of geometry representation, with correct UV'ing and more finely tesselated surfaces. 3 years ago
Nico de Poel 989ec0bafb Simplified toggle behavior for button inputs, and added an option to toggle texturing with the circle button. 3 years ago
Nico de Poel 9c1cbd467e Small tweaks: 3 years ago
Nico de Poel a478a7c1ed Fixed a silly mistake in the primitive buffer allocation space check 3 years ago
Nico de Poel b43767ebb8 Realized we can include the UV offsets into the UVs stored in the preprocessed map file, so we don't need to add those at runtime. Easy performance win. 3 years ago
Nico de Poel 5549e3f126 Textures are now showing up somewhat correctly! 3 years ago
Nico de Poel 297ae187f6 Fixed some issues with texture atlas generation. 3 years ago
Nico de Poel 76a6dc92d5 First pass at implementing texturing of face polygons. 3 years ago
Nico de Poel c8c44b352f A bit of cleanup ahead of attempting to make textures work 3 years ago
Nico de Poel 36c409115a Use per-face vertex lighting for improved geometry definition and less light leaking between sharp-angled surfaces. 3 years ago
Nico de Poel e1d239150e Made polygon building faster by checking ahead of time if we have enough primitive buffer space, instead of checking it per polygon. 3 years ago
Nico de Poel 59d838f501 Small optimization to BSP tree traversal, by making the child node selection branchless 3 years ago
Nico de Poel b0d36ab11b Sped up plane calculations by making use of axis-aligned properties 3 years ago
Nico de Poel bbf87bbf58 Implemented backface culling per face, by adding plane and center point fields to the face struct and checking the plane's normal against the camera vector to the center point. 3 years ago
Nico de Poel ddffc8860e Fixes to make things work on real hardware again: 3 years ago
Nico de Poel 3a7ea8d4b3 Debugging work: 3 years ago
Nico de Poel a05a800da0 Implemented PVS decompression, leaf visibility check using PVS data, and front-to-back traversal of the BSP tree. 3 years ago
Nico de Poel b7da18d0c8 First bits of code involving BSP traversal with front/back selection and math: determine the leaf that the camera is currently in. 3 years ago
Nico de Poel 337406c03f Use the node and leaf data to traverse the entire BSP tree and draw all attached faces. 3 years ago
Nico de Poel 37f619dc94 Load plane, node and leaf data, and iterate through leaves to draw faces. 3 years ago
Nico de Poel 0e1bb7a5bf Reworked PS1BSP format to use dentry-style header info 3 years ago
Nico de Poel c5783982e1 Added a more aggressive inlining macro. Not sure if it makes any difference now, but it's nice to have the option. 3 years ago
Nico de Poel dfa6ec2f85 Split face drawing off into a separate function, and made triangle fan and triangle strip available again as alternative options, for comparison. 3 years ago
Nico de Poel d3efa8e590 Keep track of and display total polycount 3 years ago
Nico de Poel 75ae399d38 Implemented quad strip topology for rendering faces, which is actually a good bit simpler than triangle strips. 3 years ago
Nico de Poel 7606d89998 Implemented triangle strip topology for drawing faces 3 years ago
Nico de Poel 3167f1474e Faces can now carry their own per-vertex lighting data, instead of sharing all vertex data with adjacent faces. 3 years ago
Nico de Poel 08008af2a0 Implemented rudimentary baked lighting through vertex colors and gouraud shading. 3 years ago
Nico de Poel f8a4d171a3 Faces now have a vertex index list, which is more space-efficient and allows easy rewrites of polygon topology. 3 years ago
Nico de Poel 79f1e52d1e Rewrote scratchpad function to work more as I envisioned it: 3 years ago
Nico de Poel a6e9aa1b21 First simple test with scratch memory, just to verify that it works. 3 years ago
Nico de Poel a68b2c370f Set up some helper functions for memory management, including scratchpad memory. Moved the primitive buffer here too. 3 years ago
Nico de Poel f4017d5f56 Modified triangle rendering code so that it finally works on real hardware. 3 years ago
Nico de Poel 5a3b6aac46 First implementation of world loading and rendering. No BSP logic or optimizations in here yet, but something is being displayed! 3 years ago