Planetside Software Forums

General => Terragen Discussion => Topic started by: JasonA on October 15, 2012, 09:35:56 AM

Title: Eliminating reflection flicker
Post by: JasonA on October 15, 2012, 09:35:56 AM
Hi all,

Im having a problem where I get a heavy amount of flickering in smooth water surfaces in my scene.  It does not appear to be a GI related issue as Ive cached the GI and everywhere there is no water, things are fine.  But on the water surface i get alot of reflection popping.  I have some trees and clouds which both show up in the reflection and their value changes from frame to frame, yet only in the reflection.  the primary rays appear to be fine as the trees and clouds and trees are not flickering there, only on the water surface.  Its bad enough that I cannot fix it in post.  Are there any good tips or tricks to avoid this from happening?
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 15, 2012, 11:05:04 AM
Water's reflections are ray traced reflections and I know that when you use a reflective shader with ray traced reflections also a lot of heavy flickering occurs.
So it may have to do with that.
If you set the water shader's reflectivity to 0 and connect a reflective shader in between the water shader and the lake object then the popping should disappear.
Make sure you have disabled ray traced reflections in the reflective shader.
This way you keep the shapes of your water and you can confirm whether it's ray traced reflections.

If it's indeed ray traced reflections then *may be* it might help to increase the ray detail multiplier.
You can find that in the "render subdiv settings" node inside the render node's internal network.
This increases the amount of rays being calculated and I think it may therefore increase accuracy of the reflections and thus reduce flickering.
It's a bit of a long shot though and it will definitely increase rendertime.

I'm curious what your other settings are though and whether you used the animation check button?

Cheers,
Martin
Title: Re: Eliminating reflection flicker
Post by: penboack on October 15, 2012, 08:03:55 PM
That's interesting, I've been experiencing the same issue working with a lake scene, but haven't had time to post.
As soon as I set the Water shader > Reflectivity to 0 and connected a Reflection shader between the Water shader and the Lake the white specks disappeared without altering the render subdiv settings > ray detail multiplier.

Previously to produce a final image I set Water shader > Highlight intensity to 0 (default 0.5) and then used the following render settings; AA = 6, Level of Detail = 1.0.

The final image showed http://penboack.deviantart.com/art/Terrasee-1-331666455 (http://penboack.deviantart.com/art/Terrasee-1-331666455) showed minimal artefacts, but they were present.

I've subsequently tried a number of render settings, such as increasing GI sampling, or increasing AA, but with no improvement.

Thanks TU for your suggestion.

In this image the Water shader is producing the reflections using its default settings, AA set to 6, Detail set to 0.8.
White artefacts on the water surface.
[attachimg=1]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, AA set to 6, Detail set to 0.8.
Reflective Shader, 4 samples (default number of samples)
White artefacts on the water surface greatly reduced.
[attachimg=2]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, AA set to 6, Detail set to 0.8.
Reflective Shader, 16 samples
White artefacts on the water surface greatly reduced.
Very slight improvement over the previous image.
[attachimg=3]
Title: Re: Eliminating reflection flicker
Post by: Dune on October 16, 2012, 03:52:45 AM
Interesting problem and good that you guys posted this. The images are very enlightening.
ps. Penboack; I would have added another species (or 2) of tree to your final image; the twist of the branches is very uniform in this object. Too bad, as it's a pleasant image.
Title: Re: Eliminating reflection flicker
Post by: penboack on October 16, 2012, 04:37:38 AM
Dune, thanks for looking.
That image is actually using 3 species in 3 variations with 3 separate sets of populations (to cut down the time the populators need to populate), so 27 populations in total.
I spent a lot of time trying to eliminate the branch twist repetition in the Larix decidua (European Larch) but to no avail. I don't have the Xfrog software (yet) so wasn't able to look at the model or create additional variations. It also has leaf colour variation implemented on one species and its variations, but unfortunately this wouldn't work on the Larix decidua http://www.planetside.co.uk/forums/index.php?topic=15094.0 (http://www.planetside.co.uk/forums/index.php?topic=15094.0).
I think that changing the proportions might break up the repetition, but too many other projects to work on...

