PDA

View Full Version : "Real" glass still not possible in LWv9



Thomas M.
07-30-2006, 12:50 AM
Well, I did hope for some render improvements, but actually it's not working in LWv9. Although it's working in a technical way, in any real life environment it's unacceptable.

Render times for refraction, transparency, raytrayced shadows, bla, bla, bla about 3s if the backside polys do have an ref index of 1 and 100% transparency. If I assign the "real" values to the backside polys then render times increase. They increase so much that I stopped rendering after one hour. See what I'm talking about? 3s or 5400s (1 1/2h)! Ray rec was only set to 12 and a gradient was applied to reflection and transparency of the inner polys. I do know that it takes longer, needs to take longer, but in this case I suspect that the code of the renderer could need some polishing.

I did hope for some improvements since I got the impression they've changed some core elements of LW. Unfortunately the math for these parts wasn't.

I did this with the node editor and the spot info node, so there are no physical backside polys. Glad that there is this nice workaround and no more flipping and merging in modeler.

Anybody else equally frustrated?

Cheers
Thomas

jameswillmott
07-30-2006, 01:20 AM
No frustration here at all.

Can you post your node setups? Something is seriously wrong if you're getting such huge render time differences. I just tried it here and get about 3s for both airpolygons and without.

You mentioned you had a gradient for reflection for your inner polygons. A true backface surface does not have reflective qualities, only refractive. Depending on the angle this sometimes equates to total internal reflection. I suspect you are causing both internal refraction AND internal reflection with your node setup, resulting in these huge rendertimes.

Post your node graph and we can see what's going wrong.

Karmacop
07-30-2006, 01:28 AM
He's saying that when giving the backsides reflection (as they should in reality) that the render times blow out. This is because you get internal reflections. There's nothing you can do about this at the moment, but Blender seems to do something to get around this problem ...

jameswillmott
07-30-2006, 01:33 AM
You don't get reflections from a backface, since there isn't anything actually there to bounce off of. Internal reflections do occur, but they are a product of Snells Law, and are actually generated from the refraction equation, NOT the reflection equation.

Getting LW to calculate reflections for backfaces in not realistic or necessary, and due to the doubling up of reflections inside the object you then get huge rendertimes.

Titus
07-30-2006, 01:34 AM
When I have long render times due to raytracing I usually take down the ray recursion limit to 1 digit.

Thomas M.
07-30-2006, 03:06 AM
Hi James and thanks for answering so quickly.

Well, I do set up the formulas for reflection/refration in an excel sheet and always copy them to my gradients. Actually at a certain angle total reflection occurs for the inside face of a material. Before that angle most of the light is escaping the medium, but the more it reaches the total reflection angle the more light gets reflected. So it's both, reflection and refration, like on the outside surface. Otherwise jewels wouldn't "work" in real life.

I guess there should be something to be reflected. On one hand the specular highlight should get reflected (which would be the brightest reflection of a lightsource) and if we think about multiple reflections like multiple mirrors which reflect light around several "corners", the last mirror would show what's behind the corner. This effect might be subtle. But it should be there. Hope I don't miss anything in your explanation.

I guess it's like being underwater in a pool. You'll either have total reflection or a mixture of reflection and refration. Just imagine the walls of the pool would be made out of glass. If I look at the water surface from inside the pool, total reflection might occur which would direct the rays to the side of the pool in a way that the rays would leave the pool. In the end I could see what's going on outside of the pool by watching the inside surface of the water.

Hope that's not too confusing.

If it's just a marble, then I guess you wouldn't probably see the difference. But if it is a complicated structure/statue I guess there might be a big difference in the final look.

If there's a chance to prove that I'm wrong than please go ahead as long as it cuts my render times to a nicer level. Otherwise, if it doesn't affect rendertimes I'd like to be the smart-***.

Cheers and a sunny sunday
Thomas

jameswillmott
07-30-2006, 04:44 AM
Can you post your graph for us to have a look at? It's hard to explain back and forth with text, and there is the easy possibility of miscommunication...

