question

Max Tarpini avatar image
Max Tarpini asked ·

AiTrace doesn't trace AiStandardSurface reflections (without caustics enabled)

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;

renderstandard surface
noreflections.png (948.8 KiB)
2 comments
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

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 !

0 Likes 0 ·

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.

0 Likes 0 ·
Sebastien Blaineau-Ortega avatar image
Sebastien Blaineau-Ortega answered ·

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 ?

10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Sebastien Blaineau-Ortega avatar image
Sebastien Blaineau-Ortega answered ·

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....

10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Max Tarpini avatar image
Max Tarpini answered ·

Yep as noted above I'm using AI_RAY_SPECULAR_REFLECT. And thanks for the clarification about ray types.

10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Max Tarpini avatar image
Max Tarpini answered ·

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

10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.