POV-Ray : Newsgroups : povray.general : Odd visual distortion / artefacts with different scalings and orientaions Server Time
25 Dec 2024 09:06:11 EST (-0500)
  Odd visual distortion / artefacts with different scalings and orientaions (Message 1 to 9 of 9)  
From: Bald Eagle
Subject: Odd visual distortion / artefacts with different scalings and orientaions
Date: 4 Mar 2014 15:17:42
Message: <531634e6@news.povray.org>
I'm laying out a large facility, and trying to view a tiling grid and 
some layout lines.  I've noticed that when I zoom way out, I lose some 
lines, and get tricked into thinking they're not there, which gives the 
floor tiling grid an effect that fooled me into thinking I'd messed up 
the scaling.
Some of the yellow layout "lines" (and these are HUGE cylinders) also 
inexplicably disappear when I zoom out.  Rotate view y*90, and the other 
lines disappear!

I'm a little lost as to what's going on, why, and how to fix it.

SDL for file starts below
(Using POV-Ray 3.6)
########################################



#declare SDL = true; // Turns off test options in include files

#include "colors.inc"
#include "math.inc"
#include "textures.inc"
#include "woods.inc"
#include "stones1.inc"
#include "shapes.inc"

#include "debug.inc"

#include "functions.inc"
#include "transforms.inc"

#include "School_Chairs.inc"
#include "Desk.inc"
#include "Stair_0.inc"


global_settings { ambient_light White }

Set_Debug (true)

sky_sphere {
   	pigment {
     	gradient y
     		color_map {
       		[0.0 rgb <0.6,0.7,1.0>]
       		[0.8 rgb <0.2,0.3,0.9>]
     		}
   	}
}

#declare Feet = 12;

#declare Layout = material { texture {pigment {color Yellow} finish 
{ambient 1}} };

#declare Tile_01 = pigment{ agate agate_turb 2
     			color_map {
         			[0 color rgbf<0.5,0.5,0,0>]
         			//[0 color rgbf<0.5,0.5,0,0>]
         			[1 color rgbf<1,1,1,0>]
     				}
     			frequency 2 scale -0.5 rotate <0,90,0> translate <100,0,0>
			}

#declare Tile_02 = pigment{ agate agate_turb 2
     			color_map {
         			[0 color rgbf<0.5,0.5,0,0>]
         			[1 color rgbf<1,1,1,0>]
     				}
     			frequency 2 scale 0.5
			}

#declare All_tiles = pigment{
     checker
     pigment{Tile_01}
     pigment{Tile_02}
     scale <12, 0.1, 12>
}


#declare Floor_tex =
texture {pigment {All_tiles}}

#macro Raster(RScale, RLine)
pigment{gradient x //scale RScale
         color_map{
         [0.000   color rgbt<0,0,0,0>]
         [0+RLine color rgbt<0,0,0,0>]

         [0+RLine color rgbt<1,1,1,1>]
         [1-RLine color rgbt<1,1,1,1>]

         [1-RLine color rgbt<0,0,0,0>]
         [1.000   color rgbt<0,0,0,0>]
         }
         scale RScale}
#end // of macro


#declare White_Tile =  material { texture {Floor_tex}
     				texture{ Raster( 12, 0.045)}
     				texture{ Raster( 12.09, 0.045)rotate<0,90,0>}
        				}



#declare Blue_Tile =   material { texture {pigment {color Blue*0.4} 
normal {granite scale 10}} };
#declare Yellow_Tile = material { texture {pigment {color Yellow*0.5} 
normal {granite scale 10}} };

#declare Block = texture {pigment {granite frequency 8
			color_map {[.2 color rgb .75] [.7 color rgb .9]}
			triangle_wave }
    		normal {granite -.1 frequency 8 triangle_wave}
     		finish {ambient .15 diffuse .7 specular .05 roughness .5}
  		scale <1,1,.5>}

#declare White_Wall =  material { texture {pigment {brick pigment 
{Gray80} pigment {White} brick_size <8, 8, 16> } normal { wrinkles 0.75 
scale 0.04} finish {diffuse 0.9 phong 0.2} }};
#declare Brick_Wall =  material { texture {pigment {brick brick_size <8, 
8, 16> }}};
#declare Blue_Wall =   material { texture {pigment {brick pigment 
{Blue*0.5} pigment {Blue*0.4} brick_size <8, 8, 16> }}};
#declare Green_Tex =   material { texture {pigment {color Green*0.4} 
normal {granite scale 1}} };

#declare Cream_Paint = material { texture {pigment {color White} } };
#declare Black_Paint = material { texture {pigment {color Black} 
finish{diffuse 0.9 } normal {granite scale 1}} };
#declare Blue_Shelf =  material { texture {pigment {color Blue} normal 
{granite scale 10}} };
#declare White_Board = material { texture {pigment {color White} finish 
{ reflection 0.01} } };

