PDA

View Full Version : refraction with intersecting objects = NOISE


dagon
05-17-2008, 09:03 AM
i don't know if this is a real bug or not, but i think this is one of the worse refraction problems right now, as i'm seeing it in many of the interior rendering, (especially in those with showcases and so)...

there is also a big difference between BSP and BSP2
here's a simple test, in the first one the objects are separeted a little bit:
http://img119.imageshack.us/img119/3570/maxnointbsp2tw7.jpg

if i allign the objects i get this (BSP)
http://img116.imageshack.us/img116/493/maxintbspkj2.jpg

or this (BSP2)
http://img119.imageshack.us/img119/5879/maxintbsp2mt5.jpg

and this is one of the reason i'm not using BSP2 in my works

any chance to have a solution for this Zap?

dagon
05-17-2008, 09:12 AM
here's with maya
no coplanar:
http://img380.imageshack.us/img380/7430/mayanointbsp2gw0.jpg

coplanar BSP
http://img380.imageshack.us/img380/6008/mayaintbspgw2.jpg

coplanar BSP2
http://img380.imageshack.us/img380/581/mayaintbsp2yk1.jpg

here's the BSP result is clearer but very strange (and it depend on the poly normals)

dagon
05-17-2008, 10:15 AM
sorry, intersecting is not the right word, i mean coplanar ;)

MasterZap
05-17-2008, 12:26 PM
But... you should never ever HAVE coplanar objects. They yeild unpredictable behaviour, by definition.

Basically... never have coplanar objects. There. Problem solved ;)

/Z

dagon
05-18-2008, 07:17 AM
But... you should never ever HAVE coplanar objects. They yeild unpredictable behaviour, by definition.

Basically... never have coplanar objects. There. Problem solved ;)

/Z
:p
i know, but this is basically impossible in an archviz environment (you know, we import models from Archicad, Autocad, Revit, Achdesktop, and so...)
and what you suggest for a typical glass over a plane? take a little bit of "air" between the two?

and what about the BSP2 problem? i'm getting also many problems (strange rings) with translucency, i think there is something wrong in the refractive BSP2... and it's a shame because with massive raytracing BSP2 it's really a kick-ass!

MasterZap
05-18-2008, 11:11 PM
I actually had a purely hypothetical discussion w. the BSP guys on this issue, if one could make it so that co-incident faces would have a defined order (i.e. at least a consistent order, maybt the order they were defined in the file, whatever).

And this *would* be technically (in principle, hypothetically, I am making no promises here) possible but ONLY if the triangles were completely identical, i.e. the verticies were the same. For any other co-planar triangles (i.e. tri's that do not share vert's but just happen to be in the same plane) it really isn't mathematically possible due to precision of floating point numbers. You will get one or the other in a random(ish) way, there is no (efficient) way out of that.

Sure you could test every interesction for another intersection nearby, and pick your "favourite" of the two (this could even be written into material shaders, in principle), but it would turn every raytrace into two (plus fail for three coplanar things).

Basically, coplanar things is bad. Such models need to be fixed. Yes, I know CAD models suck, but yell at the CAD companies, not us ;)

(OF course, someone will now write a "coplanar solver shader" based on what I wrote above, who knows, it could be useful)

/Z

dagon
05-19-2008, 03:04 AM
I actually had a purely hypothetical discussion w. the BSP guys on this issue, if one could make it so that co-incident faces would have a defined order (i.e. at least a consistent order, maybt the order they were defined in the file, whatever).

And this *would* be technically (in principle, hypothetically, I am making no promises here) possible but ONLY if the triangles were completely identical, i.e. the verticies were the same. For any other co-planar triangles (i.e. tri's that do not share vert's but just happen to be in the same plane) it really isn't mathematically possible due to precision of floating point numbers. You will get one or the other in a random(ish) way, there is no (efficient) way out of that.

Sure you could test every interesction for another intersection nearby, and pick your "favourite" of the two (this could even be written into material shaders, in principle), but it would turn every raytrace into two (plus fail for three coplanar things).

Basically, coplanar things is bad. Such models need to be fixed. Yes, I know CAD models suck, but yell at the CAD companies, not us ;)


:D thanx Zap, i really appreciate your efforts, send a big thanx to the BSP2 guy too, i'm actually doing a deep analysis on the most used raytracing features, between mray and vray (maybe i'll post it here, but i know these things could generate flames...)
actually i think the BSP2 is one of the most amazing feature on the mray core from years now, with intensive raytracing it's just... fast! even with low-polys (but you probably know that already) ;)
hope he can fix the refractive problems



(OF course, someone will now write a "coplanar solver shader" based on what I wrote above, who knows, it could be useful)

/Z
mmm it would be great for a glass shader ;) maybe i can contact lobber, he was rewriting his l_glass, it would be a nice add-on