Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Massive optimizations and improvements.
Optimization has been done to make vertex transformation and rendering happen faster, meaning a ~17% improvement in render speed. Skinning has been optimized to be, similarly, significantly faster. A (tiny? singificant?) part of this is pulling the skinning time debug timer outside of the vertezx transformation loop. This means the value is less exact and now encompases matrix multiplication for assigning the results to the finished vertex transformation slice, but should be just that much more optimized (if even just slightly). This might be worth reviewing in the future to see if it's a significant enough change to keep or not. All internal number types have moved from float64 to float32, meaning lighter memory usage. Vector has been split into Vector2, Vector3, and Vector4 for better memory usage, since UV values don't need the extra Z and W values and positions don't need the extra W value. The severity of the w clipping when triangles move behind the camera has been lessened, with the smallest W value going from 0.000001 to 0.00005, meaning vertices distort a bit more when the camera is right up against them, but the texture doesn't glitch out due to not enough numerical precision, particularly when the texture mapping is perspective corrected. Adding math32 package for math functions (Sin, Cos, Abs, Max, Min, etc) but for float32s (or other number types for some functions). Replacing ebitenutil with vector usage for debug rendering for Camera. Camera.RenderNodes no longer constructs a new slice for every model and light, but rather reuses a pre-allocated one. Camera debug values has been made more consistent / correct (previously, TotalParts would increase or decrease depending on whether they were within the frustum or not; this shouldn't happen anymore). Vertex colors for meshes have been switched from being [vertex index][color channel] to [color channel][vertex index], meaning the data for each vertex lies closer together in memory, which should be an optimization. Doing this also allows us to easily pass a whole color channel to lighting functions. Meshes no longer have a per-vertex active vertex color channel variable - the entire mesh shows only one vertex color channel at a time. This is good because it's hard to imagine a situation where you would need to change this per-vertex, and this avoids adding a per-vertex slice lookup. Getting rid of the dae importer. Adding VertexColorChannel type (which is just a []Color, but it helps a bit to make it easier to comprehend). Adding NodeFilter.IsZero(). Reworking auto-subdivision in add-on to more reliably subdivide edge loops correctly. I also moved the auto-subdivision settings into the mesh panel, rather than the Object panel. Updating the baking example to be more complex and visually interesting.
- Loading branch information