#declare Fake_Wood_Hor =   texture {T_Wood19 scale 10 };
#declare Fake_Wood_Vert =  texture {T_Wood19 scale 20 rotate x*90};

#declare Fake_Wood_Hor2 =  texture {T_Wood18 scale 10 };
#declare Fake_Wood_Vert2 = texture {T_Wood18 scale 20 rotate x*90};


	

#declare Window_Glass = texture{
   			pigment{ rgbf<0.98, 0.98, 0.98, 0.9> }
			  finish { diffuse 0.1
			           reflection 0.2
			           specular 0.8
			           roughness 0.0003
			           phong 1
			           phong_size 400}
			           }


#declare Text = material { texture {pigment {color Blue} finish {ambient 
1} } };



#declare Legend = union {
		text { ttf "arial.ttf" "Facility Layout" 0.1, 0 material {Text} scale 
190 rotate x*90}
		}
#declare Text_pos = Center_Trans(Legend, x+y+z);
object {Legend transform Text_pos  translate <20*8*Feet, 16*Feet, 
40*8*Feet> material {Text} }

// HALLWAY VIEW
//camera {location <16.5*8*Feet, 4*Feet, 24*Feet> look_at  <16.5*8*Feet, 
1*Feet, 0*Feet>}
light_source { <16.5*8*Feet, 7*Feet, 12*Feet> color rgb <1,1,1> *0.5 }

// CENTERED OVERHEAD VIEW
//camera {location <20*8*Feet, 450*Feet, 20*8*Feet> look_at  <20*8*Feet, 
0*Feet, 20*8*Feet>}
camera {location <16.5*8*Feet, 16*Feet, 20*8*Feet> look_at 
<16.5*8*Feet, 0*Feet, 20*8*Feet>}
light_source { <160*Feet, 500*Feet, 160*Feet> color rgb <1,1,1> *0.5 }

// 400 * 400 layout boxes
// Overall
box { <0,-1,0>, <41*8*Feet, -1.1, 45*8*Feet> material {White_Tile}}
// A-Unit
// B-Unit
// C-Unit
// D-Unit
box { <8*8*Feet,-0.5, 10*8*Feet>, <16*8*Feet, -1, 18*8*Feet> pigment 
{Green}}
	
	box { <4*8*Feet,-0.5, 10*8*Feet>, <8*8*Feet, -1, 15*8*Feet> pigment 
{Gray50}}
// E-Unit
box { <8*8*Feet,-0.5, 2*8*Feet>, <16*8*Feet, -1, 10*8*Feet> pigment {Red}}
	
	box { <4*8*Feet,-0.5, 5*8*Feet>, <8*8*Feet, -1, 10*8*Feet> pigment 
{Gray50}}
// F-Unit
box { <17*8*Feet,-0.5, 0*8*Feet>, <29*8*Feet, -1, 8.5*8*Feet> pigment 
{Blue}}
	
	box { <29*8*Feet,-0.5, 2.5*8*Feet>, <33.5*8*Feet, -1, 6.5*8*Feet> 
pigment {Gray50}}
// G-Unit
box { <17*8*Feet,-0.5, 8.5*8*Feet>, <21*8*Feet, -1, 15.5*8*Feet> pigment 
{Red}}
box { <17*8*Feet,-0.5, 14*8*Feet>, <30*8*Feet, -1, 26*8*Feet> pigment {Red}}
// H-Unit
// J-Unit

//camera {location <15*8*Feet, 8*Feet, 14*8*Feet> look_at  <8*Feet, 
0*Feet, 14*8*Feet>}
// Layout lines
cylinder {<4*8*Feet, 0, -8*Feet>, <4*8*Feet, 0, 26*8*Feet>, 6 material 
{Layout} }
cylinder {<8*8*Feet, 0, -8*Feet>, <8*8*Feet, 0, 26*8*Feet>, 6 material 
{Layout} }
cylinder {<21*8*Feet, 0, -8*Feet>, <21*8*Feet, 0, 24*8*Feet>, 6 material 
{Layout} }
cylinder {<-8*Feet, 0, 14*8*Feet>, <46*8*Feet, 0, 14*8*Feet>, 6 material 
{Layout} }

///////////////////////////////////////////////////////////////////////////////////////////////////////
// Hallways
box { <16*8*Feet-8, 0, 8*Feet>, <16*8*Feet, 8*Feet, 25*8*Feet> material 
{White_Wall} }
box { <17*8*Feet, 0, 8*Feet>, <17*8*Feet+8, 8*Feet, 25*8*Feet> material 
{White_Wall} }
box { <16*8*Feet-8, 0, 8*Feet>, <17*8*Feet+8, 8*Feet, 8*Feet-8> material 
{White_Wall rotate y*90} }

