Planetside Software Forums

General => Terragen Discussion => Topic started by: MGebhart on May 21, 2010, 05:50:46 PM

Title: Glass
Post by: MGebhart on May 21, 2010, 05:50:46 PM
Here is a Glass shader I made. I used a reflection shader and not a water shader.

If you noticed I turned off shadows. You will never get a realistic Glass shader until Terragen address light caustics.

NOTE: If I'm missing something, let me know.
Title: Re: Glass
Post by: domdib on May 21, 2010, 06:07:52 PM
That looks good. Does it render quicker than a water shader? You're right that caustics would be nice, but let's not forget that Terragen is first and foremost a Terrain renderer. The fact it can do all this other stuff is just gravy.
Title: Re: Glass
Post by: dandelO on May 21, 2010, 07:09:37 PM
I read Matt or Oshyan saying here before that Terragen will render real caustics if you use high enough GI detail and sample quality. I don't think a baseline was posted, just something like that phrase in an older thread, maybe about a year ago.
So, apparently, it's possible.

EDIT*

Quote from: Oshyan
Very cool results. The water topic has been set "Sticky".

In theory the GI may be able to create caustics, but I don't think it's really practical. Best to wait for a proper caustics solution which would not rely solely on the "fuzzy" GI.

- Oshyan

Sorry, I should have said 'may'. Not 'will'.
Title: Re: Glass
Post by: MGebhart on May 21, 2010, 07:18:43 PM
Hi D,

The render took 59 min.

Detail .9
AA 8
GI 2, 2, 8

Reflection samples 16
Refraction 1.15
Reflection 1
Specular Roughness .02

This is faster than the water shader by far and looks better.

I'll try the high GI settings but, it would be easier to fake the caustics in post production.
Title: Re: Glass
Post by: MGebhart on May 22, 2010, 04:55:38 PM
Is it real or is it Memorex?

Low res render.
Title: Re: Glass
Post by: Klas on May 22, 2010, 05:04:56 PM
Quote from: MGebhart on May 21, 2010, 05:50:46 PM
Here is a Glass shader I made. I used a reflection shader and not a water shader.
Place something behind the "glass". Is it visible or is this only a reflective sphere?
Title: Re: Glass
Post by: TheBlackHole on May 22, 2010, 05:07:47 PM
@Klas
Hmmm, how about the floor? ;D
Title: Re: Glass
Post by: Klas on May 22, 2010, 05:23:53 PM
@TheBlackHole
Hmm... the floor is mirroring in the sphere? Like the sun? Or do I miss something?
Title: Re: Glass
Post by: gregsandor on May 22, 2010, 05:36:57 PM
Nice, but an hour to render that is far too long.  What we need is a way to do glass fast with decent quality.  By the way the index of refraction for most common glasses is something between about 1.5 and 1.6.
Title: Re: Glass
Post by: MGebhart on May 22, 2010, 05:49:02 PM
Hi,

I was just fooling around with a fake photoshop caustics post work. Took about 30 seconds.

I agree with an hour taking to long and the refraction value. I choose the 1.15 because it looked the best.

Yes, this is transparent and not just a reflective sphere. If I get a few minutes I'll throw something behind it and render.
Title: Re: Glass
Post by: jritchie777 on May 22, 2010, 08:03:58 PM
I think you are on to something.  Did two exact renders except for the surface shader on the lake.
I did one with the default water shader, then I replaced it with the reflective shader.  It shaved 2 minutes off the render time.

Render with water shader:  5 minutes 37 seconds
Render with reflective shader:  3 minutes 30 seconds

You be the judge, but I like the reflective shader, thanks for sharing your work with us.  This will also help with some of my renders that I use water shaders for other effects, now I will use the reflective shader instead!

JR
Title: Re: Glass
Post by: Seth on May 23, 2010, 06:20:10 AM
Quote from: MGebhart on May 22, 2010, 05:49:02 PM

Yes, this is transparent and not just a reflective sphere. If I get a few minutes I'll throw something behind it and render.

Waiting for this because in your exemple render, it really looks like it is only reflecting the ground, as Klas stated. Plus we don't see the darker part (base part) of the sphere, so I did think it wasn't transparent at all but only reflecting light fooling us into beleiving it is glass :) I really wait for next exemple with an object behind the sphere ! my second question is : how does this shader react with another sun orientation (I personnaly had some big surprise just changing the light) and on another kind of object ?
though it is really nice looking ^^

Quote from: jritchie777 on May 22, 2010, 08:03:58 PM

You be the judge, but I like the reflective shader, thanks for sharing your work with us.  This will also help with some of my renders that I use water shaders for other effects, now I will use the reflective shader instead!


no transparancy on your reflective shader. it doesn't match the water shader on your exemple render. ;)
Title: Re: Glass
Post by: dandelO on May 23, 2010, 07:54:41 AM
I think that Seth and Klas are right, I've tried exhaustively to create transparency with a reflective shader, no cigar.

