Jump to content

Houdini glass at gazing angles


Recommended Posts

Hi everyone, experimenting with houdini pops up a lot of questions

this time i want to ask about the glass in houdini, in particular the glass shader that ships with houdini

in fact the test i was conducting was:

an opaque surface, on top of it there is a thin glass piece and between the two (i left some room in the back of the glass) there is a constant shader (used to be the light emitter)

so all works well, unless my glass face gets near gazing angles then my glass will look pitch black except for its edges, and it's the same even if i take down the reflectivity.

while i think in real life if you put any piece of glass and you put a light behind it, you should always be able to see the light (can someone confirm that ? )

so any explanation about what's happening and how to fix it, and about the fresnel effect in houdini would be appreciated.

Thanks

Regards

Link to comment
Share on other sites

post-1116-1239122896_thumb.jpg

A light bulb :)

Notice the high reflectivity towards the grazing angles. The fresnel effect is clearly visible. So that's one answer. As for why the reflections are black: try putting a sphere with a white constant material on it around your scene. Even better: find a good studio HDRI and apply it as a texture to the sphere. This should take care of the final reflection rays that currently probably hit nothing, hence returning black.

One thing to keep in mind in Houdini is that the IOR is the opposite of what it is in other applications - so for glass, you should use an IOR of 1/1.55 in your fresnel VOP - it's the default in the glass material AFAIK. Also, is your glass object double sided?

cheers,

Abdelkareem

Link to comment
Share on other sites

post-1116-1239122896_thumb.jpg

A light bulb :)

Notice the high reflectivity towards the grazing angles. The fresnel effect is clearly visible. So that's one answer. As for why the reflections are black: try putting a sphere with a white constant material on it around your scene. Even better: find a good studio HDRI and apply it as a texture to the sphere. This should take care of the final reflection rays that currently probably hit nothing, hence returning black.

One thing to keep in mind in Houdini is that the IOR is the opposite of what it is in other applications - so for glass, you should use an IOR of 1/1.55 in your fresnel VOP - it's the default in the glass material AFAIK. Also, is your glass object double sided?

cheers,

Abdelkareem

Thanks Abdelkareem

your answers are always argumented with real life examples :) i like that

that inversed IOR thingy got on my nerves for half a day before i discovered that it's the inverse , not so logical i should say especially that their definition in the help is smtg like IOR = 1/IOR funny :D

in fact for the reflections yes sure if the env is left black it will return black, but here i can comment two things

1 - if i take the reflection intensity down to 0 i keep seeing black

2 - at some points the glass is just in front on the object with constant shader and even with refl taken down to zero i can't see the object behind it

at the studio they don't accept me posting images of the projects, so here are two images, they don't maybe show the problem as is, but they surely show some odd behavior, the full glass one is just a glass with one side so supposedly it's acting like a cube made of glass (not empty)

and the second one is a glass cube with thin sides. it doesn't look acceptable to me :|, and it's clear that at the grazing angles there's also some odd behavior happening.

post-4469-1239132419_thumb.jpg

post-4469-1239132431_thumb.jpg

Edited by nmn
Link to comment
Share on other sites

Hi nmn,

You need to facet the edges of your cube. Mantra is interpolating the normals across very sharp angles, hence the weird shading.

btw, your threads should go in the Rendering forum here. ;)

that looks more logical lol , in fact i used the facet you saw it but i thought it do it automatically, i mean harden the edges, now i read about it :) , the node that does that automatically is the cusp SOP right ?

now i'll do my tests on the real scene to see what it gives :)

sry about posting the posts in the general sections , i almost forgot there is a rendering section down here

Regards

Link to comment
Share on other sites

Facet SOP with Cusp Edges turned on will do the trick. EdgeCusp SOP requires you to select the edges.

I forgot to mention, sometimes when you get black showing up in glass renders it can also be because the reflect/refract limit are set too low.

Cheers.

Link to comment
Share on other sites

i did the tests on the real subjet and i'm still getting black :( , in fact you can imagine the real subject as a thin glass face (like the glass of a window) placed on top of a dark gray plastic piece and between the two there is object light emitter, no lights in the scene, and there is a constant white hemisphere all around, the glass has the default glass on it. but still it's not giving me anything similar to the cube scene, it's giving some reflections ... etc but at grazing angles the light emitters don't appear at all and the glass surfaces show black... why do you think that is ? :blink:

is there anything special to set the reflect refract limit ? or it's only the reflection and refraction intensity ?

Cheers

Link to comment
Share on other sites

Hmm, really hard to troubleshoot without the scene or at least a render. Not even sure if I'm picturing it right from your description. :lol:

i'll try and make a scene that ressembles more to the real case when i get my hands on houdini, and will post it, so we can discuss it based on smtg :)

