This dummy code doesn't trace back reflections from an AiStandardSurface shader (on the right) if caustics are not enabled in the material. The problem is of course that as soon as caustics are enabled a lot of fireflies just start appearing.
However an AiStandardSurface traces back reflections from another AiStandardSurface even without caustics enabled. So, - how can we get reflections while tracing an AiStandardSurface without caustics enabled ? Thanks !
AtScrSample scrs; scrs.color = 0.f; if(sg->Rt != AI_RAY_DIFFUSE_REFLECT) { AtVector rdir= AiReflect(sg->Rd, sg->Nf); AtRay wi_ray= AiMakeRay(AI_RAY_ALL_REFLECT, sg->P, &rdir, AI_BIG, sg); if( !AiTrace(wi_ray, AI_RGB_WHITE, scrs)) AiTraceBackground(wi_ray, scrs); } sg->out.RGB() = scrs.color;
Solved! Go to Solution.
Solved by sebastien.blaineau.ortegaHRM3U. Go to Solution.
Ehy there, no one on this ..
doesn't look weird to you that your own materials cannot be fully traced ? Yes it works with AiBSDFIntegrate but I still need AiTrace alone to be able to trace reflections of an AiStandardSurface. Can someone chime in .. thanks in advance !
Ehy guys c'mon, I need an answer here. Can't you just take a look at the base code and see what's preventing your own SDK trace function to fully trace AiStandardSurface ? Thanks. Appreciated.
Hi,
speculars are only evaluated after a diffuse bounce if caustics are on.
Here your ray type is AI_RAY_ALL_REFLECT, which is a combination of diffuse and specular, so this might be the problem. Could you try replacing it with AI_RAY_SPECULAR_REFLECT ?
Hi Sebastien,
thanks it works with AI_RAY_ALL_SPECULAR (AI_RAY_SPECULAR_REFLECT). I'm still not sure however why it isn't also working with AI_RAY_ALL_REFLECT but if you say you have some kind of heuristics in place to deal with caustics I just take that as a fact. So it's all cool at the moment 🙂
Thanks ! Max
Maybe the ray types and terminology changes in Arnold 5 are making it confusing :
-AI_RAY_DIFFUSE_REFLECT (diffuse reflections, some would simply say "global illumination")
-AI_RAY_SPECULAR_REFLECT (previous "glossy" rays in Arnold 4, for blurry or sharp reflections )
-AI_RAY_SPECULAR_TRANSMIT (sharp or blurry refractions)
-AI_RAY_ALL_REFLECT (mixture of diffuse and "glossy")
-AI_RAY_ALL_SPECULAR (mixture of "glossy" and refractions)
In your case, I think it makes more sense to use AI_RAY_SPECULAR_REFLECT since that's what your ray is doing. AI_RAY_ALL_SPECULAR would also consider this ray as a refraction, which could affect the ray depth, etc....
Yep as noted above I'm using AI_RAY_SPECULAR_REFLECT. And thanks for the clarification about ray types.