I remember Walli posting an example here before with transparency from a reflective shader, I tried matching his settings on my own, still nothing. I put it down to Walli using a different unreleased version of Terragen that the general public did not have. After the new release, though, I tried again and had the same negative results.

I can easily create a fake reflective transparency effect, like this appears to be. I will try this in an imported model instead of a native TG sphere to remove 'double sided surface' manually but, since a TG sphere is single sided anyway, I'm not sure it'll make much difference.

I'm probably missing something really simple, if you have indeed made transparency here, Marc. ???
Title: Re: Glass
Post by: dandelO on May 23, 2010, 08:10:34 AM
Also.

Reflection samples will have no effect on the surface, until you start adding 'reflection softness'. You could use a sample of '0' for the same result as your '16'.
Unless you enable softness, samples don't matter.

EDIT:

Tried your settings, with the exception of softness = 0.1 and samples = 32. Also, a refraction index of 1.15 returns a black surface reflection. Here, IOR is 8.
There are 3 spheres here, one is behind the centre sphere, it isn't visible.
0.5 render detail - 4 minutes. What are we missing?

[attachimg=#]
Title: Re: Glass
Post by: dandelO on May 23, 2010, 08:43:24 AM
And here's Walli's post from before... http://forums.planetside.co.uk/index.php?topic=8031.msg85835#msg85835

I still cannot match this on my own with a reflective shader. A water shader, no problem.
Confused. ???
Title: Re: Glass
Post by: Klas on May 23, 2010, 09:35:29 AM
Walli is using the transparency setting on the reflective shader. This is definitively not working. Maybe there was a beta with transparency?
Title: Re: Glass
Post by: TheBlackHole on May 23, 2010, 10:12:01 AM
I tried that too, to make a ring of red crystals floating around the planet. FAIL.
Title: Re: Glass
Post by: dandelO on May 23, 2010, 10:34:47 AM
I've tried this every way I can think of. Nothing works, although, I can clearly see Walli's using reflective shader settings.

... ... ...

EDIT: Moved this portion to its own thread. http://forums.planetside.co.uk/index.php?topic=9943.0
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 10:49:57 AM
D.

You are welcome to continue your findings here if you want. I'm not that sensitive.

I am rendering my glass shader with an object directly behind it. It is transparent. Also, I will provide the clip so everyone can experiment with it. I should be posting it within the hour.
Title: Re: Glass
Post by: dandelO on May 23, 2010, 10:53:13 AM
Thanks, Marc. I really feel I'm banging my head on a wall, I cannot make this work with a reflective shader, I've tried multiple times in the past and put it down to 'It can't be done'.

I await... :)
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 11:40:48 AM
Here is an image and the clip file for the reflection shader.
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 12:35:24 PM
I think I found a BUG.

I have a file called TextureSphere.tgd. There are two objects in the scene. Image1.

When I open the file from the file/open menu it loads. When I render it it looks like image2.

When I open the file from the file/Open Recent it renders like image3.

This is strange.
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 12:39:17 PM
Here is the TextureSphere.tgd
Title: Re: Glass
Post by: dandelO on May 23, 2010, 12:43:06 PM
Marc. With nothing changed in your clipfile at all, here's my result:

