Nico de Poel
2626b9c67f
A bit of cleanup:
- Ditching the face vertex thing since we're not likely to use the low-quality render path in practice, and this saves a ton on extra vertex data
- No need to build a world-space bounding box per face anymore
3 years ago
Nico de Poel
727c5bf724
Tweaked light sampling a bit more, should be more accurate to Quake's original implementation now (though it hardly makes any difference in practice)
3 years ago
Nico de Poel
0a077b426c
Reworked lightmap sampling using a lightmap space transform and correctly rounding values, using the Quake source for reference. Finally fixes a bunch of lingering lighting artifacts.
3 years ago
Nico de Poel
ac84af48f2
Create a reusable texture space transform matrix per face, and use it to build up the texture boundaries.
3 years ago
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
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.
This further smooths out the lighting and reduces artifacts, while also better representing each face's entire lightmap.
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
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:
- 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
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