26 |
{ |
{ |
27 |
//// * : int x vec3 -> vec3 |
//// * : int x vec3 -> vec3 |
28 |
//// + : vec3 x vec3 -> vec3 |
//// + : vec3 x vec3 -> vec3 |
29 |
vec3 pos = orig + row*rVec + col*cVec; |
vec3 pos = orig + real(row)*rVec + real(col)*cVec; |
30 |
//// |()| : vec -> real |
//// |()| : vec -> real |
31 |
//// - : vec3 x vec3 -> vec3 |
//// - : vec3 x vec3 -> vec3 |
32 |
//// / : vec3 x real -> vec3 |
//// / : vec3 x real -> vec3 |
51 |
real hdotn = dot(halfDir,norm); |
real hdotn = dot(halfDir,norm); |
52 |
// hey the per-component multiplication is in matRGB*lightRGB |
// hey the per-component multiplication is in matRGB*lightRGB |
53 |
//// * : real x vec3 -> vec3 |
//// * : real x vec3 -> vec3 |
54 |
//// * : vec3 x vec3 -> vec3 this notation may be reconsidered |
//// modulate : vec3 x vec3 -> vec3 |
55 |
//// + : vec3 x vec3 -> vec3 |
//// + : vec3 x vec3 -> vec3 |
56 |
//// pow : real x real -> real |
//// pow : real x real -> real |
57 |
vec3 pntRGB = (ka + kd*ldotn)*matRGB*lightRGB + ks*pow(hdotn,psh)*lightRGB; |
vec3 pntRGB = (ka + kd*ldotn)*modulate(matRGB,lightRGB) + ks*pow(hdotn,psh)*lightRGB; |
58 |
rayRGB = rayRGB + rayTranps*matRGBA[3]*pntRGB; |
rayRGB = rayRGB + rayTranps*matRGBA[3]*pntRGB; |
59 |
//// * : real x real -> real |
//// * : real x real -> real |
60 |
//// - : real x real -> real |
//// - : real x real -> real |