[attachimg=#]

Here's my node network, there's an imported sphere there that I tried, as well(single sided surface). Nada.

[attachimg=#]

Are you doing anything special to your objects inside of TG? Any specific render settings, like shadows, raytracing, lighting, anything?

I'm in a real brain-fix over this, some people, it seems, can render transparent reflective shaders, some can't. I'd like to know the key to this. I've tried everything that I can think of, from object settings, to render settings.

EDIT: Could you provide a basic working .tgd that displays this effect correctly, as it obviously does on your machine?
Thanks, just saw your other posts. I'm looking...

Cheers and, sorry for pestering but I have my brain in a knot here. :-[
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 12:52:06 PM
Here is the .obj file
Title: Re: Glass
Post by: dandelO on May 23, 2010, 12:54:04 PM
Nope, I don't have the models(Thanks. I do now. :)) or the ground image map. The parts shaders from your objects don't fit into another TG sphere(or sphere object) that I replace or reload in the original object reader. This is a shitemare! :D

Cheers, man! :D
Title: Re: Glass
Post by: dandelO on May 23, 2010, 12:58:39 PM
I give up...
[attachimg=#]
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 12:59:08 PM
Here is the ground map.
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 01:03:52 PM
Save the .tgd file to your desktop. Then load it again from the File/Open Recent.

I created a scene from scratch using the TextureSphere.obj and attached the Reflective shader. Then saved the file to my desktop. When I render it the object is Black.

Then I open the saved .tgd from the desktop using File\Open Recent and it renders transparent.

I'm not getting it.

Title: Re: Glass
Post by: dandelO on May 23, 2010, 01:05:47 PM
Can you copy the working object or parts shader from the working .tgd from 'recent files' and replace it inside the broken .tgd?

I really give up now, let's wait on PS staff to confirm whether this should work, on any level or settings.

Cheers, dude! :)
Title: Re: Glass
Post by: dandelO on May 23, 2010, 01:10:06 PM
There aren't any differences in spelling or file locations between the working and not working .tgd's?(I don't think you're an idiot, far from it, just looking for all possible causes of this discrepancy, there may be another .tgd elswhere on your computer with a water shader inside, would be my first guess).
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 01:24:57 PM
Martin,

Here is a newly constructed scene.

I took two loads from the file\Open Recent to work but, it did work.

I wonder if I'm still sleeping and this is all a dream.
Title: Re: Glass
Post by: Seth on May 23, 2010, 02:50:03 PM
doesn't work.
same result than dandelO.
I hope you'll find the good tgd.
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 03:35:07 PM
I can continue getting it to work but, there seems to be no consistent pattern.  Random.
Title: Re: Glass
Post by: dandelO on May 23, 2010, 04:54:56 PM
Confirmed, Marc. This is definitely a bug, of some sort. Look what I got...

[attachimg=#]

I loaded the .tgd, assigned the model path, cropped to the area and then clicked save and exit.
I restarted Terragen completely, loaded the project from 'open recent', black result.
Then, by simply going to 'file' >> 'Revert to saved' >> Render tab >> Render, I got the blacked out result twice. The third reload of the project in this same way gave me the resulting render posted above.

What the hell? Is this the way the reflective shader is supposed to render its transparency or is the blacked out version correct and this is the bug? It's very strange that it works differently on separate loads of the same project.

Another interesting thing: The model, in Marc's default file, is still checked as 'double sided surface', yet it rendered transparent but without any back faces of the model showing through the transparency. ???
Normally, to get working transparency in an object, you must uncheck 'dss'.

Well, at least one thing's confirmed, I'm not going bat-sh*t-crazy! :D

Any ideas, Planetside?
Title: Re: Glass
Post by: Seth on May 23, 2010, 05:50:01 PM
can't get it to work here. tried your way 7 times, dandelO, and i always get black result. :(
Title: Re: Glass
Post by: dandelO on May 23, 2010, 05:52:23 PM
I never got it to work again, Franck. Seems it was a one-off. ??? I've tried it several times over and never got the transparency to come back.
I couldn't believe it when it actually worked, though! Some kind of glitch is happening.
Title: Re: Glass
Post by: Seth on May 23, 2010, 06:02:30 PM
but by checking the reflective shader inside the glass ball, i don't know how it would work because there is nothing more than the transparency at 1 as Marc said, and we all tried it before without result ^^
so it must be a bug... maybe it can be a "useful" one though because the sphere is really good looking on Marc's renders :)
Title: Re: Glass
Post by: dandelO on May 23, 2010, 06:09:19 PM
Quote from: Seth on May 23, 2010, 06:02:30 PM
... the sphere is really good looking on Marc's renders :)

Indeed! I do wonder what's happened to the back faces, though...

And, compared to the way the water shader apparently has been changed, better looking even than that, too. The water shader used to render transparency this well.

http://forums.planetside.co.uk/index.php?topic=9943.0
Title: Re: Glass
Post by: MGebhart on May 23, 2010, 10:33:41 PM
FREAKY!

Glad to see you got it working at least one time.

Here is another that worked for me.

TECHSUPPORT!
Title: Re: Glass
Post by: jritchie777 on May 24, 2010, 05:17:56 AM
Well, it is possible...
Title: Re: Glass
Post by: Seth on May 24, 2010, 05:34:51 AM
Quote from: jritchie777 on May 24, 2010, 05:17:56 AM
Well, it is possible...
errrr... it doesn't look like transparency to me :)


indeed Marc, waiting for tech support ^^
Title: Re: Glass
Post by: jaf on May 24, 2010, 03:24:07 PM
I get the apparent transparency when I load recent, and it's black using file|load too.

I put this model mostly inside the sphere and it seems to show transparency, but I'm not sure about the reflections of the wheels in the base of the sphere.

I was thinking it might be a threading problem, but using 1/1, 1/16, 2/2, didn't seem to matter.
(http://[attach=#%5D)

Title: Re: Glass
Post by: MGebhart on May 24, 2010, 04:04:05 PM
Good to see someone else is able to reproduce the bug. Thanks Jaf.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 01:40:43 PM
Quote from: Seth on May 23, 2010, 06:02:30 PM
but by checking the reflective shader inside the glass ball, i don't know how it would work because there is nothing more than the transparency at 1 as Marc said, and we all tried it before without result ^^
so it must be a bug... maybe it can be a "useful" one though because the sphere is really good looking on Marc's renders :)

If so, then it might be related to the fact that we still can't use grayscale transparency/opacity in object shaders? It is a feature which still has to be implemented if I recall correctly.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 02:04:02 PM
Ok, I'm pretty sure now why the black triangles appear and it has nothing to do with the watershader itself, but with the way the renderer deals with reflections and shadows from off camera geometry.

Load the .tgc I attached and use the camera from the .tgc.
The POV should now show a glass sphere and a opaque sphere behind it.

Render it and you'll see it is transparent.

Now go to the "advanced" tab of the renderer and set the ray detail region setting to "no detail". Render it again and....yes, there it is, the reason.

There seems to be a lack of subdivision of off camera geometry to make it work properly, especially when there's sky being reflected. Since the sky is very very far outside from the frustum it isn't subdivided enough.
My conclusion is that it is a bug, not of the water shader, but the way the reflection/transparency is being calculated.

Remember that the ray detail region settings were probably introduced after making these glass balls was possible. But Martin (Dandel0) probably knows this best.

Cheers,
Martin
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 02:36:40 PM
Now go to the "extras" tab of the renderer and set the ray detail region setting to "no detail".

This is under the Advanced Tab.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 03:04:07 PM
Quote from: MGebhart on May 25, 2010, 02:36:40 PM
Now go to the "extras" tab of the renderer and set the ray detail region setting to "no detail".

This is under the Advanced Tab.

Thanks, adjusted that.
I hoped you had a chance to check it out though.
Title: Re: Glass
Post by: dandelO on May 25, 2010, 03:39:30 PM
You know me, Martin, I tried this, too. ???
I went through every setting I could imagine. Every tab to do with objects, renderers, atmospheres, everything.
I've Just tried this 'no detail' option again to confirm it in my own testing.tgd, guess what? No positive result again. I still have the problem.

I'd already tried all the ray detail region options settings, from no padding, to full padding in every region selection.

Tried object displacement tolerance settings - sphere, planet, background(because they are also reasonably new additions), obviously there is no displacements applied in default objects but, hey, the setting is still new, so... Still no success.

Other renderer options - AA blooming, MV/detail Jittering, max/min threads, AAARRRGGGHHH!!! >:(

I've been pretty meticulous in every tab. I'm getting pretty wound up with it now, ha!

I'm attaching my own water trans1.tgd, I'd be grateful if you could have a look. If you've managed to solve it in your own .tgd(that I'll download after posting this to check it, too), then maybe you can see where I'm going wrong in mine...

[attachimg=#]

I'm off to open your .tgd, I'll report back in a bit...
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 03:58:14 PM
Martin and Martin,

Here is a render using dandelO's .tgd

I used an imported sphere from 3DS MAX.

I have always found the native sphere object in Terragen to be kinda quirky.
Title: Re: Glass
Post by: TheBlackHole on May 25, 2010, 04:00:44 PM
I don't think that looks quite right. There is a black area where the sky is supposed to be refracted. Unless you live on the moon or it's dark out, the sky is not black.
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 04:10:30 PM
@TheBlackHole,

You are correct sir.

Here is a quick render with another sphere behind.

It looks to me that dandelO is getting close. I never use the water shader except for water so, I'm not familiar with the settings and how they act. Seems to me that playing with refraction might correct the oddness. 
Title: Re: Glass
Post by: dandelO on May 25, 2010, 04:54:12 PM
So, Martin. Have you any ideas on a solution? Is there any padding level that can be applied to create the background node's atmosphere detail that's so far away from the camera? I've tried padding to as far as the distance of the BG node diameter! This gives me the same result as 'no detail'. :D

here's my default, 'crop region' version:
[attachimg=#]

And, 'detail in camera' Padding = '1':
[attachimg=#]

And, here's the 'no detail' one:
[attachimg=#]

All are bad but, 'no detail' is atrocious. Are these the same as your results?

An interesting thing is, when you uncheck 'visible to other rays' in the sphere object, the transparency renders beautifully over the whole object, except that it obviously cannot accept atmosphere rays, so any sky/atmo' portions are completely black.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 04:55:58 PM
Martin et al.,

I guess you're missing my point here.

You can try whatever you want. It simply won't work because of the reason I just described. If you set the ray detail region to "no detail" there's no subdivision done and the black triangle effect you describe is then at it worst. If you enable it to "crop region" or "in camera" you will have some correct reflection but not enough because the amount of necessary subdivisions outside the camera frustum is not calculated. You would need a crazy value to get enough subdivision. I doubt if you could make this work anyway since expanding the frustum probably doesn't take geometry from behind the camera at all. If you see what I mean.

Or I'm missing the point you're trying to make. The reason you can't make glass without those artefacts is, I believe, to the reason I just explained above and in my other post before.
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 04:56:43 PM
OK. I have been messing around with Tangled-Universe's tgc file and came up with this.

You can see the back Sphere through the Sphere with the water shader attached and it's upside down. I think this is correct in real life. Also, you see the reflection of the foreground Sphere

Is this getting closer?

Or not. :)

Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 04:58:27 PM
Quote from: dandelO on May 25, 2010, 04:54:12 PM
So, Martin. Have you any ideas on a solution? Is there any padding level that can be applied to create the background node's atmosphere detail that's so far away from the camera? I've tried padding to as far as the distance of the BG node diameter! This gives me the same result as 'no detail'. :D

here's my default, 'crop region' version:
[attachimg=#]

And, 'detail in camera' Padding = '1':
[attachimg=#]

And, here's the 'no detail' one:
[attachimg=#]

All are bad but, 'no detail' is atrocious. Are these the same as your results?

An interesting thing is, when you uncheck 'visible to other rays' in the sphere object, the transparency renders beautifully over the whole object, except that it obviously cannot accept atmosphere rays, so any sky/atmo' portions are completely black.

The 'no detail' is atrocious and proves exactly my point. At least, for me :)
It has to do with reflections from outside the frustum (the sky) which aren't subdivided enough. "no detail" for ray detail padding means that there is no subdivision at all (never use this by the way!) and therefore gives the atrocious result.

Enabling it, either region or in camera, gives some subdivision and thus some improvement. Like I just said. You will need insane values to get it work, if possible at all.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 05:01:08 PM
So, in my conclusion:

1) there's no (simple) solution
2) if I'm right then option 3
3) it's a bug

:D lol
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 05:18:48 PM
Martin, (dandelO)

Is this what you are looking for.
Title: Re: Glass
Post by: dandelO on May 25, 2010, 05:32:29 PM
Marc: This is getting ridiculous! :D I don't even get that result when I import a sphere object into that .tgd.
The only way I can get it to look like you have there is to un-check 'vtor' in the object. And it doesn't matter whether it's an object import or a default sphere in that case. Both objects will render great but with a blacked out sky section.

Did you uncheck this option in your imported model?


Forget that. ^^ :D There's too much confusion here for me. I'm off to hang around some seedy chatrooms for a few days!

I joke.

Title: Re: Glass
Post by: MGebhart on May 25, 2010, 05:37:53 PM
Crazy.

I'm using Martin's .tgc with your .tgd.

Give me a sec and I'll give you the tweaked water shader.
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 05:39:31 PM
Disabling vtor disables calculation of other rays (than the camera's rays I presume) and fits with the subdivision principle I described.
The lack of subdivisions causes a lack of rays to be calculated correctly and gives black patches/triangles.
Disabling vtor disables the calculation of rays at all and therefore results in an entire black reflection.
Disabling detail padding (no detail settings) still calculates the rays, but performs no subdivision and therefore gives the lowest level quality possible then.

However...still wondering how Marc does this...I must be wrong then, but I can't see why yet :(
Title: Re: Glass
Post by: dandelO on May 25, 2010, 05:42:07 PM
Martin, yes, I understand how those ray detail settings work.

QuoteYou will need insane values to get it work, if possible at all.

What I tried to say in that first reply to your post was, that I padded the detail in camera to a really insane amount(the same as the radius of the BG node = 2e+008). And this gave me the same result as the 'no detail' setting.

I think it's impossible, too.

EDIT: Or do I? Marc, wtf are you doing here? :D
It seems that there is no inversion of the sky over ground though so, it isn't refracting correctly, at least in the picture with the 3 spheres. The newspaper one however, that is possible in any case because you are not seeing any sky rays in that transparency. You're looking directly down on it. Try getting to an equal level of this, so some sky is visible. If it holds up... then, BRAVO!

...
Title: Re: Glass
Post by: Tangled-Universe on May 25, 2010, 05:50:57 PM
Wish the newspaper was TG2, caustic effect :)
Anyhow, Martin, I didn't miss your point about setting an insane value for region padding. Like I predicted it doesn't work because it works on a kind of "planar level".
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 06:02:09 PM
Ok....here we go. First I'm not clear if I'm heading in the direction you want or getting close to the results you are looking for. That said...

If you notice I cranked up the Decay Distance to a ridicules 5000. The Index of refraction is set to 10. YIKES! The Master reflection is .8. I also am playing around with the Volumn 1 density and color. In this render they are set to 1. (I think this has possibilities)

I thought about how Martin (dandelO) created translucency on my Ant model by cranking up the value to a whopping 250 so, I played with greater values as well to see what would happen.

Anyway, I hope we are getting close.

Remember: I used the water trans 1.tgd and the glass.tgc with my spheres.

NOTE: I think the Decay Distance will change dramatically depending on the object size. Just a guess.
Title: Re: Glass
Post by: MGebhart on May 25, 2010, 06:08:53 PM
Down view.
Title: Re: Glass
Post by: cyphyr on May 25, 2010, 06:19:28 PM
Quote from: Tangled-UniverseThe 'no detail' is atrocious and proves exactly my point. At least, for me Smiley
It has to do with reflections from outside the frustum (the sky) which aren't subdivided enough. "no detail" for ray detail padding means that there is no subdivision at all (never use this by the way!) and therefore gives the atrocious result.
This may be exactly the same reason I'm getting "shadow popping" from sunset scenes when the sun is low and behind the camera. Its not possible for the camera frustum to to extend beyond 180 deg beyond the cameras FOV.
:)
Richard
Title: Re: Glass
Post by: dandelO on May 25, 2010, 06:41:54 PM
I see. It seems you're just over-riding any interior artefacts with surface reflection. Kind of just like a shiny ball that's a little see-through. It may be a possible workaround with some effort in the meantime. Though, it doesn't appear to be inverting the 'world' inside the glass, you know?



Title: Re: Glass
Post by: MGebhart on May 25, 2010, 09:37:40 PM
I'm going to bed.......

This is the last one.

It is transparent, reflective and turns the world upside down.

Included the clip file.

NOTE: I will never get this day back. :(

Title: Re: Glass
Post by: Seth on May 26, 2010, 02:12:33 AM
damn, i get off the forums for a few hours and you wrote 2 more pages about it !!! ^^
need to be tonite to play with you guys ;)
Title: Re: Glass
Post by: dandelO on May 26, 2010, 03:53:08 AM
Hee-hee! Marc, you're persistent, eh? I gave up and went to bed long before you. :D
That looks very good, I'll have a look when I'm in from work later... :)
Title: Re: Glass
Post by: Tangled-Universe on May 26, 2010, 04:15:38 AM
Quote from: dandelO on May 26, 2010, 03:53:08 AM
Hee-hee! Marc, you're persistent, eh? I gave up and went to bed long before you. :D
That looks very good, I'll have a look when I'm in from work later... :)

Looks very good. Same here, will check it once back home.

Sorry that you've "lost" a day ;)
Title: Re: Glass
Post by: Dune on May 26, 2010, 09:28:03 AM
I've just been playing with this as well, with some knowledge in my distant memory about using reflective+water shaders, and some weird settings. Someone did this before, I vaguely recall.

I found that what happened when doing this another way, was that the surroundings are projected on the inside of the ball. So it looks like transparency, but isn't.

And while I'm at it, got some strange result with the refraction index set at 0; the whole scene turned black. Strange, huh?
Title: Re: Glass
Post by: dandelO on May 26, 2010, 10:23:47 AM
Dune, that's great.
One, well, two questions about the working version; Is the sphere object the same settings in the first shot as is shown in the second screenshot(double sided/no shadows)? And, Have you disabled reflections/refraction on the water shader, too? Since you're adding reflection and refraction via the reflective shader afterwards.

I can't quite comprehend how this is working so well, although it clearly(;)) is working.
To my mind, there should be no initial transparency from the water shader because the object is rendered as double sided and, why are there no atmosphere artefacts rendered in this way? I'll try this soon, too, thanks for chipping-in. Things always seem get worked out in the end in here, one way or another. Great! :)
Title: Re: Glass
Post by: Dune on May 26, 2010, 10:46:10 AM
I'll get back about this, have to check. But I don't think there's difference between 2-sided and 1-sided. Shadows enabled, I think. Reflection in the water shader is 0, I think. I think a lot  ;) I'll check, that's better than thinking...
Title: Re: Glass
Post by: Dune on May 26, 2010, 01:37:37 PM
Checked. Two-sided is okay, shadows are okay, reflections are off in the water shader. But you'll have to use your own balls, so to speak. The indigenous sphere doesn't work.

Some more examples. I even caught a cloud in a sphere, but didn't render out.
Title: Re: Glass
Post by: MGebhart on May 26, 2010, 01:45:17 PM
Looking great, Dune.

Title: Re: Glass
Post by: Tangled-Universe on May 26, 2010, 01:46:53 PM
Quote from: MGebhart on May 26, 2010, 01:45:17 PM
Looking great, Dune.

Yes indeed, except for the lack of refraction?
Title: Re: Glass
Post by: Tangled-Universe on May 26, 2010, 01:48:39 PM
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.
Title: Re: Glass
Post by: Dune on May 27, 2010, 03:17:29 AM
What do you mean by refraction?
Title: Re: Glass
Post by: Tangled-Universe on May 27, 2010, 03:49:16 AM
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".
Title: Re: Glass
Post by: Oshyan on May 27, 2010, 04:23:08 AM
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
Title: Re: Glass
Post by: airflamesred on May 27, 2010, 06:16:17 AM
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.
Title: Re: Glass
Post by: 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
Title: Re: Glass
Post by: Tangled-Universe on May 27, 2010, 09:08:15 AM
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).
Title: Re: Glass
Post by: dandelO on May 27, 2010, 10:04:22 AM
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.
Title: Re: Glass
Post by: dandelO on May 27, 2010, 10:08:51 AM
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.
Title: Re: Glass
Post by: TheBlackHole on May 28, 2010, 09:53:16 AM
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
Title: Re: Glass
Post by: Tangled-Universe on May 28, 2010, 11:25:33 AM
Meta-materials, which have a negative refraction index, bend light "around" itself.
http://en.wikipedia.org/wiki/Meta-material (http://en.wikipedia.org/wiki/Meta-material)
So my guess for obtaining this effect is trying something with such a refraction index.
Title: Re: Glass
Post by: dandelO on May 28, 2010, 12:39:40 PM
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.
Title: Re: Glass
Post by: dandelO on May 28, 2010, 12:49:32 PM
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.
Title: Re: Glass
Post by: dandelO on May 28, 2010, 01:04:30 PM
IOR/-1.33, Reflectivity/0.01, highlight intensity/0.01.

[attachimg=#]
Title: Re: Glass
Post by: Kadri on May 28, 2010, 02:22:19 PM

Interesting topic and results. Thanks guys :)
Title: Re: Glass
Post by: Oshyan on May 29, 2010, 12:52:11 AM
Quote from: dandelO on May 27, 2010, 10:08:51 AM
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.

I don't doubt it. But I don't know if Matt will be able to find any possible errors without some specific, reproducible example files (TGD) and/or specific versions numbers where something is verified to work differently (and preferably) to now. If you can, for example, determine that the original 2.0 release worked as hoped, then we can test against that and determine the differences. We'd really appreciate some help in tracking this down.

- Oshyan
Title: Re: Glass
Post by: MGebhart on May 29, 2010, 04:54:47 PM
Last time, again.  :P
Title: Re: Glass
Post by: zionner on May 29, 2010, 05:33:51 PM
Hey guys! =)

I was keeping an eye on this thread, and I saw the results that Dandel had, and it made me think of a portal-like effect (I know thats not what you were going for) but I decided to see what I could get from that, and this was my first result (Sorry, I hope I'm not Hi-jacking your thread =) and also, I know I forgot to take off a few settings, like casting shadows =( ):
(http://img245.imageshack.us/img245/2719/test1l.png)
Title: Re: Glass
Post by: MGebhart on May 29, 2010, 05:50:12 PM
That's kinda cool.

Don't worry about  Hi-jacking. As long as you are in the ball park it's fine.
Title: Re: Glass
Post by: dandelO on May 29, 2010, 05:57:33 PM
What a thread this has turned out to be, eh? :D
Since Marc posted a simple glass shader a few days ago we've; played with our balls, mixed them with other user's, discovered some bugs(crabs, perhaps?), found multiple different glass techniques, cast a few shadows, removed our in-sides, inverted our indices and now we've opened a portal! Bravo! 5+. ;)

It's difficult for the eyes to decipher, looking at these inverted indices, don't you think? Very strange.
The highlights are especially difficult to control here, see the squared AA blooming?
Cool 'portal', though!

Did I mention I found another grey hair in my beard? It was reflecting a strange light in the mirror! :D

Oh and, yes: Marc, you have been well-and-truly 'JACKED, man! Sorry! ;)

EDIT: HAHAAA! HE SAID BALL PARK! HAHAAA! :D ;) :D
Title: Re: Glass
Post by: MGebhart on May 29, 2010, 06:00:35 PM
Quote from: dandelO on May 29, 2010, 05:57:33 PM

Oh and, yes: Marc, you have been well-and-truly 'JACKED, man! Sorry! ;)

EDIT: HAHAAA! HE SAID BALL PARK! HAHAAA! :D ;) :D

LOL. If this is the worst that happens I'm ok with it.
Title: Re: Glass
Post by: dandelO on May 29, 2010, 06:21:38 PM
It's bloody lucky we don't also have TG2 internal cylinder objects to play with, as well, eh?

Then we'd be in real trouble!  :-X :-[ ::) ;)

EDIT: I think I need to quit with these smileys now, I look like a little girl! :-* :-* :-*

...
...
...  

:-\

EDIT 2: may b I shud strt postn all meh thredz lk dis??? LOLZOLOLOL!!! wot do u fink? theyrz no pnt tryn to dny it N E longR! :-* LOLZASFK!!!!!!!!! 

Title: Re: Glass
Post by: MGebhart on May 29, 2010, 06:32:19 PM
Here is my last, Ha, clip.
Title: Re: Glass
Post by: jritchie777 on May 29, 2010, 09:18:17 PM
My mind has been on it several times to recreate the stargate event horizon.  Bravo, looking good!
Title: Re: Glass
Post by: Goms on May 30, 2010, 03:30:37 AM
hmm.... i think this gets out of hand. brilliant thread to follow. :)
just one question: are there really this often glass-spheres with a 1m diameter flying around that often? :P :P :P
Title: Re: Glass
Post by: Vyacheslav on January 31, 2011, 03:01:43 PM
Apologize for bad English.
Can Not live without using glass material.
Take the primitive sphere (not big) join; .tgc consisting of 10-12 alike  Reflective shader by turns join; to ball.Get at the average 11 black and 1 from glass.Under the repeated import .tgc , the result 9 black and 3 from glass.
Possible superimpose the textures on glass and additional shaders,but remember to take away the small flag with object Visible to other rays and at imposition of the textures to choose the colour a tone different from white.
Speed Reflective shader much above ,чем Water shader.

Title: Re: Glass
Post by: Vyacheslav on January 31, 2011, 03:51:01 PM
Alpha channel assessed on glass shader Sphere.
Title: Re: Glass
Post by: bobbystahr on February 15, 2011, 10:18:23 AM
Quote from: Vyacheslav on January 31, 2011, 03:51:01 PM
Alpha channel assessed on glass shader Sphere.
Vyacheslav....could you maybe post the .tgc files for these experiments as your English, although a good attempt for someone not native to it, leaves me confused, but your results give me hope and inspiration.. ...
Title: Re: Glass
Post by: airflamesred on February 15, 2011, 05:29:50 PM
 I was under the impresion Vyacheslav was refering to opacity.
Marc's tgc works great
Title: Re: Glass
Post by: AndyWelder on March 05, 2011, 06:41:09 PM
Some of you may have noticed I'm recently exploring "glass". Not glass spheres but glass planes. I attach a water shader to the surface of a plane, up "Transparency" and "Decay distance" to the max and set all the wave settings to zero. The result is something that looks and works as a glass pane would.http://forums.planetside.co.uk/index.php?topic=11822.0 (http://forums.planetside.co.uk/index.php?topic=11822.0)
Today, while working on a new render I flipped some of the planes by accident and I noticed something odd: Instead of acting like a glass pane (being transparent, with the background shining through and some reflections), the planes acted as mirrors.... the planes went invisible though they do cast shadows. And though invisible in the image, during the render pass there was a slight indication of the planes but this disappeared in the finished render.
I did change the values for the coordinates of the edge vectors: Edge vector a was 1/0/0 and became 0/1/0, edge vector b was  0/1/0 and became 1/0/0.
Could it be that, because planes (and spheres surfaces also) are infinite thin, TG is having difficulties putting the attached surface shaders on the "right" side of the surfaces? Maybe I'm talking utter BS now but when it comes down to the technical details I'm an absolute layman.
I'll do some more testing tomorrow.

Another thought: Testing glass material on a sphere makes things complicated because after all a sphere will make light bounce internally, a plane does not have this behaviour but will act as a infinite thin glass pane.

Here are the results: The image names reflect the vector positions of the planes.
Title: Re: Glass
Post by: AndyWelder on March 06, 2011, 05:30:04 AM
And another test, for completeness sake, shows the visibility depends on the POV: If the camera moves to the other side of the visible plane the plane becomes invisible. Hmmm...
Title: Re: Glass
Post by: jo on March 06, 2011, 07:30:12 AM
Hi Andy,

Quote from: AndyWelder on March 06, 2011, 05:30:04 AM
And another test, for completeness sake, shows the visibility depends on the POV: If the camera moves to the other side of the visible plane the plane becomes invisible. Hmmm...

Planes are only visible from the front.

Regards,

Jo
Title: Re: Glass
Post by: AndyWelder on March 06, 2011, 07:50:08 AM
QuotePlanes are only visible from the front
:-[ Didn't know that. Why didn't I know this...? :'( So that's why flipping the vector coordinates made the plane invisible: Instead of looking at the front the camera was looking at the back! Bloody infinite thinness!
Sorry for waisting your time.
Title: Re: Glass
Post by: Kadri on March 06, 2011, 10:00:37 AM
Quote from: AndyWelder on March 06, 2011, 07:50:08 AM
QuotePlanes are only visible from the front
:-[ Didn't know that. ...

Many 3D renderers act in this way. There are options to make planes  one or two-double sided mostly.
It is not a TG2 thing only AndyWelder .
Title: Re: Glass
Post by: Vyacheslav on March 08, 2011, 05:50:56 PM
Pledged video ,on creation glass from Reflective shader.Glass.avi  (2 mb) -  2 minutes and glass ready.

http://depositfiles.com/ru/files/kb17ocmhg  (glass.avi)
Title: Re: Glass
Post by: dandelO on March 08, 2011, 06:14:17 PM
Sorry, porn is all I seem to have the rights to download from that link. :(
:o ;)
Night night, early bed time for me, I believe! :-X


* Rude! I apologize.

I finally got the download to work. It seems to be one of those wait-in-line affairs. Hopefully now I can get the reflective shader to work correctly...
Title: Re: Glass
Post by: bobbystahr on March 08, 2011, 06:35:20 PM
Quote from: Vyacheslav on March 08, 2011, 05:50:56 PM
Pledged video ,on creation glass from Reflective shader.Glass.avi  (2 mb) -  2 minutes and glass ready.

http://depositfiles.com/ru/files/kb17ocmhg  (glass.avi)

thank you Vyacheslav.. ...
Title: Re: Glass
Post by: dandelO on March 08, 2011, 06:50:34 PM
I watched the video and yes, it seems to be the same thing I was experiencing with the reflective shader. An arbitrary amount of reloads seems to make the transparency of a reflective shader work correctly. It's a shame that it has to be that way. Hopefully there will be some sort of fix for that at some point.