Anyway I'm really pleased to be able understand how to create better water surfaces.
I do wonder though whether the default Water shader setup would benefit from some improvement, as it's not very obvious to new users how to fix this type of problem.
Title: Re: Eliminating reflection flicker
Post by: Dune on October 16, 2012, 08:19:39 AM
I know some XFrog objects have this uniform twist, and indeed, if you don't have the software, you can't change that. Breaking up with several species is then the best way.

The staff will read this, so if they see room for improvement, they'll act, I'm sure.
Title: Re: Eliminating reflection flicker
Post by: JasonA on October 16, 2012, 09:41:07 AM
Thanks guys, Im going to try this today and see if it eliminates the problem.  Ill report back what happens.
Title: Re: Eliminating reflection flicker
Post by: Oshyan on October 17, 2012, 04:27:25 AM
Here are some thoughts and possible solutions from Matt:

QuoteIf they are talking about reflections of normal parts of the scene, such as trees, they are going to flicker because only one ray is traced per water micropolygon. I imagine its probably comparable to ray tracing trees with AA 1, but perhaps not quite as bad because detail blending (if its on) will average things out a bit.

Possible solutions, all of which will increase render times substantially. Choose one of the following:

1) enable soft reflections (with a very small non-zero softness) and you can control the number of samples. Reflection Shader only.

2) Increase render detail above 1

3) use an imported object for your water. Then it will be ray traced, therefore shaded multiple times per pixel, according to the Pixel Sampler settings. This would be my preferred solution with v2.4 (we'll have better solutions available in future versions).

I don't know about the white specks, unless they are specular highlights from the sun.

- Oshyan
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 17, 2012, 04:45:46 AM
Quote
2) Increase render detail >1.

Given Matt's explanation about tracing one ray per micropolygon and his 2nd suggestion to increase detail >1, I think I'm correct by saying you need to increase the ray detail multiplier.
By default it is set to 0.25 and if you increase it to 1 then more rays should be traced per polygon and you should get better accuracy.

Be aware this also greatly affects GI. To save rendertime you may reduce GI relative detail, as this will also be sampled 4 times denser with the increased ray detail multiplier.
Title: Re: Eliminating reflection flicker
Post by: Oshyan on October 17, 2012, 04:47:24 AM
Yes Martin, that made sense to me as well, and if I understand correctly, it should increase render time less than increasing *overall* detail.

- Oshyan
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 17, 2012, 04:57:42 AM
Yes, definitely!
Title: Re: Eliminating reflection flicker
Post by: Matt on October 17, 2012, 08:44:29 PM
Quote from: Tangled-Universe on October 15, 2012, 11:05:04 AM
If it's indeed ray traced reflections then *may be* it might help to increase the ray detail multiplier.
You can find that in the "render subdiv settings" node inside the render node's internal network.
This increases the amount of rays being calculated and I think it may therefore increase accuracy of the reflections and thus reduce flickering.

It doesn't change the number of rays that are traced. It only changes the detail in the micropolygons that are seen by the rays. I don't think it will help here - the water is quite rough so you don't really see any loss of detail in the micropolygons being hit by the rays.

Matt
Title: Re: Eliminating reflection flicker
Post by: Matt on October 17, 2012, 08:47:05 PM
Quote from: Tangled-Universe on October 17, 2012, 04:45:46 AM
Given Matt's explanation about tracing one ray per micropolygon and his 2nd suggestion to increase detail >1, I think I'm correct by saying you need to increase the ray detail multiplier.
By default it is set to 0.25 and if you increase it to 1 then more rays should be traced per polygon and you should get better accuracy.

Be aware this also greatly affects GI. To save rendertime you may reduce GI relative detail, as this will also be sampled 4 times denser with the increased ray detail multiplier.

It won't change the number of rays or the number of GI samples taken, but it increases the detail of the geometry seen by the reflections and GI rays.

Matt
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 18, 2012, 04:24:13 AM
Thanks for pointing the mistake, twice ;)
I think this misconception has always been there, given Oshyan's confirmation. I guess it's subject for the ongoing documentation then.

So, now we know I was wrong, but it might be more helpful to know what it is instead of what it is not? ;)
Title: Re: Eliminating reflection flicker
Post by: Oshyan on October 18, 2012, 04:30:14 AM
Well, I said it made sense to me, I didn't say it was correct (as in I knew it was). ;)