box { <18*8*Feet, 0, 26*8*Feet>, <39.5*8*Feet+8, 8*Feet, 26*8*Feet-8> 
material {White_Wall rotate y*90} }
box { <14*8*Feet, 0, 26*8*Feet>, <15*8*Feet+8, 8*Feet, 26*8*Feet-8> 
material {White_Wall rotate y*90} }

box { <0, 0, 0>, <8*Feet*1.4, 8*Feet, -8> material {White_Wall rotate 
y*90} rotate y*45 translate x*15*8*Feet translate z*26*8*Feet}
box { <0, 0, 0>, <8*Feet*1.4, 8*Feet, -8> material {White_Wall rotate 
y*90} rotate -y*45 translate x*17*8*Feet translate z*25*8*Feet}

box { <17*8*Feet, 0, 27*8*Feet>, <39.5*8*Feet+8, 8*Feet, 27*8*Feet+8> 
material {White_Wall rotate y*90} }
box { <0*8*Feet, 0, 27*8*Feet>, <16*8*Feet+8, 8*Feet, 27*8*Feet+8> 
material {White_Wall rotate y*90} }


Post a reply to this message

From: Le Forgeron
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaions
Date: 4 Mar 2014 15:52:16
Message: <53163d00$1@news.povray.org>
Le 04/03/2014 21:18, Bald Eagle nous fit lire :
> //camera {location <15*8*Feet, 8*Feet, 14*8*Feet> look_at  <8*Feet,
> 0*Feet, 14*8*Feet>}
> // Layout lines
> cylinder {<4*8*Feet, 0, -8*Feet>, <4*8*Feet, 0, 26*8*Feet>, 6 material
> {Layout} }
> cylinder {<8*8*Feet, 0, -8*Feet>, <8*8*Feet, 0, 26*8*Feet>, 6 material
> {Layout} }
> cylinder {<21*8*Feet, 0, -8*Feet>, <21*8*Feet, 0, 24*8*Feet>, 6 material
> {Layout} }
> cylinder {<-8*Feet, 0, 14*8*Feet>, <46*8*Feet, 0, 14*8*Feet>, 6 material
> {Layout} }

How do you zoom-out ?

If adjusting Feet, notice the radius of cylinder are not function of Feet.


Post a reply to this message

From: Bald Eagle
Subject: Re: Odd visual distortion / artefacts with different scalings andorientaions
Date: 4 Mar 2014 16:03:10
Message: <53163f8e$1@news.povray.org>
> How do you zoom-out ?
> If adjusting Feet, notice the radius of cylinder are not function of Feet.

Zooming out is just changing the y-value for the camera.
(see other alternate camera definitions commented out)

"Feet" is a constant (12), so that I can stay sane when sizing and 
positioning things.  The cylinders are therefore 6 inches in diameter, 
since my sanity benefits from having 1 POV Unit = 1 inch.  Because I'm 
all non-metric like that.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaio=
Date: 4 Mar 2014 17:15:01
Message: <web.53165017aefaf49c192ae5f10@news.povray.org>
Bald Eagle <cre### [at] netscapenet> wrote:
> I'm laying out a large facility, and trying to view a tiling grid and
> some layout lines.  I've noticed that when I zoom way out, I lose some
> lines, and get tricked into thinking they're not there, which gives the
> floor tiling grid an effect that fooled me into thinking I'd messed up
> the scaling.
> Some of the yellow layout "lines" (and these are HUGE cylinders) also
> inexplicably disappear when I zoom out.  Rotate view y*90, and the other
> lines disappear!

I don't get /exactly/ the same result as you posted in p.b.i, but it appears
that when you zoom out, the grid lines and the yellow cylinders become less than
one pixel wide.  When this happens, the rays traced can easily miss the object.

Using anti-aliasing can increase the chances of hitting the object.  To maximize
the chances, use +A0.0 with a high +R value; however this will slow down the
render.

An alternative is to scale the width of the grid lines in proportion to the
distance of the camera from the facility.


Post a reply to this message

From: Bald Eagle
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaio=
Date: 4 Mar 2014 20:33:25
Message: <53167ee5$1@news.povray.org>
> ... it appears
> that when you zoom out, the grid lines and the yellow cylinders become less than
> one pixel wide.  When this happens, the rays traced can easily miss the object.

OK,  I'm following your reasoning here, but I'm seriously doubting 
that's _really_ the case since the vertical cylinders show up, and the 
horizontal one is GONE. The bloody thing's a foot in diameter!
And why would SOME grid lines show up (shouldn't they all be the same 
pixel width?) and others not?  It's just ... odd.

I'll see if I can calculate the expected pixel width and try to see 
what's what.  Good thing there's coffee left.  :)

