.dsy:it.
Show 150 posts per page

.dsy:it. (http://www.dsy.it/forum/)
- Grafica e immagini digitali (http://www.dsy.it/forum/forumdisplay.php?forumid=77)
-- myPhong e myLambert (http://www.dsy.it/forum/showthread.php?threadid=37066)


Posted by walterbesuschio on 02-12-2008 18:24:

myPhong e myLambert

Ciao. Qualcuno mi potrebbe dare gentilmente il codice degli shader myLambert.sl e myPhong.sl? Grazie mille!!!!!!!!!!!!!


Posted by Ste.dv on 03-12-2008 13:42:

myLambert.sl
surface myLambert(float Kd = 1)
{
color lambert;
normal Nf;

Nf = normalize(N);
Nf = faceforward(Nf, I);
lambert = diffuse(Nf);
Ci = Cs * Kd * lambert;
}

myPhong.sl
surface myPhong(float Kd = 0.5; float Ks = 0.5; float n = 0; color specularColor = (0, 1, 0))
{
color lambert;
color phong;
normal Nf;
vector If;

Nf = faceforward(normalize(N), I);
If = normalize(-I);

phong = specular(Nf, If, n);
lambert = diffuse(Nf);

Ci = (Cs * Kd * lambert) + (specularColor * Ks * phong);
}


Posted by walterbesuschio on 03-12-2008 17:45:

Grazie!!!!!!!!!!!!


All times are GMT. The time now is 19:46.
Show all 3 posts from this thread on one page

Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.