PDA

View Full Version : DoubleSided and transparency ?



madno
01-22-2015, 04:11 AM
Hi,

I am trying a scene with double sided geometry that has some other geometry inside it. I can't get it to work as I need it.

Here is a simplified test scene:

The sphere should be transparent to reveal what is inside it. But the transparency should only appear on the front side of the sphere, not on the back.
Furthermore the transparency should fade out at higher glancing angles.
The inside of the sphere should have a different surface than the outside,

So I like to have a "window" in the front of the sphere that fades out according to its angle to the camera.

What I did:

made a double sided sphere and put a gradient to control the transparency
the gradient is set to incidence (this makes the sphere transparent on the front and the back)
to get rid of the backside transparency I gave the inside polygon side a different surface (which I anyway wanted).


The problem now is, that the inside surface seems to cast shadows even though from the outside it looks transparent. If I switch off "self shadow" for the object, this problem goes away but then the whole shading looks wrong of course.

126631 126629

Is there a way to get this working?
Maybe the "transparency by incidence" is a wrong idea at all?

Pensart
01-22-2015, 09:17 AM
I hope i'm on the right track what u want to achieve. After reading your question several times its still not fully clear to me.
What about mixing the the incidence angle gradient with another gradient to prevent the transparency reaching the back surface.
Or in other words to make sure the transparency would stop at the center of the object?
Could be controlled by a null in the center of the object and another null where to start the transparency.
Or even a gradient ranging from distance to camera to center of object. Both cases would prevent the transparency to go beyond the center.
Is that what you're asking Madno?

JoePoe
01-22-2015, 10:39 AM
How about making the inside a hemisphere (a tiny bit smaller). Use target control in motion options so it's always facing the camera.

126632

edit: so I'm looking at this again. It's strange. The blue sphere with the gradient on transparency is casting the correct
(I think) shadow on the interior gold hemisphere... But it's not casting a shadow on the box (or the box isn't receiving). But all cast/receive settings are good. :stumped:

madno
01-22-2015, 02:23 PM
Thanks for the help,

Pensart, the real object will be something like in the render below. I think the null trick won't work in that case (but I'll try it in other cases).

126633

JoePoe, can you provide the scene? I can't get anywhere near to what I see in your example. If I understand you right, the example is not with two spheres but with one double sided one, right?
Are you on 2015.1 or another version of LW?

EDIT: I read your post again. You are using two spheres. Sorry for missunderstanding first.

Made more tests (with 2015 and 11.6.2). It seems that wehnever shadows are active (either on the light and / or the sphere) and a doublesided surface is used, then the inside pointing surface side is casting a shadow. It ignores that its outside sister is transparent. So the question now is, how to tell the inner surface side to use the same transparency like the outer surface side at the same position in space? I am stuck, because I don't know.

lertola2
01-22-2015, 04:34 PM
Thanks for the help,

Pensart, the real object will be something like in the render below. I think the null trick won't work in that case (but I'll try it in other cases).

126633

JoePoe, can you provide the scene? I can't get anywhere near to what I see in your example. If I understand you right, the example is not with two spheres but with one double sided one, right?
Are you on 2015.1 or another version of LW?

EDIT: I read your post again. You are using two spheres. Sorry for missunderstanding first.

Made more tests (with 2015 and 11.6.2). It seems that wehnever shadows are active (either on the light and / or the sphere) and a doublesided surface is used, then the inside pointing surface side is casting a shadow. It ignores that its outside sister is transparent. So the question now is, how to tell the inner surface side to use the same transparency like the outer surface side at the same position in space? I am stuck, because I don't know.

You could make two layers with the same polygons. Have the surfaces be single sided. Flip the polygons on one of layers to make it the inside surface and turn off cast shadows for that layer.

Sensei
01-22-2015, 05:16 PM
Ray hits Sphere surface outside. Polygon Side is true.
Gradient is calculated, then Standard, then Switcher gives it to LW.
And there is transparency 100% on some pixels.
Ray goes to inside of object.
Flies and hits box.
Box surface Lambert shading is sending shading rays to light source to find whether there is something in between.
And again Sphere surface node is calculated.
But this time Polygon Side is false, and False branch of Switcher is calculated.
And what is there?
Completely opaque yellow surface.
So "shadow ray" returns "there is geometry!" and renderer knows to that light is not illuminating that location.

