This is sort of an odd question, but I’m trying to force BGE to not use perspective-correct texture mapping. Basically, older games used affine texture mapping and makes PS1 games’ textures look the way they do. Here’s an example:
And here’s what Wikipedia has to say:
On forums for Unity 3D people said that this would be relatively easy to do with shaders. Is there any way to use affine texture mapping in the BGE?
I remember that one. I wrote a texture render as university project (ages ago). This calculation of UV coordinates was one of my problems. It is fast but not correct and produces visible distortions.
It is linear interpolation. This means you calculate the ratio towards the vertices of the face (which have a defined UV already). You do not do it in 3D space, but in 2D camera. The linearity allows you to fill the polygon without division. That was what made it fast (when you perform correct UV-calculation you need to divide by Z).
Unfortunately I can’t tell how to implement that into a shader. Why do you need it?
One of the projects I’m working on on the side is an open world game that I’m trying to make look like a PS1 classic. I’m trying to get many PS1 era effects working in the BGE, such as vertex snapping and affine mapping. How would you even use a custom shader in the BGE? Is there a way to use vertex shaders?