zesterer / euc

A software rendering crate that lets you write shaders with Rust
Apache License 2.0
294 stars 18 forks source link

Implemented perspective correct interpolation #7

Closed MartinSandfuchs closed 4 years ago

MartinSandfuchs commented 4 years ago

Implement perspective correct interpolation. This requires breaking changes to the Pipeline trait since we now require vertex shaders to output 4D homogenous coordinates to support both orthographic and perspective projections (similar to how OpenGL does this). I've also added an example of perspective correct texture mapping and adapted the examples to use the new API. Since I'm not used to using criterion, I have not fixed the benchmarks. It is also quite possible that further changes are required to make the line rasterizer work nicely with perspective projections. In this regard an example to test the line rasterizer could be useful.

This fixes #5 and possibly #6.

zesterer commented 4 years ago

Thanks very much, this is a superb MR!

Make sure to add your name to the Cargo.toml in the authors section.