POV-Ray : Newsgroups : povray.advanced-users : Blurred reflections Server Time
21 Dec 2024 22:27:17 EST (-0500)
  Blurred reflections (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Mike Horvath
Subject: Blurred reflections
Date: 5 Feb 2018 19:12:12
Message: <5a78f2dc$1@news.povray.org>
The wiki describes a way to do blurred reflections.

http://wiki.povray.org/content/Knowledgebase:Language_Questions_and_Tips#Topic_13

Is the code in that article independent of scale? For instance:

     translate <rand(S),rand(S),rand(S)>*100

Should I increase or decrease that amount for different scenes?


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Blurred reflections
Date: 5 Feb 2018 21:05:55
Message: <5a790d83$1@news.povray.org>
Also, is there a way to speed this up? Right now it's stuck at 6% of the 
mosaic phase for an hour. I don't recall UberPOV being this slow. :(


Mike






#declare BlurAmount = 0.2*2; // Amount of blurring, double BlurAmount 
since it's used in an average
//#declare BlurSamples = 40; // How many rays to shoot
#declare BlurSamples = 10; // How many rays to shoot
#macro BlurredReflection(InPigment, InFinish, InNormal)
//	texture
//	{
		average
		texture_map
		{
			#declare iCount = 0;
			#declare S = seed(0);
			#while (iCount < BlurSamples)
				[
					1 // The pigment of the object:
					pigment { InPigment }
					// The surface finish:
					finish { InFinish }
					// This is the actual trick:
					normal
					{
						average
						normal_map
						{
							[1 bumps BlurAmount translate <rand(S),rand(S),rand(S)>*100 scale 
1000]
							[1 InNormal]
						}
					}
				]
				#declare iCount = iCount + 1;
			#end
		}
//	}
#end


Post a reply to this message

From: Mike Horvath
Subject: Re: Blurred reflections
Date: 6 Feb 2018 08:23:26
Message: <5a79ac4e$1@news.povray.org>
The scene ended up getting stuck at the 99% mark of the preview mosaic 
stage for several hours, and I had to stop it.

3.8.0-alpha.9475849+av541.msvc14.win64


Mike


Post a reply to this message

From: clipka
Subject: Re: Blurred reflections
Date: 6 Feb 2018 08:45:17
Message: <5a79b16d$1@news.povray.org>
Am 06.02.2018 um 03:06 schrieb Mike Horvath:
> Also, is there a way to speed this up? Right now it's stuck at 6% of the
> mosaic phase for an hour. I don't recall UberPOV being this slow. :(

The example given in the knowledgebase article uses the so-called
"macronormals" approach, as opposed to the "micronormals" approach that
is only described in the text itself.

Blurred reflections always need oversampling, i.e. at some point the ray
has to be split up into multiple rays that go into slightly different
directions.

With the macronormals approach, that oversampling is done upon
reflection: Wherever a ray is reflected at an object, the ray is split
up into a fixed number of sub-rays. The drawback is that any sub-ray
that also hits a blurred-reflective surface will be split up even
further into the same number of sub-sub-rays. In a scene with many
blurred-reflective surfaces, this causes render times to explode.

The micronormals approach can also be used in the same mode of operation
(essentially just replacing "scale 1000" with e.g. "scale 0.001"), but
alternatively it can be used with just one single texture (rather than
the average of a high number of textures) and some means of effecting
oversampling at the pixel level. This avoids the explosion of render
time in blurred-reflection-heavy scenes. (The drawback is that it also
increases render time for portions of the scene that have no blurred
rteflections; however, this can be partially mitigated by employing an
adaptive mechanism for the oversampling at the pixel level.)

The latter is essentially the mode of operation UberPOV uses. To effect
oversampling at the pixel level, UberPOV provides a special
anti-aliasing mode that shoots a number of rays randomly within each
pixel, and uses stochastic analysis to adapt the number of rays shot per
pixel to the image content.

In official POV-Ray, a very similar oversampling can be effected by
using ever so slight focal blur; adaptive focal blur is recommended in
that case.


A completely different approach to avoid the explosion of tertiary rays
is to provide two copies of each blurred-reflective object: One with
blurred reflections using an average of many textures and the
"no_reflection no_radiosity no_refraction" keyword, and one with just
one plain texture (or a low-quality blurred reflection) and the
"no_image" keyword. However, this approach breaks down if a
blurred-reflective surface is to be visible in a perfect mirror.


Post a reply to this message

From: Alain
Subject: Re: Blurred reflections
Date: 6 Feb 2018 19:14:49
Message: <5a7a44f9@news.povray.org>
Le 18-02-06 à 08:45, clipka a écrit :
> Am 06.02.2018 um 03:06 schrieb Mike Horvath:
>> Also, is there a way to speed this up? Right now it's stuck at 6% of the
>> mosaic phase for an hour. I don't recall UberPOV being this slow. :(
> 
> The example given in the knowledgebase article uses the so-called
> "macronormals" approach, as opposed to the "micronormals" approach that
> is only described in the text itself.
> 
> Blurred reflections always need oversampling, i.e. at some point the ray
> has to be split up into multiple rays that go into slightly different
> directions.
> 
> With the macronormals approach, that oversampling is done upon
> reflection: Wherever a ray is reflected at an object, the ray is split
> up into a fixed number of sub-rays. The drawback is that any sub-ray
> that also hits a blurred-reflective surface will be split up even
> further into the same number of sub-sub-rays. In a scene with many
> blurred-reflective surfaces, this causes render times to explode.
> 
> The micronormals approach can also be used in the same mode of operation
> (essentially just replacing "scale 1000" with e.g. "scale 0.001"), but
> alternatively it can be used with just one single texture (rather than
> the average of a high number of textures) and some means of effecting
> oversampling at the pixel level. This avoids the explosion of render
> time in blurred-reflection-heavy scenes. (The drawback is that it also
> increases render time for portions of the scene that have no blurred
> rteflections; however, this can be partially mitigated by employing an
> adaptive mechanism for the oversampling at the pixel level.)
> 
> The latter is essentially the mode of operation UberPOV uses. To effect
> oversampling at the pixel level, UberPOV provides a special
> anti-aliasing mode that shoots a number of rays randomly within each
> pixel, and uses stochastic analysis to adapt the number of rays shot per
> pixel to the image content.
> 
> In official POV-Ray, a very similar oversampling can be effected by
> using ever so slight focal blur; adaptive focal blur is recommended in
> that case.
> 
> 
> A completely different approach to avoid the explosion of tertiary rays
> is to provide two copies of each blurred-reflective object: One with
> blurred reflections using an average of many textures and the
> "no_reflection no_radiosity no_refraction" keyword, and one with just
> one plain texture (or a low-quality blurred reflection) and the
> "no_image" keyword. However, this approach breaks down if a
> blurred-reflective surface is to be visible in a perfect mirror.
> 
In that case, you can use the micronormals way.
If using mocronormals, you need to use antialiasing to get decent 
results. In some cases, you may need to increase the recursion depth by 
one or two notches : +r4 or +r5.


Post a reply to this message

From: Mike Horvath
Subject: Re: Blurred reflections
Date: 6 Feb 2018 20:17:53
Message: <5a7a53c1@news.povray.org>
On 2/6/2018 8:45 AM, clipka wrote:
> The micronormals approach can also be used in the same mode of operation
> (essentially just replacing "scale 1000" with e.g. "scale 0.001"), but
> alternatively it can be used with just one single texture (rather than
> the average of a high number of textures) and some means of effecting
> oversampling at the pixel level. This avoids the explosion of render
> time in blurred-reflection-heavy scenes. (The drawback is that it also
> increases render time for portions of the scene that have no blurred
> rteflections; however, this can be partially mitigated by employing an
> adaptive mechanism for the oversampling at the pixel level.)

I tried scaling by 1/1000 instead of 1000, but the render time has not 
improved noticeably. UberPOV blurred reflection is still much much faster.


Mike


Post a reply to this message

From: clipka
Subject: Re: Blurred reflections
Date: 7 Feb 2018 15:41:28
Message: <5a7b6478$1@news.povray.org>
Am 07.02.2018 um 02:17 schrieb Mike Horvath:
> On 2/6/2018 8:45 AM, clipka wrote:
>> The micronormals approach can also be used in the same mode of operation
>> (essentially just replacing "scale 1000" with e.g. "scale 0.001"), but
>> alternatively it can be used with just one single texture (rather than
>> the average of a high number of textures) and some means of effecting
>> oversampling at the pixel level. This avoids the explosion of render
>> time in blurred-reflection-heavy scenes. (The drawback is that it also
>> increases render time for portions of the scene that have no blurred
>> rteflections; however, this can be partially mitigated by employing an
>> adaptive mechanism for the oversampling at the pixel level.)
> 
> I tried scaling by 1/1000 instead of 1000, but the render time has not
> improved noticeably. UberPOV blurred reflection is still much much faster.

Just replacing macro- with micronormals doesn't do anything to render
times. The key is to get rid of the `average texture_map` and use just a
single texture.


Post a reply to this message

From: Mike Horvath
Subject: Re: Blurred reflections
Date: 8 Feb 2018 00:11:25
Message: <5a7bdbfd$1@news.povray.org>
On 2/7/2018 3:41 PM, clipka wrote:
> Am 07.02.2018 um 02:17 schrieb Mike Horvath:
>> I tried scaling by 1/1000 instead of 1000, but the render time has not
>> improved noticeably. UberPOV blurred reflection is still much much faster.
> 
> Just replacing macro- with micronormals doesn't do anything to render
> times. The key is to get rid of the `average texture_map` and use just a
> single texture.
> 

So, all I have to do is add a tiny focal blur?


Mike


Post a reply to this message

From: clipka
Subject: Re: Blurred reflections
Date: 8 Feb 2018 04:15:47
Message: <5a7c1543$1@news.povray.org>
Am 08.02.2018 um 06:11 schrieb Mike Horvath:
> On 2/7/2018 3:41 PM, clipka wrote:
>> Am 07.02.2018 um 02:17 schrieb Mike Horvath:
>>> I tried scaling by 1/1000 instead of 1000, but the render time has not
>>> improved noticeably. UberPOV blurred reflection is still much much
>>> faster.
>>
>> Just replacing macro- with micronormals doesn't do anything to render
>> times. The key is to get rid of the `average texture_map` and use just a
>> single texture.
>>
> 
> So, all I have to do is add a tiny focal blur?

Provided you're indeed using a single texture rather than `average
texture_map` and all that jazz - yes.

The quality of the blurred reflections will then depend on the focal
blur settings.


Post a reply to this message

From: Alain
Subject: Re: Blurred reflections
Date: 8 Feb 2018 16:08:44
Message: <5a7cbc5c@news.povray.org>
Le 18-02-08 à 00:11, Mike Horvath a écrit :
> On 2/7/2018 3:41 PM, clipka wrote:
>> Am 07.02.2018 um 02:17 schrieb Mike Horvath:
>>> I tried scaling by 1/1000 instead of 1000, but the render time has not
>>> improved noticeably. UberPOV blurred reflection is still much much 
>>> faster.
>>
>> Just replacing macro- with micronormals doesn't do anything to render
>> times. The key is to get rid of the `average texture_map` and use just a
>> single texture.
>>
> 
> So, all I have to do is add a tiny focal blur?
> 
> 
> Mike

It's an option.
You also can use antiliasing, possibly with some tewaking, like going 
from the defaul recussion level of 3 to 4. Adding +r4 on the command 
line will do the trick.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.