Glass

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

Previous topic - Next topic

Tangled-Universe

#45
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

MGebhart

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.
Marc Gebhart

Tangled-Universe

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.

dandelO

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...

MGebhart

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.
Marc Gebhart

TheBlackHole

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.
They just issued a tornado warning and said to stay away from windows. Does that mean I can't use my computer?

MGebhart

@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. 
Marc Gebhart

dandelO

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.

Tangled-Universe

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.

MGebhart

#54
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. :)

Marc Gebhart

Tangled-Universe

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.

Tangled-Universe

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

MGebhart

Martin, (dandelO)

Is this what you are looking for.
Marc Gebhart

dandelO

#58
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.


MGebhart

Crazy.

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

Give me a sec and I'll give you the tweaked water shader.
Marc Gebhart