> An alternative is to scale the width of the grid lines in proportion to the
> distance of the camera from the facility.

That's a _good_ idea, I'll try that.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaio=
Date: 5 Mar 2014 10:30:00
Message: <web.5317429bd696a6f385de7b680@news.povray.org>
Bald Eagle <cre### [at] netscapenet> wrote:
> OK,  I'm following your reasoning here, but I'm seriously doubting
> that's _really_ the case since the vertical cylinders show up, and the
> horizontal one is GONE. The bloody thing's a foot in diameter!
> And why would SOME grid lines show up (shouldn't they all be the same
> pixel width?) and others not?  It's just ... odd.

It's hit or miss.  An object can be really small, but it will be traced if it
just /happens/ to be in the right spot.  That's why many of the grid lines
showed up even though they are very narrow; the shear number of grid lines
practically insures that a bunch of them will be hit by the ray tracing
algorithm.


Post a reply to this message

From: James Holsenback
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaio=
Date: 5 Mar 2014 10:34:28
Message: <53174404$1@news.povray.org>
On 03/05/2014 10:28 AM, Cousin Ricky wrote:
> Bald Eagle <cre### [at] netscapenet> wrote:
>> OK,  I'm following your reasoning here, but I'm seriously doubting
>> that's _really_ the case since the vertical cylinders show up, and the
>> horizontal one is GONE. The bloody thing's a foot in diameter!
>> And why would SOME grid lines show up (shouldn't they all be the same
>> pixel width?) and others not?  It's just ... odd.
>
> It's hit or miss.  An object can be really small, but it will be traced if it
> just /happens/ to be in the right spot.  That's why many of the grid lines
> showed up even though they are very narrow; the shear number of grid lines
> practically insures that a bunch of them will be hit by the ray tracing
> algorithm.

agreed ... for what it's worth uberpov +am3 /can/ be helpful, but in the 
end it's all about viewing angle and distance


Post a reply to this message

From: Le Forgeron
Subject: Re: Odd visual distortion / artefacts with different scalings andorientaio=
Date: 5 Mar 2014 11:17:01
Message: <53174dfd$1@news.povray.org>
Le 05/03/2014 02:33, Bald Eagle nous fit lire :
>> ... it appears
>> that when you zoom out, the grid lines and the yellow cylinders become
>> less than
>> one pixel wide.  When this happens, the rays traced can easily miss
>> the object.
> 
> OK,  I'm following your reasoning here, but I'm seriously doubting
> that's _really_ the case since the vertical cylinders show up, and the
> horizontal one is GONE. The bloody thing's a foot in diameter!
> And why would SOME grid lines show up (shouldn't they all be the same
> pixel width?) and others not?  It's just ... odd.
> 
> I'll see if I can calculate the expected pixel width and try to see
> what's what.  Good thing there's coffee left.  :)
> 
>> An alternative is to scale the width of the grid lines in proportion
>> to the
>> distance of the camera from the facility.
> 
> That's a _good_ idea, I'll try that.
> 

try one thing (for the experiment): replace the horizontal cylinder with
4 or more cylinders of same radius, but reduced length. (each ends of
the new cylinders touching or inside another cylinder; if using
transparent texturing and/or interior, put them in a merge{} )

There might be something about the relative dimension of the cylinder,
as the povray never looks at your L x R cylinder, but use a
transformation to a unit cylinder... it might be yet another strike of
Epsilon filter or something similar.


Post a reply to this message

From: Alain
Subject: Re: Odd visual distortion / artefacts with different scalings and orientaions
Date: 6 Mar 2014 16:25:19
Message: <5318e7bf@news.povray.org>

> I'm laying out a large facility, and trying to view a tiling grid and
> some layout lines.  I've noticed that when I zoom way out, I lose some
> lines, and get tricked into thinking they're not there, which gives the
> floor tiling grid an effect that fooled me into thinking I'd messed up
> the scaling.
> Some of the yellow layout "lines" (and these are HUGE cylinders) also
> inexplicably disappear when I zoom out.  Rotate view y*90, and the other
> lines disappear!
>
> I'm a little lost as to what's going on, why, and how to fix it.
>

Whenever any object dimention is less than one pixel in some direction, 
you risk totaly missing it. For a long cylinder, you may see part if it, 
but not some other parts. Antialiasing often don't help here, only 
making the visible parts fade in and out of view. Using uberPOV and +am3 
can greatly help in this case.

If some object are *VERY* large, they may end up disapearing totaly. It 
can appen when the dimention exceed 1e6. For your cylinders, if they are 
that long, it's a good idea to split them into a collection of shorter 
ones. This may also make the scene render faster as you can get beter 
bounding.

A possible solution is to change the radius of your cylinder according 
to the distance/zoom. It may even be advisable to use cones instead of 
cylinders.



Alain


Post a reply to this message

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