I think "it increases the detail of the geometry seen by the reflections and GI rays" says it, doesn't it? It does not fire more rays (more samples), it just uses higher detail geometry for the samples it does take.

- Oshyan
Title: Re: Eliminating reflection flicker
Post by: penboack on October 18, 2012, 07:34:54 AM
Thank you for the feedback.
I have done some additional tests to test the effect of the Reflective shader > Reflection softness.
For completeness to allow an easy comparison between all the different renders I have reproduced the test renders from my earlier post


In this image the Water shader is producing the reflections using its default settings, AA set to 6, Detail set to 0.8.
White artefacts on the water surface.
[attachimg=1]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, AA set to 6, Detail set to 0.8.
Reflective Shader, 4 samples (default number of samples)
White artefacts on the water surface greatly reduced.
[attachimg=2]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, AA set to 6, Detail set to 0.8.
Reflective Shader, 16 samples
White artefacts on the water surface greatly reduced.
Very slight improvement over the previous image.
[attachimg=3]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, Reflection softness set to 0.01, 4 samples.
Render Settings: AA set to 6, Detail set to 0.8.
Reflections are much less noisy.
[attachimg=4]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, Reflection softness set to 0.005, 4 samples.
Render Settings: AA set to 6, Detail set to 0.8.
[attachimg=5]

In this image the Water shader reflections are set to 0, Reflective shader is producing the reflections, Reflection softness set to 0.001, 4 samples.
Render Settings: AA set to 6, Detail set to 0.8.
[attachimg=6]


I am very pleased with these results, using the Reflective shader with Reflection softness set to a value of 0.01 gives a good result. I could obviously improve the quality further by increasing the reflective shader sampling, and or the render Detail setting to 1, at the cost of a much longer render time.
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 18, 2012, 07:51:37 AM
Jeez Oshyan :-/

Not for incentive for me to respond or help people if I get responses like these from Planetside, isn't it?
Title: Re: Eliminating reflection flicker
Post by: Oshyan on October 18, 2012, 03:02:01 PM
Quote from: Tangled-Universe on October 18, 2012, 07:51:37 AM
Jeez Oshyan :-/

Not for incentive for me to respond or help people if I get responses like these from Planetside, isn't it?

I'm not sure what you're referring to. I didn't mean to be condescending or anything, if that's how it sounded. I'm at a loss to understand what upset you about my response, but it certainly wasn't intended.

- Oshyan
Title: Re: Eliminating reflection flicker
Post by: Matt on October 18, 2012, 05:16:44 PM
Hi Martin,

There were 2 slightly different suggestions which I was replying to (GI sampling and reflections), but there was overlap between my two replies which I realised as I was writing the second reply. I should have to combined the replies into one. Sorry about that.

Matt
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 19, 2012, 04:40:38 AM
Thanks guys.

Oshyan, I was not upset, rather annoyed. Clearly we were on the same line and as soon as Matt pointed out our mutual thoughts weren't correct you all of a sudden "hide" behind political correctness which I have been proven to be quite sensitive to ;)
("Well, I said it made sense to me, I didn't say it was correct", which is just being politically correct by using the literal sense of the words. Every reader would understand we were on the same line, otherwise you would have responded in rejection)

Matt, it's ok. I see what you mean.
I'd like to emphasize I don't mind to be corrected. On the contrary, this information is new to me now as well and happily absorbed in my TG-brain.
Lately I was accused of being a defeatist somewhere here, because I didn't show enough confidence in someone else's ideas.
However, I did have suggestions myself and shared my ideas for improvement which, despite one agrees with it or not, is constructive and contributes to the discussion.
Here (is the analogy), I felt you were more interested in replying to me specifically rather than solving the issue Penboack is having.

When I feel confronted with these things I really feel like not responding at all anymore and that's why I said I felt it's not very incentive anymore to try helping others here.
Title: Re: Eliminating reflection flicker
Post by: Tangled-Universe on October 19, 2012, 05:57:08 AM
Quote from: penboack on October 18, 2012, 07:34:54 AM
Thank you for the feedback.
I have done some additional tests to test the effect of the Reflective shader > Reflection softness.
For completeness to allow an easy comparison between all the different renders I have reproduced the test renders from my earlier post

...

I am very pleased with these results, using the Reflective shader with Reflection softness set to a value of 0.01 gives a good result. I could obviously improve the quality further by increasing the reflective shader sampling, and or the render Detail setting to 1, at the cost of a much longer render time.

