fathomgames

fathomgames

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

refraction attenuation in surface model Nov. 18, 2014, 2 a.m.

yeah, I is the current ray being traced. the point is that the tinting of the ray uses I to calculate the tint which will only ever work accurately if you're tinting the current shading sample.

if you have a simple closed shape with attenuation on it, then it will work fine. there's logic in the shader to do different things based on the dot prod of the normal and the I vector. so the first intersection gets no tint and the second gets tinted based on I (from the first intersection to the second intersection). but if you throw in a second object with a different material, it will fail to tint the second material.

refraction attenuation in surface model Nov. 17, 2014, 2:03 p.m.

so maybe i'm not understanding what this is designed for, but it seems like it's not working.

on the refraction tab of the surface model, there's an option to enable attenuation with a density and a color to describe the effect. sounds perfect for my needs – refracted rays get tinted by some amount of attenuation.

but the subnetwork describes something completely different if i'm following the code. it tints either the refraction ray or the reflection ray (depending on the dot prod of the surface normal) but it uses I in the the attenuation calculation. this I is the global I of the current shading sample. this is NOT the ray length of the ray that was traced from the refraction/reflection calculation… it doesn't seem to make sense to tint the refracted/reflected rays of the surface based on the distance of the trace that got you to this point.

really, i don't see that a shader can get me where i want to go (at r&h we had to hack the pbr tracer or add a fog shader for non-pbr to get this effect). but i've been surprised by pbr in the past, so maybe i'm wrong here.

index of refraction Sept. 7, 2006, 5:19 a.m.

is it just me, or does mantra not handle refraction very well?

a simple example:

take a sphere and put another sphere inside it roughly half the size.
give each sphere its own glass shader (vex glass).
zero out the specular(s) so you can see what's going on better.
add a plane with some kind of pattern (checks or somethign).
leave the ior alone for now (1.2 default, i think)
render it.

you'll see two levels of distortion – one inside the other. but that is incorrect, unless i'm insane. going from a material of 1.2 ior to another material of 1.2 ior should not alter the path of the ray of light – it should continue in a straight line, shouldn't it? ior is a relative thing.

i'm also somewhat suspicious of the ray exit math, as i seem to be getting a ponderously large amount of total internal refraction from things like spheres with modest ior's (like 1.2). i'm conerned that rather than the ray “unbending” on exit, it's getting the same bend it got when it first hit the glass sphere.

can anybody confirm this?