Bump map and matrix calculations

Ignore this my total lack of reading the Codea documentation and wasting 4 hours.

sigh sorry guys.

Well, I can help you with the inverse transpose problem, which I know well :frowning:

I wrote about it here:
http://coolcodea.wordpress.com/2013/10/02/117-lighting-in-3d-different-worlds-different-spaces/

as part of a series on 3D lighting. It is a lot simpler than you have it.

I didn’t include bump mapping, but if you search on the forum, you should find a couple of projects created by spacemonkey. If you can’t find them, just PM him, I’m sure he’ll be happy to find them for you.

More generally, I see you’re using Shaderific code. It needs some modifications to work in Codea.

Also, if you don’t fully understand lighting, you are going to get stuck very quickly. If you need it, my blog posts can help you get an understanding of lighting in Codea, and then I can show you the mods I have made to Shaderific to get it to work in Codea. This doesn’t include bump mapping, though, which requires mapping to tangent space - which is not covered by Shaderific as far as I can see.

But having spent weeks battling through lighting, I don’t recommend taking on bump mapping unless you have a pretty good understanding of lighting in general.

For any people coming from Google, there is a great series of tutorials available on Github here