Try modifying Box surface:
http://forums.newtek.com/attachment.php?attachmentid=126634&d=1421971741

Is that good?

Box is dark because it doesn't get any light from light source, it's covered by sphere surface..

Or maybe this is fine?
http://forums.newtek.com/attachment.php?attachmentid=126637&d=1421978403

jboudreau
01-22-2015, 05:33 PM
Hi,

I am trying a scene with double sided geometry that has some other geometry inside it. I can't get it to work as I need it.

Here is a simplified test scene:

The sphere should be transparent to reveal what is inside it. But the transparency should only appear on the front side of the sphere, not on the back.
Furthermore the transparency should fade out at higher glancing angles.
The inside of the sphere should have a different surface than the outside,

So I like to have a "window" in the front of the sphere that fades out according to its angle to the camera.

What I did:

made a double sided sphere and put a gradient to control the transparency
the gradient is set to incidence (this makes the sphere transparent on the front and the back)
to get rid of the backside transparency I gave the inside polygon side a different surface (which I anyway wanted).


The problem now is, that the inside surface seems to cast shadows even though from the outside it looks transparent. If I switch off "self shadow" for the object, this problem goes away but then the whole shading looks wrong of course.

126631 126629

Is there a way to get this working?
Maybe the "transparency by incidence" is a wrong idea at all?


Hi

Is this what you are looking to do?

126635

Let me know and I can provide the scene or explain how I did it

Thanks,
Jason

madno
01-23-2015, 01:11 AM
I made an example of what I am trying to do. This time it is real thickened geometry. So it is basically the atempt to mimic a real opening by using transparency and double sided polygons.

126642

Jboudreau, your scene and explanation is very appreciated.

Sensei
01-23-2015, 01:22 AM
126643

Like this?

JoePoe
01-23-2015, 07:02 AM
The key thing that he's missing is for the edge of the transparency window to cast a shadow. In my example above, I got it to cast on the interior hemisphere but not on the cube. Which is weird. Why one object and not another?

Madno... was the interior second hemisphere approach unusable for your object? Do you still want the scene?

jboudreau
01-23-2015, 07:23 AM
The key thing that he's missing is for the edge of the transparency window to cast a shadow. In my example above, I got it to cast on the interior hemisphere but not on the cube. Which is weird. Why one object and not another?

Madno... was the interior second hemisphere approach unusable for your object? Do you still want the scene?

It looks like his example above is doing what he wants, The edge of the transparency window is casting a shadow on the cube. What is the problem with his latest example? As for why yours is not casting a shadow on the cube, do you have your cube object set to not receive shadows

Thanks
Jason

JoePoe
01-23-2015, 08:00 AM
It looks like his example above is doing what he wants, The edge of the transparency window is casting a shadow on the cube. What is the problem with his latest example?

He's using actual thickened geometry instead of an incidence gradient in that example. Fine if that's okay. Seems like he wants to recreate that effect without geometry.


As for why yours is not casting a shadow on the cube, do you have your cube object set to not receive shadows.

Nope, ...all shadow settings seem to be how they should be. That's why it's weird. :)

Works with a weight map as gradient input! No extra geometry.

126645

But then you lose the incidence action....

JoePoe
01-23-2015, 09:31 AM
So after all that.... it seems that the cube just needed to be moved into the shadow. The light angle is hard to judge with the incidence gradient. It seems like it needs to be a little more than what it looks like it "realistically" should be.

Back to using incidence angle on gradient....

Area light:
126646

DP Infinite:
126647

pretty severe angle:
126648

This is still using the hemisphere inside (targeted to camera) to cover up the transparency on the far side.
(I tried with Sensei's Shadow Ray for the inside of the double sided sphere.... but even at the new found light angle & cube placement, I still didn't get the window shadow on the cube or on the interior of the sphere.)

madno
01-24-2015, 08:09 AM
JoePoe is right, idea was to mimic the example of the real geometry with just a double sided surface. Finally found a way based on your feedback.

126651 126652

Final trick was to use the cameras item info "forward" information of the outside surface and feed it into the vector of the incidence. Then just invert that and feed it to the inside surface.

Thanks all.