Transparency question

Started by Mandrake, July 03, 2008, 08:45:34 AM

Previous topic - Next topic

Mandrake

I guess for Mat or Jo

I've pretty much exhausted combinations to using the water shader as a transparency, without much success. I run C4D and then wash it through Poseray to generate the mtl file.. I know that all the normals are pointing in the right direction. I always get the same result, and it still looks better then other materials but it's not transparent. If I make a very large bubble and put a tree in it with a bright light source behind it, I can get a transparency, to a point. I uncheck the double sided option.

This mini-wip's window, has a water shader hooked to the color function, in the internal N.W.N. Is this water shader still on the drawing board for improvement or is there something else I can do to improve it?

The new build is great by the way.. :)


cyphyr

I'm sure (hope so) that there is room for improvement in the water shader to make it more generally useful.
However a couple of things to remember about the water shader, firstly that the transparency has no end point or thickness. ie you can not have a piece of glass 5mm thick or a foot thick for example. The ray from the camera will be deflected each time it passes through a water/transparent polygon. This means that it will be deflected twice per polygon if you have double sided switched on. Your depth will need to be something huge, beyond the distance to the surrounding background sphere. anything less and the transparent surface will be opaque when viewed against the sky.
Think of it like this. If you hold a piece of glass up in front of you, perpendicular at eye level out doors you can see through it to both near foreground, a couple of meters away and the distance horizon and beyond, several thousand or hundreds of thousands of meters away. In Terragen this is not properly implemented at the moment. The transparency is intended only for shore lines and water edge effects where in almost every case the observer is above the water surface looking down to see a surface beneath the water. Therefore the light ray only gets refracted the once and then comes to a hard stop.
I understand how this works but its a little hard to communicate.
Remember to take all the wave variables to zero and set the transparency to something pretty high like 99%+ and the depth to something HUGE.
Hope this helps
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Mandrake

Yes, thanks!! That doesn't do squat.. I appreciate your explanation though. :)

Matt

#3
If you have a piece of geometry that has another face on the other side of the glass, to give it some finite thickness, it will behave more realistically. If there is no face on the other side then it assumes there is water/glass all the way until the ray hits something behind it.

More general transparency effects will be implemented in future, but probably not before the final 2.0 release.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Mandrake


Mr_Lamppost

Remember that thread with the windows from a few weeks ago?
http://forums.planetside.co.uk/index.php?topic=3977.0

In order to get transparent windows in your care to work you will need to model them as a separate object.  You will also need to model them with both the outside and inside surfaces, give your windows physical thickness.  Make sure that Double Sided Surface option IS NOT selected for the window object.  Apply the Water Shader to the window object ,remembering to reduce the wave parameters to zero.  If you wasn't to be able to see inside the car also turn off shadow casting for the windows. 

Remember what you see through the class will not be perfect because when the Water Shader is applied to an object it does not smooth the normals when calculating refraction. 
Smoke me a kipper I'll be back for breakfast.

Mandrake

ML, so you mean the window cant be one poly thick. I have to clone the window points and grow them in to make physical thicknes?

jo

Hi Mandrake,

Essentially, yes. A polygon doesn't have thickness, it's just an arbitrary plane in space bounded by its edges. Think of it as being infinitely thin :-).

Regards,

Jo

Mandrake

Man, been bangen my head bout this for a while.. Do both normals for the glass point out?
because usually in the case of a square say looking thru one normal faces you the otherside faces the other way.

Mr_Lamppost

Yes that's exactly it.  You have to model the glass completely so that it has actual physical thickness, all the normals need to point outwards.  Here's a quick example:

I had to render it using the first alpha (build 1.9.88.1)
When I tried it with the latest version, (build 1.9.98.1), the render would not complete, second image.

The .tgd and test obj are included. Remember to make sure that the Double Sided Surface option is NOT be selected. 
Smoke me a kipper I'll be back for breakfast.

Mandrake

Excellent!! Thanks ML, Mat and Jo!!

Mandrake

hmm guess I have to make the whole window, symmetry would have a problem.. unless I have a seam.. worry bout that later.

bobbystahr

#12
Quote from: Mandrake on July 07, 2008, 09:02:43 AM
hmm guess I have to make the whole window, symmetry would have a problem.. unless I have a seam.. worry bout that later.
Can you not just split the window out and extrude it a small amount? Almost any extrusion should accomplish the needed solid 3D object state as opposed to the 2D plane that it currently is. That's the route I'd take.. ....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Matt

Quote from: Mr_Lamppost on July 07, 2008, 08:39:53 AM
I had to render it using the first alpha (build 1.9.88.1)
When I tried it with the latest version, (build 1.9.98.1), the render would not complete, second image.

I've managed to get this to stop at exactly the same place in that top-right bucket after just a few minutes. I will find out what's causing it.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Mr_Lamppost

Quote from: Matt on July 07, 2008, 01:55:00 PM
I've managed to get this to stop at exactly the same place in that top-right bucket after just a few minutes. I will find out what's causing it.

Matt

I think the problem is in the reflection component, I was having similar problems last week when I used the reflective shader on an object.  I wasn't going to report it until I had done some more tests, I am making these now.  However I needed to mention it as the windscreen example is effected and that is simple enough as a test scene. 
Smoke me a kipper I'll be back for breakfast.