Realtime Affine Texture Mapping (WIP) copy

Realtime Affine Texture Mapping (WIP) copy

by DCPU-16

👁 6,256 ❤️ 239 ⭐ 190 🔄 4
Created: May 30, 2013 Last modified: Jul 23, 2013 Shared: May 30, 2013

Description

UPDATE: Back-ported backface culling. (hohoho) The code includes lots of unrolled loops and duplicated code to save doing things twice or with excessive calculation, so the code is pretty messy. Since this is affine texture mapping, the texturing will look funky when used on perspective transforms (you can see this on the first Playstation). This is the simplest form of texture mapping though, so it makes sense to implement this first. As you can see, this is way too slow to be practical. The framerate could be increased a lot by doing backface culling, which I might copy over from my racetrack project. I'm going to try this on a more advanced model, but it'll probably be a a like render instead of realtime. Credit to Mojang for the grass block texture from Minecraft.

Instructions

Affine Texture Mapping in Scratch. Adjust the distance slider (closer is slower) and Poly Resolution slider. I use the same texture converter as with the Earth Shader: http://dl.dropbox.com/u/12239448/ScratchTexture/index.html Model of Link Imported: http://scratch.mit.edu/projects/10541079/

Project Details

Visibility
Visible
Comments
Enabled