SvenP Posted June 7, 2006 Share Posted June 7, 2006 I am having a problem with a shader i just started to write . The shader shows up fine in shops preview but only renders white in mantra . Maybe one of you knows a solution for that problem . Screenshot : Source: #define STEPMOD pow(dot(normalize(N),normalize(I)),4) #define STEPS r*2/stepsize float FalloffFunction(vector pivot,pos; float radius;) { return 1-pow(radius/distance(pivot,pos),4);} float DensityFunction(vector pos;) { float TotalDensity=anoise(pos*4,6,0.7,1)*4; TotalDensity=clamp(TotalDensity,0,2); return(TotalDensity); } surface Cloud( float r=.5; float stepsize=.01; vector pivot={0,0,0}; ) { int steps = STEPS*STEPMOD; vector marchdir = normalize(P-Eye)*stepsize; vector currentpos = P+nrandom()*stepsize; vector Cv = 0,Ov = 0; float TotalDensity=0; float Density; float Falloff; if(dot(normalize(N),normalize(I))<0) { int i; for (i=0;i<steps;i++) { Falloff = FalloffFunction(pivot,currentpos,r); Density = DensityFunction(currentpos); TotalDensity += Falloff*Density; currentpos += marchdir; } TotalDensity=TotalDensity/(STEPS); Cf = Of = Af = TotalDensity; } else { Cf=Of=Af=0; } } Quote Link to comment Share on other sites More sharing options...
sibarrick Posted June 7, 2006 Share Posted June 7, 2006 I haven't checked your code but I have come across this before when nothing was wrong but houdini just rendered white until I resaved the code into a different otl.... Quote Link to comment Share on other sites More sharing options...
SvenP Posted June 7, 2006 Author Share Posted June 7, 2006 I haven't checked your code but I have come across this before when nothing was wrong but houdini just rendered white until I resaved the code into a different otl.... 28414[/snapback] i already tried that but it doesnt help Quote Link to comment Share on other sites More sharing options...
sibarrick Posted June 7, 2006 Share Posted June 7, 2006 I just copy your code into an otl and it works fine. The only thing I did was change the name to v_cloud. So the code is good it must be an otl thing. Try the attached Cloud.otl Oh and I did this in H8 not H8.1 don't know if that makes any difference. 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.