|
From: Daniele C. <dca...@in...> - 2004-10-22 14:15:33
|
In rayshade there is a problem when one or more texture are present.
The texture in shadow are completely black when a light are present .
I try to modify the code and it seems work fine.
I modify the function:
void CImageTexture::Apply(
Geom *prim,
Ray * /*ray*/,
Vector *pos,
Vector *norm,
Vector *gnorm,
Surface *surf)
.. ... ...
switch (tComponent) {
case kImageTextureType_QD3D:
tmpsurf.diff.r = outval[rchan];
tmpsurf.diff.g = outval[gchan];
tmpsurf.diff.b = outval[bchan];
//my modify
tmpsurf.amb.r = outval[rchan];
tmpsurf.amb.g = outval[gchan];
tmpsurf.amb.b = outval[bchan];
// old code
/*
tmpsurf.amb.r = 0;
tmpsurf.amb.g = 0;
tmpsurf.amb.b = 0;
*/
break;
.... ...... ....
you can see the different at this link:
Render with quesa:
http://www.interstudio.net/quesa/quesa.JPG
Render with old rayshade
http://www.interstudio.net/quesa/rayshadeold.JPG
Render with my modify rayshade
http://www.interstudio.net/quesa/rayshadenew.JPG
What do you think about this? |