Water Shader Optimizations?

Started by dandelO, May 23, 2010, 10:37:19 AM

Previous topic - Next topic

dandelO

Has there, since the introduction of the water shader transparency tab, been optimizations made to the way transparency is rendered?

I ask because before, I would be able to create a sphere object, use my custom transparency shader(water shader) as its surface and could get a clear surface, e.g. this example by Marlin...
even at lower render detail, as in this example image, the sphere would be clear.

Now, though, when I apply my previously working transparency shader to a sphere, I get this result(0.5 render detail)...

[attachimg=#]

There are lots of black render errors all over the entire sphere. It looks terrible. I've tried upping render detail as far as '2', upped antialiasing(with no customized samples), upped GI levels, etc. Always these black dots on a sphere.
This does not happen on plane objects or other imported models(windows etc.) which are one sided.

_________________________________________________

I also recall this quote from a release discussion post(what a thread THAT was, eh? :D) by Matt:

Quote from: Matt on March 26, 2008, 10:06:45 AM
Quote from: Tangled-Universe on March 26, 2008, 09:53:06 AM
(I presume the blocky intersection of the water with the stone in the first image is due to the displacement of the stone itself?)
That stone is displaced quite heavily and the microtriangles are stretched quite badly even in a waterless render. That's made worse because the underwater surfaces in these last two renders are at lower detail than the main detail level, but there will be an option to control that. I don't really see a blocky intersection with the water, but the stone is pretty blocky and the variation in colour of the fake stones on top doesn't help either. (The part that I think you might be looking at is all underwater and what you're seeing is fake stones colour variation.)
Matt

The bold part is what I'm referring to, will we have this option added to the water shader at any point? I'd really like the option to be able to sacrifice render time for better sub-surface output quality.

dandelO

Here's an imported sphere object. It displays pretty much the same results:

[attachimg=#]

And here's the transparency shader, working correctly on a default TG plane object:

[attachimg=#]

Something has changed along the way, curved surfaces seem to not like the water shader now. ???

Seth

totally right but, testing this, i get on something that could be interesting for something else : someone was looking for an idea to reflect light and when i put crazy values on water shader (connected on a 100m sphere) : transparency 10000 decay distance 10000 decay tint 0.002, the light is reflected on the ground around the sphere.

dandelO

Ha! Transparency = 10,000! Pffft! There's your lightsource! :o

Interesting... Caustics of a sort. But since the light doesn't seem to be travelling through the water you might try adding another zero to the decay distance and maybe halving the transparency to see if the light from inside will cast across the ground beneath it once the ball is see-through. ??? Cool idea, such a high transparency number.

I wish I knew what's happened with the water shader these days since the original in the technology previews, though.
As far as I could see, there was no need to optimize transparency rendering(if that's indeed what has been done), it rendered fast enough for me with very clean results. The sphere was my first port of call to test it out. I thought it was fine, certainly not too slow to render considering what we all expected before there was transparency in TG2, I was pleasantly surprised to be able to make glass balls and such that looked really good...

I still do want that level of sub-surface detail option that Matt talked about.

MGebhart

I could never get the water shader to work at all for transparency. That's why I started playing with the reflective shader.
Marc Gebhart

jritchie777

I've had the same trouble.  Only way to get water shader to work for transparency is for my own objects.  The internal sphere object does not seem to play well - as dandelO already showed.  I quickly imported my own sphere object (crude) which will work even at low res, but still no where near what was shown earlier in this thread.

swissAdA

and if you uncheck the "Visible to other rays" in the Sphere ?
P.S. My text is always translated with Google  http://swissada.deviantart.com/

Seth

nothing more...

the water shader does need some improvement as the detail of the underwater landscape s really ugly ;)

Tangled-Universe

Quote from: Seth on May 24, 2010, 05:38:48 AM
nothing more...

the water shader does need some improvement as the detail of the underwater landscape s really ugly ;)

That's by design. There's a detail setting multiplier for the visible features under the water, and it's set to 0.5. That's why it looks ugly when using normal detail settings for rendering.
However, if you render the water section separately at twice the detail setting you will get as detailed underwater features as your original first render.

I believe some time ago a bug was fixed which caused incorrect rendering of shadows in shallow water, but I'm not sure if this would have to do anything with this at all.

Seth

that doesn't mean it is good ^^
being forced to render the water part separately is not very practical ^^
i agree it is far better than before (no transparency at all) but I hope that in the future there will be another kind of transparency that will permit a different kind of technique than a 0.5 detail ;)

Hetzen

Or having the ability to mask between two flavours of water, depending on where you want to show detail.

On an aside, but possibly related note. I've been experiencing some severe black tringles, or spikes, when using functions to displace surfaces, something I'd not had too much on previous builds. Is this another form of optimisation? It's been really frustrating to deal with.

Tangled-Universe

Quote from: Seth on May 24, 2010, 07:00:15 AM
that doesn't mean it is good ^^
being forced to render the water part separately is not very practical ^^
i agree it is far better than before (no transparency at all) but I hope that in the future there will be another kind of transparency that will permit a different kind of technique than a 0.5 detail ;)

Of course it's not good, I didn't mean to say that, but I meant to say that it isn't a bug for example.

In my experience the effect looks most worse when viewing the water from top down.
If you look at water with a 0 to -10 degree angle it looks much better.

Anyhow, as far as I know Matt is aware of this issue and the wish for a setting/option for this.

Seth

Oh yes, didn't mean to say it was a bug :)

dandelO

Quote from: Seth on May 24, 2010, 11:02:40 AM
Oh yes, didn't mean to say it was a bug :)

I do think that this a bug. The lower subsurface render detail isn't what I'm trying to draw attention to here.

Reading Matt's quote in the first post here, the lower subsurface render detail was in place before any of the general public got a hold of the transparent water shader. That's not the issue I'm bringing up in this thread. It worked pretty much the same as how you describe, in that respect.

It's these nasty, black artefacts. It's a far cry from the first time we seen the water shader, know? The first thing I done was to work out how to texture all sorts of things and relish the lovely transparency. I could apply it to a sphere - instant crystal ball, pop it into an object - beautiful block of glass.
I do agree, obviously, that the shadowing issues needed to be fixed so that it was actually rendering these incorrect shadows correctly, as well.

Now when you try these things, though, you get a black spotty object.

What's really interesting, though, is the other thread here(Marc's 'Glass' thread). When you see that transparency rendered, it doesn't appear to be of any lower render detail than the rest of the scene and, it really isn't render-time heavy at all. I'm very impressed with it.
The only real render issue I can spot with it(barring the 'doesn't work every time' factor ;)) is that; back faces of objects that it is applied to do not render, even when checked as 'double sided surface'. This was normal for the water shader, though.

I just wonder, what has happened to transparency render outputs in more recent builds than the TP's. ???

Tangled-Universe

Quote from: dandelO on May 24, 2010, 01:46:27 PM
I just wonder, what has happened to transparency render outputs in more recent builds than the TP's. ???

As far as I know, nothing :(