windwaker light shader

Just made this file for a new project. thought id upload it.

in the file just add the shader to the object. the cube is the light source. may need to rename it in the shader to not get mixed up. its name is still “Cube” so be careful.

here u guys go.


windwaker_shader.blend (1.13 MB)

I haven’t been able to get this to work. The cube doesn’t illuminate the object.

@ d4damage I tested the file it works. do u get any errors? aside form the vec3 to float error?

With intel hd graphics that warning is an error

ERROR: 0:18: '=' : cannot convert from '3-component vector of float' to 'float'

The fault is in line 18 of the vertex shader. This is the line 30 of the script.
It generates a vector of 3 floats and tries to write the vec3 into a single float. Also multiply something with 1.0 is useless so I removed it.

So change it from

            float diffuseReflection =  vec3(1.0 * max(0.0, dot(normalDirection, lightDirection)));


            float diffuseReflection =  max(0.0, dot(normalDirection, lightDirection));