Captain Obvious
07-30-2006, 06:37 AM
Well, I do set up the formulas for reflection/refration in an excel sheet and always copy them to my gradients. Actually at a certain angle total reflection occurs for the inside face of a material. Before that angle most of the light is escaping the medium, but the more it reaches the total reflection angle the more light gets reflected. So it's both, reflection and refration, like on the outside surface. Otherwise jewels wouldn't "work" in real life.
Yes, but this should occur even without reflections on the "air" material.

Nitisara
07-31-2006, 12:33 AM
Anybody else equally frustrated?
Yes, I met with this situation recently when trying to render CGTalk Glass Contest scene - with ray recursion 13 (needed to hit through all glass objects) LW just dies, failing to render image of any decent size.

For that purpose I made special freeware plugin GlassWorks: http://www.newtek.com/forums/showthread.php?t=50596

Its features are not only high speed raytracing, but also automatic depth thickness, Fresnel effect and no need in air surface polygons.

Hope that will help.
Nitisara

Captain Obvious
07-31-2006, 06:41 AM
Yes, I met with this situation recently when trying to render CGTalk Glass Contest scene - with ray recursion 13 (needed to hit through all glass objects) LW just dies, failing to render image of any decent size.
Er? I rendered that scene with 13 or 14 ray recursions at 1k resolution in about five minutes per anti-aliasing pass. Admittedly, that was without lighting, so the total render time would probably have been an hour per pass... but on the other hand, my computer's slow.

In the end, I just switched to Kray. It doesn't need air polygons, either. :)

duke
07-31-2006, 06:53 AM
Wasn't there a way someone found of limiting ray recursions right in the node flow? I imagine that would help significantly.

monovich
07-31-2006, 09:37 AM
I just ran into the same error listed up top. I dutifully set up my glass surface using nodes (which was good for learning), but when I finally went to double sided polys my render times went through the roof also. I was shocked when three hours later I didn't even have one 640x480 frame rendered. Unfortunately, this forced me off nodes for this project, and I grabbed FPrime like a quitting smoker grabs a cigarette. With FPrime I was back in business dialing in my surfaces/lighting/and reflections realtime.

*sigh*

I tried glassworks for five minutes, but it didn't do anything for some reason. I'm sure I was doing something wrong, but I red the little manual text at least ten times before giving up. I'll try it again later, looks very cool. And you say it's much faster also?

Captain Obvious
07-31-2006, 02:07 PM
monovich, did your render time increase when you set the other side of the material to be just plain air (ie, nothing but 100% transparancy and 1.0 IOR)?

Glassworks doesn't work in nodal, as far as I know, and it doesn't work with Fprime either.

jameswillmott
07-31-2006, 06:34 PM
Fast glass is quite possible in 9. I've attached a generic glass surface that doesn't require air polygons, using Logic nodes to set up the backface to an Air material. The logic nodes completely avoid any reflection calculations internally unless they are the result of refraction according to Snell's Law.

Internal reflections, calculated as light bouncing off the backface, rather than being refracted off it, is where I think some of these massive render times are coming from.

For the bunnies I had a rendertime of about 3 minutes with 9 passes, 16 recursions, refraction and reflection using the attached surface.

EDIT: ThomasM, I just noticed this.
If I assign the "real" values to the backside polys then render times increase

What 'real' values are you using? Backface surfaces should just be 100% Transparent, Index of Refraction of 1, Specularity, Reflectivity and Diffuse of 0.

Weepul
07-31-2006, 08:03 PM
Thomas is right - in real refractive surfaces, depending on the angle light also reflects partially or totally off the inside surface of the object. This is described by the Fresnel equations.

Including partial internal reflections is a real render-time killer and I don't know of any way around it other than decreasing recursion. Thankfully, I've found it often looks "good enough" without. (With air polys or a backface node setup, LW automatically handles total internal reflection.)

Someone made a node that returns the number of the current ray's recursion, but since there was no Mac version I can't share any hands-on experience of using it to cap internal reflections' recursiveness.

Its extreme slowness is due to each ray spawning two rays when it hits the inner or outer surface: one reflected and one refracted. Once you're dealing with rays inside the object, at least the reflected ray will again find another surface of the object, leading to two more rays, up to the ray recursion limit. Even then, I'm having a hard time figuring out just why it slows down so much - if my understanding is correct, it would not often create so many rays as would explain the slowdown, when compared to, say, Monte Carlo radiosity.

jameswillmott
07-31-2006, 08:42 PM
Oops.

