ivan Posted December 13, 2007 Share Posted December 13, 2007 the shadow() function takes as an argument Cl.... anybody know if there's a reason for this? could I perhaps call it with my own color and get a shadow value? would it still attenuate the Cl value? Quote Link to comment Share on other sites More sharing options...
ivan Posted December 13, 2007 Author Share Posted December 13, 2007 okay, a little clarification- this does not work: if (receiveshadows){ shadow(red); shadow(Cl); } the red color will get shadows, but the regular lights will not. If I try this: if (receiveshadows){ shadow(Cl); shadow(red); } the lights get shadowed, the red color does not. I suppose this might work: vector white = set(1,1,1) if (receiveshadows){ shadow(white); } Cl *= white; red *= white; the shadow() function takes as an argument Cl.... anybody know if there's a reason for this?could I perhaps call it with my own color and get a shadow value? would it still attenuate the Cl value? Quote Link to comment Share on other sites More sharing options...
ivan Posted December 13, 2007 Author Share Posted December 13, 2007 ok, so here we are... with a 3 l(or 4) ight setup, this seems to work: illuminance(P, {0, 1, 0}, PI) { if (receiveshadows){ shadow(whitelite); Cl *= whitelite; } clr += Cl; if(i==0){ RGBclr.r += whitelite.r; } if(i==1){ RGBclr.g += whitelite.g; } if(i==2){ RGBclr.b += whitelite.b; } i++; //...... USE Cl OR RGBclr HERE AS NEEDED... } now if you compute your surface color with Cl you'll get your actual light colors, and if you use RGBclr, you'll get the light passes in each channel. Of sourse, this only works if you already know how many lights there are in the scene... Quote Link to comment Share on other sites More sharing options...
ivan Posted December 13, 2007 Author Share Posted December 13, 2007 oops! an error on my part- you MUST set whitelite = 1 just before you call shadow().... illuminance(P, {0, 1, 0}, PI) { whitelite = set(1,1,1); if (receiveshadows){ shadow(whitelite); Cl *= whitelite; } ... otherwise you keep accumulating shadows... ok, so here we are... with a 3 l(or 4) ight setup, this seems to work: illuminance(P, {0, 1, 0}, PI) { if (receiveshadows){ shadow(whitelite); Cl *= whitelite; } clr += Cl; if(i==0){ RGBclr.r += whitelite.r; } if(i==1){ RGBclr.g += whitelite.g; } if(i==2){ RGBclr.b += whitelite.b; } i++; //...... USE Cl OR RGBclr HERE AS NEEDED... } now if you compute your surface color with Cl you'll get your actual light colors, and if you use RGBclr, you'll get the light passes in each channel. Of sourse, this only works if you already know how many lights there are in the scene... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.