Glass

Started by MGebhart, May 21, 2010, 05:50:46 PM

Previous topic - Next topic

MGebhart

Looking great, Dune.

Marc Gebhart

Tangled-Universe

Quote from: MGebhart on May 26, 2010, 01:45:17 PM
Looking great, Dune.

Yes indeed, except for the lack of refraction?

Tangled-Universe

Oh it just occured to me that the watershader isn't working for this because of the same reason you can't render an underwater-scene.
The shader is "one-sided".
Hmmm...just thinking out loud.

Dune

What do you mean by refraction?

Tangled-Universe

Quote from: Dune on May 27, 2010, 03:17:29 AM
What do you mean by refraction?

Refraction (refractie in NL) is the effect that light is being bended when it passes through different media.
This optical property causes that when you look through a glass ball the reflection inside the glass ball is bended/deformed.

The measure of refraction is IOR = Index Of Refraction.
For water this is 1.33 and it is the reason why you a fish always seems 1/3th bigger when it's in the water, given that you look at it from the air :)

For glass this is 1.5-1.6. The examples I've seen here so far use other IOR values to achieve a glass-effect, but are not correct and a kind of "cheat".

Oshyan

Um. Wow guys, hehe. I don't even know where to begin. I'd love to help but... I can't really sort out the issues here. I do think I understand what's trying to be achieved at least. TG2's transparency function is focused on use for water, so that's what it's good at. It's not designed for rendering glass balls floating in mid-air, so it's not surprising it doesn't work well. ;) It would be good to have a more general purpose (albeit slow rendering) transparency shader though.

- Oshyan

airflamesred

All these spheres floating reminds me of early Bryce!
Speaking of which, the Bryce preset glasses have a refraction index that varies from 1 to 2.55. So although not anatomically correct, the results depend on so many other elements within the scene.

Dune

Of course, lichtbreking. These are 'glass' balls, not water filled bubbles, so I guess 1.5-1.6 would be ok. But I wouldn't know how to achieve this probably subtle bending. But the point was mainly to get transparancy, not projection on the inside of a ball, such as earlier examples are.
I don't use these, but it's fun to play with.

---Dune

Tangled-Universe

Quote from: Dune on May 27, 2010, 07:01:36 AM
Of course, lichtbreking. These are 'glass' balls, not water filled bubbles, so I guess 1.5-1.6 would be ok. But I wouldn't know how to achieve this probably subtle bending. But the point was mainly to get transparancy, not projection on the inside of a ball, such as earlier examples are.
I don't use these, but it's fun to play with.

---Dune

Lichtbreking, indeed :) I suppose people are after a solid glass ball. If you have a glass ball with air inside then you would have the refraction effect multiple times, since the light passes through different medium for 4 times (air -> glas -> air -> glas-> air).

dandelO

Quote from: Matt on May 27, 2010, 04:22:15 AM
It looks like there is a bug here, but I can't say any more than that without digging deeper. It's possible that I changed something in the transparency functions or perhaps in the way built-in objects are ray traced to fix some other problem. The ray tracer underwent lots of small changes for 2.1, so it might have happened then.

Kind of the same subject so, this probably applies here, too.

dandelO

Quoteso it's not surprising it doesn't work well

Not trying to be farty but, it really did used to work well, Oshyan. See the image in the first post of the 'water shader optimizations?' thread.
I hope Matt discovers where the actual problem lies and that some solution can be put into place.

These have been really great threads with lots of good input from everyone.

TheBlackHole

I wonder if, using the same method I use for atmospheres in Anim8or and a reflective shader, I could create an effect like light bending around a black hole like this:
http://www.astronomie-heute.de/sixcms/media.php/912/thumbnails/SLMilch-1.jpg.398107.jpg
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

Tangled-Universe

#87
Meta-materials, which have a negative refraction index, bend light "around" itself.
http://en.wikipedia.org/wiki/Meta-material
So my guess for obtaining this effect is trying something with such a refraction index.

dandelO

I haven't tried this but, in my experience with TG, a refraction index of '1', and smaller, creates a completely black surface. I imagine the same for negative values would be true. I'll give negative refraction a shot later to test it out. I'm almost sure it won't work, though.

dandelO

#89
WOW!!! It works!

This is just with adding a negative to the default 1.33 of a reflective shader on a sphere object.

[attachimg=#]

Now, to try and control it and see what uses it might have...

Edit: Like positive refraction values, you must go beyond -1.