8/

I was totally wrong when I said reflection doesn't occur internally ( although I'm not talking about total internal reflection here ) According to Wikipedia it occurs at all interfaces between two media...

But as Weepul said, discounting the effect of actual reflection off a backface is not a bad thing. Usually you won't notice them missing...

I'll just crawl away now. :)

Captain Obvious
07-31-2006, 09:07 PM
Its extreme slowness is due to each ray spawning two rays when it hits the inner or outer surface: one reflected and one refracted. Once you're dealing with rays inside the object, at least the reflected ray will again find another surface of the object, leading to two more rays, up to the ray recursion limit. Even then, I'm having a hard time figuring out just why it slows down so much - if my understanding is correct, it would not often create so many rays as would explain the slowdown, when compared to, say, Monte Carlo radiosity.
Oh, it's quite simple. Each refracted ray will spawn a reflection ray, another refraction ray, as well as shadow rays if you're using specularity. Then every single refraction and reflection ray will spawn the same amount of rays again. The number of rays increases exponentially.

Weepul
07-31-2006, 11:03 PM
Oh, it's quite simple. Each refracted ray will spawn a reflection ray, another refraction ray, as well as shadow rays if you're using specularity. Then every single refraction and reflection ray will spawn the same amount of rays again. The number of rays increases exponentially.
That's what I thought at first (even had it written up to post), until I realized the refraction ray will generally travel away from the object and not spawn new rays. Only the internally reflected ray is guaranteed to spawn more rays. The intense slowdown on internally-reflecting objects isn't exclusive to those which also have the view path pass through multiple layers of itself...

...or is it? I'm not sure I've ever tried just a simple pane of glass (one basic example where it would not see another part of itself in a refraction). On an object like a bottle, yeah, there's going to be a lot of exponential buildup of rays.

Captain Obvious
08-01-2006, 05:28 AM
If you have reflections on the air material, the ray leaving the pane of glass will spawn a single reflection ray. That ray will then head the other way, and spawn another reflection ray as it leaves on the other side, and then another, and another, and another...

Add shadow rays and refraction rays as they leave the pane to that, and the buildup is pretty immense.

Medi8or
08-01-2006, 07:02 AM
The node in question for PC...

If someone would donate a Mac, I could compile it. But I guess it's faster to post the source and let someone else do it.. :)

umbcel
08-01-2006, 06:14 PM
[QUOTE=Medi8or]The node in question for PC...
QUOTE]
How i can use this plugin for limit ray recursion on reflective Air surface???
Please can you add a complete node setup?
Thanks so much in advance

Umberto

silverlw
08-01-2006, 07:09 PM
I will not hijack the thread just show alternatives for both Mac and peze.

Nitisara
08-01-2006, 09:27 PM
I will not hijack the thread just show alternatives for both Mac and peze.
Nice render! Only AA is not good and caustics also grainy in some places.
Otherwise looks photoreal!

monovich
08-01-2006, 11:24 PM
I do need to try Kray out, but I'm afraid of the learning curve.

Nitisara
08-02-2006, 12:40 AM
I do need to try Kray out, but I'm afraid of the learning curve.
Kray images are superb...

Medi8or
08-02-2006, 05:08 AM
The node in question for PC...
How i can use this plugin for limit ray recursion on reflective Air surface???
Please can you add a complete node setup?Don't know how good this surface is, but I think it shows how the node could be used.
Logic 1-3 is for front side or back side of polygon (glass or air).
Gradient 1 is for external reflection, gradient 2 is for internal reflection.
Logic 4 sets internal reflection to 0 if the set recursion limit is reached.

A testrender with 8 recursions gave 16 minutes but only 3.5 minutes with internal reflections limited to 2 recursions.

umbcel
08-04-2006, 03:49 AM
Don't know how good this surface is, but I think it shows how the node could be used.
Logic 1-3 is for front side or back side of polygon (glass or air).
Gradient 1 is for external reflection, gradient 2 is for internal reflection.
Logic 4 sets internal reflection to 0 if the set recursion limit is reached.

A testrender with 8 recursions gave 16 minutes but only 3.5 minutes with internal reflections limited to 2 recursions.
:thumbsup:
:)
Thanks so much friend.

Umberto