These are great results :) Makes me wonder how different the water shader's reflective shading is from the reflective shader itself. Generally speaking it was thought that they were the same and that the reflective shader would allow you to disable raytraced reflections.
Seeing this it seems that the water shader's reflectivity tab could use some of the functionality of the reflective shader?

I suppose this does not affect transparency?
I'm honestly a bit surprised to see those white artefacts in the first place.
I have seen them before, but not as much as this and I use very similar settings often. Curious.
Title: Re: Eliminating reflection flicker
Post by: penboack on October 19, 2012, 07:22:56 AM
Quote from: Tangled-Universe on October 19, 2012, 05:57:08 AM
Seeing this it seems that the water shader's reflectivity tab could use some of the functionality of the reflective shader?

Yes, I would like to see the water shader's reflectivity tab have the same functionality as the reflective shader in a future release.
It would also be clearer to have the Reflectivity shader > Quality > Number of samples parameter on the reflective shader's main tab and loose the quality tab.
But as I want render passes more than anything else it might be better not to suggest such minor distractions!


I haven't looked at the impact on transparency.
In my original render I reduced, but didn't eliminate, the white specs by reducing reflections > highlight intensity to 0. I assume this parameter is controlling the reflection of lights, in this case the sun. I try and avoid using the term specularity, as in CG specularity is used to mean the reflection of highlights from lights, whereas in physics specularity means smoothness; a very smooth object is highly specular whether or not it is reflecting something. In my opinion eflect lights and reflect objects is much clearer.

Last weekend I was walking along the edge of a large pool and stopped to look carefully at the reflections. You get a certain amount of shimmer even with the sun behind you. I guess this could be a result of concave surfaces on the surface of the water concentrating light from the sky, it seems unlikely to be reflected sunlight given the angles involved, oh and I think it was quite cloudy! I also noted that in some situations the ripples can form something like you'd expect from a Voronoi noise shader. If you think about what a real lake or pool surface looks like to the eye the reflections are quite smooth, if you photograph it the reflections will depend on the exposure, becoming more blurred out with longer exposures.

Still thinking about Matt's third solution:
"3) use an imported object for your water. Then it will be ray traced, therefore shaded multiple times per pixel, according to the Pixel Sampler settings. This would be my preferred solution with v2.4 (we'll have better solutions available in future versions)."
Title: Re: Eliminating reflection flicker
Post by: Matt on October 19, 2012, 05:26:34 PM
Quote from: Tangled-Universe on October 19, 2012, 04:40:38 AM
Matt, it's ok. I see what you mean.
I'd like to emphasize I don't mind to be corrected. On the contrary, this information is new to me now as well and happily absorbed in my TG-brain.
Lately I was accused of being a defeatist somewhere here, because I didn't show enough confidence in someone else's ideas.
However, I did have suggestions myself and shared my ideas for improvement which, despite one agrees with it or not, is constructive and contributes to the discussion.

Yes, it contributes to the discussion. It gives me an opportunity to correct a misconception that you and Oshyan had, which others may have had too (as you said).

Quote
Here (is the analogy), I felt you were more interested in replying to me specifically rather than solving the issue Penboack is having.
...
When I feel confronted with these things I really feel like not responding at all anymore and that's why I said I felt it's not very incentive anymore to try helping others here.

I wasn't able to post directly at first, so Oshyan posted for me.

I'll try to be more sensitive to that possibility in the future. It is my nature to focus on things that are incorrect, and happily let things continue when they are all fine and good. If it seems like I do this often with your replies, maybe it's because you post more technical information that most people. That's great. Most of the time it's good information. But if I jump in to correct something, just think of me like your proof-reader, or editor ;)

Matt
Title: Re: Eliminating reflection flicker
Post by: Oshyan on October 19, 2012, 07:35:55 PM
Lots of great info here. :)

For my part I just want to say that the reason I got "politically correct" in my response is that I feel there's a real danger of people thinking that anything I say is absolutely correct just because I work at Planetside (not you Martin, you know better ;) ). Which is why in my original post I tried to make it clear that it was just my opinion and was what made sense to me, not what I *knew* to be true. My response to you was simply to reinforce that. I hope that clears it up.

- Oshyan