49 Commits (c6a8abbb7b55044fde54493ae4e0a58827fe647f)
 

Author SHA1 Message Date
Nico de Poel c6a8abbb7b Made the texture space transform available outside of Tessellator and used it to generate some more Face bounds data for later use. 3 years ago
Nico de Poel fb66f93b46 Provide some additional data in the PS1 BSP file, including linked list pointers for leaf-based polygon sorting 3 years ago
Nico de Poel cc1fcec7ea Also add leaf bounding sphere for optional per-leaf frustum culling. 3 years ago
Nico de Poel c91e8e6167 Added bounding spheres to node data, used for frustum culling 3 years ago
Nico de Poel 0df5801eba Export face vertex data again, to allow for simplified rendering routines 3 years ago
Nico de Poel 93551117b1 Added surface flags, allowing for rendering of water surfaces 3 years ago
Nico de Poel 4655246b69 Retired the concept of surface vertices, as UVs can in fact not be shared between polygons. 3 years ago
Nico de Poel ef9adf8de0 Introduced some matrix math to properly construct a texture space transform, that we can also invert to create a transform back to world space. Finally our tesselated polygons are working perfectly! 3 years ago
Nico de Poel 4e11041b93 Desaturate palette colors to more closely match Quake's look, and made an exception for the big Quake sign on the start map, so it maintains a higher mip level. 3 years ago
Nico de Poel fc281251ea Overhaul of geometry conversion: 3 years ago
Nico de Poel 4f99baea65 Encapsulated GPC-based tesselation into a Tesselator class, which now also produces normalized UVs per vertex-texture pair and a list of Polygon structs with texture and vertex index data. 3 years ago
Nico de Poel f413e8c47f First test with GPC to cut faces into multiple polygons, based on a grid of texture boundaries. Reconstruct the texture space (s,t) coordinates back into world space. Store vertices and indices while avoiding duplicate vertices. 3 years ago
Nico de Poel e5b2e6244a Imported General Polygon Clipper library, which could come in handy to cut up faces to accomplish texture tiling 3 years ago
Nico de Poel 568f2450eb Added a new lighting sampler to take advantage of the improved lightmap indexing: use a pseudo-random jitter pattern to take multiple light samples in an area around the sample point, from all surrounding faces at a shallow angle. 3 years ago
Nico de Poel 6d6766663b Realized we can include the UV offsets into the UVs stored in the exported map file, so we don't need to add those at runtime. Easy performance win. 3 years ago
Nico de Poel 3bc9167885 Tweaked heuristics of the rectpack algorithm to produce better results for our non-square texture atlases. 3 years ago
Nico de Poel fb3d1ac6a1 Upgraded dot product and cross product-related functions to doubles, to improve accuracy of various calculations 3 years ago
Nico de Poel 161ef0acee Improved lightmap sampling accuracy. The generated UVs now more closely match what Quake is doing, we can reject invalid UVs, and we're getting less false rejects of valid faces to sample from. 3 years ago
Nico de Poel 5e85e2c73a Modified texture packer to allow for arbitrary input bin sizes. Added transparency flag to final palette entry. 3 years ago
Nico de Poel 0a19ca70f5 Texture atlasing tool now directly exports images in .TIM format for use on PS1 3 years ago
Nico de Poel 628955d7a0 Added code and resources for exporting TIM image files directly 3 years ago
Nico de Poel 3e0706c9f9 Small tweaks to make a few textures on n64start a bit nicer 3 years ago
Nico de Poel beb1ad6382 Fixed texture seams and bleeding caused by making our UVs one texel too large 3 years ago
Nico de Poel 6c2d61b2dc Invent some texture UVs that remain within each face's UV bounds, to prevent tiling and still get some UVs that make at least a bit of sense. 3 years ago
Nico de Poel 72d03aff9c Fixed some issues with texture atlas, page and ID generation. Texture references generally seem to be in order now, but UVs are still a problem. 3 years ago
Nico de Poel d84a14973b First pass at converting texture info to PS1 VRAM data. Not quite right yet but it's starting to work. 3 years ago
Nico de Poel 5137fe0a15 A bit of cleanup and moved the facesWithPoint function to world_t, for easier reuse 3 years ago
Nico de Poel e0373524ca Further improvement to lightmapping system: 3 years ago
Nico de Poel 1882d246b9 A bit of cleanup ahead of attempting to make textures work 3 years ago
Nico de Poel bf3bf810f6 Added computation of face area by projecting its vertices onto its plane and then generating a bounding box. Will be used for determining tessellation subdivisions. 3 years ago
Nico de Poel 219fc6db32 Implemented an alternative method for computing lighting per face vertex, one that's simpler, faster and that produces better results. 3 years ago
Nico de Poel e65ce7b673 First attempt at calculating lighting per face-vertex with smoothing based on the angle between faces, using edge adjacency to determine neighbouring faces. 3 years ago
Nico de Poel a1e289f5fa Export plane type field, to allow optimizations for axis-aligned planes 3 years ago
Nico de Poel eb548d13d8 Added plane and center point to face struct, for early backface culling. 3 years ago
Nico de Poel f6da144c6a Padded some structs to make them 32-bit aligned 3 years ago
Nico de Poel 86343e96a9 Added export of PVS data 3 years ago
Nico de Poel 049a02fec7 Added conversion of plane, node and leaf data 3 years ago
Nico de Poel a631e5a90d Reworked PS1BSP format to use dentry-style header info, and added structs for planes, nodes and leafs. 3 years ago
Nico de Poel 9af577773d Improved lightmap sampling for face vertices 3 years ago
Nico de Poel f596c008d7 Store sampled light data per face vertex, so we can individually light each face without having to average lighting values. 3 years ago
Nico de Poel c429529e88 Fixed lightmap sampling: 3 years ago
Nico de Poel 9f9bf49a86 Sample lightmaps to accumulate and average lighting values per vertex, then store those in the exported BSP file. 3 years ago
Nico de Poel ba68bc128e Write face vertex indices to output file instead of triangle data, which takes up less space and allows the PS1 code to decide how to draw the primitives. 3 years ago
Nico de Poel 2f3facc4d8 Added a few more bits of BSP data, fixed edge list which is in fact an array of ints; the documentation was wrong. 3 years ago
Nico de Poel 06e87e85a2 Added loading of nodes and leaves 3 years ago
Nico de Poel bd339fc737 Separated file loading from BSP processing, making it easier to use data from different sources and also ensuring everything gets cleaned up properly at the end. 3 years ago
Nico de Poel fac8e40425 Made an attempt to add some structure to the BSP file processing 3 years ago
Nico de Poel a6cfcba95f Added documentation downloaded from Lameguy64 3 years ago
Nico de Poel 8f82f467a0 First import of PS1 MDL/BSP tools project, long overdue 3 years ago