Link to comment
Share on other sites

i'll try and make a scene that ressembles more to the real case when i get my hands on houdini, and will post it, so we can discuss it based on smtg :)

i built smtg that could represent the case, but at the company they didn't accept me posting it ... so ... afraid i can only describe with words ...

i'll try and clarify a little, the problem is that the reflection of the glass in real life is also dependant on the amount of light there is behind it, so if at night

you have a glass window and you look at it (especially at grazing angles) it will be far more reflective than if you have smtg lighting behind it

so in my case i have object light emitters behind the glass and at grazing angles i can't see them at all ( though in perspective they are behind the glass, which means thay have to be seen through the glass ...

hope that a little bit clearer ? :S

Cheers

Link to comment
Share on other sites

you have a glass window and you look at it (especially at grazing angles) it will be far more reflective than if you have smtg lighting behind it

so in my case i have object light emitters behind the glass and at grazing angles i can't see them at all ( though in perspective they are behind the glass, which means thay have to be seen through the glass ...

I'd say Yes and No to this.. it doesn't matter how much light is in the environment - the object will be reflective at the grazing angles regardless. The environment doesn't affect the surface properties. A mirror in a dark is still reflective, just reflecting something dark. However, if you have a bright or detailed environments, it'll be far more visible than a dark or featureless environment. I think you could say it might seem more reflective if there is something to reflect.

Link to comment
Share on other sites

I understand what you're talking about now and that's something I've noticed before. The fresnel function seems to have a very steep falloff at grazing angles. I was going to say at extreme angles, but as you noticed, it's really not! You can even check this interactively in the VOP viewer when working with the Fresnel VOP.

Is this physically correct? It doesn't strike me so. To make sure I wasn't crazy I took the glass out of a picture frame, put a flashlight up against the back and examined it. No matter how shallow an angle I looked at the pane, the flashlight never completely disappeared. In the scene below you can see the refracted light emitter already disappearing. Only a couple more degrees and it's gone completely and you're left with reflection only. :huh:...

glass_grazing_angle.jpg

I don't have time to try it myself, but I think you could get around this by substituting Fresnel with an EdgeFalloff in VOPs nmn.

glass_grazing_angle.zip

Link to comment
Share on other sites

Is this physically correct?

Yes, it's physically correct or near as dammit, but in a perfect world :) Just take Total Internal Reflection, for instance - it has a very sharp reflection at the critical angle. If it didn't have a sharp introduction of 100% reflectivity, this email would be sent on copper instead of fibre ;)

Imperfections in the real world lead people to people wanting to fudge a bit of this themselves.. in fact, it's very common to use just a gamma'd EdgeFalloff instead of fresnel weights ( like: pow(dot(N,I), intensity) ) or slightly lifted floors on fresnel (like: fit( fresnel(nN,I), 0,1, 0.05,1) ).

Link to comment
Share on other sites

Yes, it's physically correct or near as dammit, but in a perfect world :) Just take Total Internal Reflection, for instance - it has a very sharp reflection at the critical angle. If it didn't have a sharp introduction of 100% reflectivity, this email would be sent on copper instead of fibre ;)

Imperfections in the real world lead people to people wanting to fudge a bit of this themselves.. in fact, it's very common to use just a gamma'd EdgeFalloff instead of fresnel weights ( like: pow(dot(N,I), intensity) ) or slightly lifted floors on fresnel (like: fit( fresnel(nN,I), 0,1, 0.05,1) ).

Ahhh, okay. Yeah, the "perfect world" thing makes sense. Maybe if the glass were 100% free of impurities and perfectly smooth we would be seeing results closer to this in the real world. I think I will in fact start using edge falloff for this stuff. Thanks Jason. :)

Link to comment
Share on other sites

The environment doesn't affect the surface properties.

:) sure the env doesn't affect the surface properties, but maybe to clarify my idea here, i would say... if you stand up in front of that big door with big flat glass panel, if outside is dark you can see yourself, if outside is fairly lit you can't see your reflections, in fact i think that is due to the amount of refl vs refr light and your iris adaptation, since the refl are the same but in dark env your eyes detect dimmer rays.

@DaJuice : ye you got it man this is what i was talking about. VOP viewer ?

it's very common to use just a gamma'd EdgeFalloff instead of fresnel weights ( like: pow(dot(N,I), intensity) ) or slightly lifted floors on fresnel (like: fit( fresnel(nN,I), 0,1, 0.05,1) ).

any example or step by step for that would be really appreciated :unsure: .

And yes the "perfect world" thing is the only logical explanation, since internal reflections are preventing our light emitter from showing.

Thanks again guys.

Best Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...