… | |
… | |
145 | lc = (*ctx.pass_data->l)(); |
145 | lc = (*ctx.pass_data->l)(); |
146 | |
146 | |
147 | temp_3f rot1, rot2, rot3; |
147 | temp_3f rot1, rot2, rot3; |
148 | |
148 | |
149 | rot1 = yxz (texture_2d (normvar, texcoord) * 2.F - 1.F); |
149 | rot1 = yxz (texture_2d (normvar, texcoord) * 2.F - 1.F); |
150 | rot2 = float3 (x(rot1), -z(rot1), y(rot1)); |
150 | rot2 = float3 (x(rot1), z(rot1), -y(rot1)); |
151 | rot3 = float3 (-y(rot1), x(rot1), z(rot1)); |
151 | rot3 = float3 (y(rot1), -x(rot1), z(rot1)); |
152 | |
152 | |
153 | normal = mat3 (rot1, rot2, rot3) * normal; |
153 | normal = mat3 (rot1, rot2, rot3) * normal; |
154 | |
154 | |
155 | fac = dot (normalize (normal), normalize (lightvec)); |
155 | fac = dot (normalize (normal), normalize (lightvec)); |
156 | fac = pow (max (fac, 0.0), 6); |
156 | fac = pow (max (fac, 0.0), 6); |