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
e0373524ca
Further improvement to lightmapping system:
- Added a function to find all faces that contain a given point. This is useful for both sampling lightmaps, and sampling textures later.
- New face vertex lighting function simply collects all faces for a given vertex, and samples all relevant lightmaps for it
- A whole bunch more experiments that were more complex and that went nowhere
- Ironically all this doesn't really change the current quality of the lighting but hey, that's a result too. And this added code will prove useful soon enough.
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.
Still not quite perfect yet but about where I want it to be for now.
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.
Not quite right yet but it does get a result, and it's given me a good idea of what the correct solution for this should be.
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.
Keeping averaged light per vertex intact for now, as sampling isn't quite perfect yet and I like to have some options.
3 years ago
Nico de Poel
c429529e88
Fixed lightmap sampling:
- Implement bounds calculation per face instead of for all faces, which was silly
- Face lightmap width and height calculations now match what Quake does
- Added an export function for lightmap data, to make debugging easier
- Include face baselight into vertex lighting, if/when that ever makes a difference
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
8f82f467a0
First import of PS1 MDL/BSP tools project, long overdue
3 years ago