PDA

View Full Version : Raytraced and spherically mapped Bug



wizlon
07-05-2006, 03:57 PM
Raytraced and spherically mapped objects that are inside of glass/air objects do not recieve the spherical mapped reflections unless you remove the air surface!

Anyone know a fix for this bug?

I guess I should report this clanger to Newtek.
Broke in LW9 Beta Also.

Cheers.

Lee.

jameswillmott
07-05-2006, 04:51 PM
Can you post content for this?

Dave Jerrard
07-06-2006, 06:19 AM
Not a bug. Really.

If you turn off Ray Trace Reflections, the Reflected Image will appear, but if Trace Reflections is on, it won't. It has nothing to do with an air surface. Reflected images are not traced through transparent or reflective surfaces at all. Well, not in the normal way. It's not a bug, and here's why:

The reflected image is a surface attribute, not a global one. If you apply the image to the environment, using Textured Environment, then it will appear in the reflections & refractions as expected. Applying it to the surface isolates the image to that surface. Only that surface can see the image. Now, if you also apply that image to another surface that's visible in the reflective one, it will show up in both. This is because it's now a surface attribute of the reflected surface, which is seen in the reflection of the first object.

For example, you have a ball within a ball, which I'll duplicate here with a silver ball inside a glass one. The silver one is, well, silver, and the glass one has a glass outer surface (IOR 1.2 to minimize disortion) and an inner air surface (IOR 1) with nothing but 100% transparency and 0% diffuse - it's completely transparent. I've added a Crumple bump map to the air so you can see it's actually reflecting in the surface of the silver ball - the reflection is slightly disorted.

First, a render of the silver ball, against a standard gradient backdrop. The glass ball is not visible in any way (it's unseen by rays and by camera). Just a silver ball, and a backdrop. All ray tracing options are active.


http://davejerrard.postresource.com/Bugs/ReflectedImage-01.jpg

Now we add the glass ball. Due to the rays entering the smooth (non-bump-mapped) glass with a higher refractive index, reflecting off the ball and then passing through a bumpy air surface with a refractive index of 1, the reflections in the ball are slightly distorted. The ball itself is not distorted because it's seen only through a smooth surface. You can see the air surface is distorting the backdrop, and the ball is showing the same distortion in its reflection.


http://davejerrard.postresource.com/Bugs/ReflectedImage-02.jpg

Now we add a reflected image to the silver ball. As you can see, there's no change. The outer sphere doesn't see this image because the image is not applied to any of its surfaces. The backdrop gradient is being rendered through it instead, because that's actually the environment and it can be ray traced.


http://davejerrard.postresource.com/Bugs/ReflectedImage-03.jpg


If we turn on Unseen By Rays for the glass ball, the reflected image shows up on the silver one. The glass ball is sill visible to the camera (but the air surface isn't because it needs to be ray traced through the glass), so the silver ball is actually being ray traced through the glass. The reflected image IS visible through ray traced transparency!


http://davejerrard.postresource.com/Bugs/ReflectedImage-04.jpg

Since this works, let's try adding the same image to the air surface of the glass ball. Since this surface isn't reflective and we're trying to see the image through it, let's apply it to the air surface's Refraction Options. Unseen By Rays will have to be turned off again as well. Now the image is reflected in the silver ball again.


http://davejerrard.postresource.com/Bugs/ReflectedImage-05.jpg

In fact, we don't even need to have the image applied to the silver ball at all. Since all the polygons around it are refracting that image, it's all the silver ball will be able to see. If you take the image off the silver ball now, there won't be any difference in the rendered image.

Note that you will now see the image in the air polygons themselves as well. There's no convenient way around this. You could try making two glass ball objects, one with the image and the other without. The one with the image would be Unseen By Camera, and the other would be Unseen by Rays, and some compositing will be needed. There might be a way using nodes, but like I said, it's not going to be all that convenient.

A similar thing occured in earlier versions of LightWave with HyperVoxels 1 & 2, where a special shader had to be applied to a surface for HVs to be visible in reflections & transparency.

Since some people will wonder why the image isn't ray traced through other surfaces, first, it's a surface property. It only shows up on the surface it's applied to. Any other surfaces this surface can be seen in will be able to see it, since they can see all the surface properties, as long as the object isn't further occluded. Second, what if you have two surfaces that are using different images? This is what I'd expect in such a situation:


http://davejerrard.postresource.com/Bugs/ReflectedImage-2Balls.jpg

It's not a bug. You just have to handle this a bit different.


He Who Is Used To Different.

sherridge101
07-06-2006, 07:21 AM
Hi Dave,

Thanks for the detailed explanation.
I understand why it doesn't work now, but I'd still class this as an essential feature that is missing from Lightwave if this means that I have to render out separate passes for comping.

Cheers,
Steve and Lee

Lightwolf
07-06-2006, 07:30 AM
I understand why it doesn't work now, but I'd still class this as an essential feature that is missing from Lightwave if this means that I have to render out separate passes for comping.

I guess the question is: do you want it to raytrace reflections... or not?

There is always the possibility of using an environment image for what you seem to have in mind.

Cheers,
Mike

wizlon
07-07-2006, 07:05 AM
Mike, I want it to do what it says in the reflection options menu - raytrace + spherical map.

If I have 36 objects, each with it own refection map and different image seam angle, this would make it awkward to do as global environment image.

But as Dave said I guess there are other options.

Cheers.

Lee.

Lightwolf
07-07-2006, 07:30 AM
Mike, I want it to do what it says in the reflection options menu - raytrace + spherical map.

Well, as Dave mentioned, that is exactly what it does... it raytraces, and if it doesn't hit anything it returns the spherical map....

I guess it would qualify as a feature request for sure... calling it a bug is imho just a bit harsh ;)

Cheers,
Mike

Dave Jerrard
07-07-2006, 11:11 AM
I don't think this would be a feature anyone would really want to use if you really think about it. Again, if you have two surfaces set to reflect or refract different images, which images get seen in the other surfaces? Changing it could turn out to be a real nightmare to use.

The current method works like it should, and has actually been a pretty bug-free feature for many years now.


He Who Has A Hard Time Adjusting To 8.5 Again.

sherridge101
07-10-2006, 09:08 AM
The question came about whilst working on a project where we had water drops (that looked best with raytraced and spherically mapped surfacing) behind a glass object that looked better reflecting boards (objectst) or a different image. With the air surface and refraction on, the drops were'nt rendering.
Cheers,
Steve

byte_fx
07-12-2006, 10:20 AM
Question: For the above discussion were the shadow options on or off for the air layer?

byte_fx