kvark / vange-rs

Rusty Vangers clone
https://vange.rs
Apache License 2.0
438 stars 21 forks source link

Terrain material filtering #10

Open kvark opened 8 years ago

kvark commented 8 years ago

We see heavy blockiness in close-up to the surface, due to the limited resolution of our terrain map, and the fact no filtering is done over the material property.

Obviously, just plain filtering the material ID doesn't work. Averaging materials 5 and 10 doesn't make sense. Instead, we can gather all 4 material IDs, do all the lighting computations on them, and apply bilinear filtering to the result.

Performance-wise, it's not too fast. However, it's only going to be done once per pixel of the main frame rendering (not shadow map or anything else). And there is already some ray-tracing going on there, so it's not like this enhancement would make it much slower :)