Sorry to be asking this one. I've got that problem of applying a shader to a plane but rotated the wrong way and ends up all streched over the surface.
Its a rman shader if that makes any difference. Heres the code:
surface xxx (float d=0.5; float freq=10)
{
float bw=noise(s*freq,t*freq);
normal Nf=faceforward(normalize(N),I);
color Ct=mix(color “rgb”(bw,bw,bw),Cs,d);
Oi=Os;
Ci=Oi*Ct*diffuse(Nf);
}
Cheers Henster
Daft shader question
3311 1 0- Henster
- Member
- 196 posts
- Joined: July 2005
- Offline
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
Any rotation, stretching, or distortion of any kind, has nothing to do with your shader (which simply assume that s and t are well defined) and everything to do with how you are applying your texture coordinates.
Make sure your geometry gets a properly defined MAPU and MAPV, and your noise will work fine.
BTW; you don't need to specify “rgb” when declaring a color since that is the default color space; so that line could be just:
color Ct=mix(color(bw),Cs,d);
Make sure your geometry gets a properly defined MAPU and MAPV, and your noise will work fine.
BTW; you don't need to specify “rgb” when declaring a color since that is the default color space; so that line could be just:
color Ct=mix(color(bw),Cs,d);
-
- Quick Links