POV-Ray : Newsgroups : povray.general : Graininess : Re: Graininess Server Time
31 Jul 2024 02:30:51 EDT (-0400)
  Re: Graininess  
From: SharkD
Date: 11 Jan 2008 21:10:00
Message: <web.4788208022fbe8cfd410b38f0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> http://img213.imageshack.us/my.php?image=hslsphereshowgw2.jpg
>
> If you look at the above image you can see graininess where the square grid
> overlaps the cut portion of the sphere? What causes this? Ususally stuff like
> this only happens when there are coincident surfaces. I checked and there are
> none. Moving the grid away from the sphere surface causes the problem to
> lessen. Turning the light sources off causes it to go away. I've experimented
> with changing to a parallel camera, parallel lights, turning off shadows and
> reflection for objects, turning off ambient in global settings and in the
> finish, turning off radiosity, etc....

Here's the scene. It uses two include files available from the Object
Collection.

#include "SphereGrid_macro.inc"
#include "Axes_macro.inc"
#include "functions.inc"
#include "math.inc"

global_settings
{
 assumed_gamma 1.0
 ambient_light 0.3
}

light_source
{
 <0, 0, 0>            // light's position (translated below)
 color rgb <1, 1, 1>  // light's color
 translate <-30, 30, -30>
 shadowless
}

light_source
{
 <0, 0, 0>            // light's position (translated below)
 color rgb <1, 1, 1>  // light's color
 translate <-30, 30, -30>
 rotate y * 90
 shadowless
}

camera
{
 #local CameraDistance = 10;
 #local ScreenArea = 2;
 #local AspectRatio = image_width/image_height;
// orthographic
 location -z*CameraDistance
 direction z*CameraDistance
 right     x*ScreenArea*AspectRatio
 up        y*ScreenArea
 rotate x*asind(tand(30))
 rotate y*45
}

// the coordinate grid and axes
Axes_Macro
(
 10, // Axes_axesSize, The distance from the origin to one of the grid's edges.
(float)
 1, // Axes_majUnit, The size of each large-unit square. (float)
 10, // Axes_minUnit, The number of small-unit squares that make up a large-unit
square. (integer)
 0.0005, // Axes_thickRatio, The thickness of the grid lines (as a factor of
axesSize). (float)
 off, // Axes_aBool,  Turns the axes on/off. (boolian)
 on, // Axes_mBool,  Turns the minor units on/off. (boolian)
 off, // Axes_xBool,  Turns the plane perpendicular to the x-axis on/off.
(boolian)
 on, // Axes_yBool,  Turns the plane perpendicular to the y-axis on/off.
(boolian)
 off // Axes_zBool,  Turns the plane perpendicular to the z-axis on/off.
(boolian)
)

object
{
 Axes_Object
 translate -0.000001
 no_shadow
 no_reflection
// no_image
 finish
 {
  ambient 0
 }
}

SphereGrid_Macro
(
 6,   // SphereGrid_radii,  The number of radial divisions. (integer)

                           //radii,  The number of radial divisions. (integer)
 12,   // SphereGrid_longt,  The number of longitudinal divisions. (integer)

                          //longt,  The number of longitudinal divisions.
(integer)
 6,   // SphereGrid_lattt,  The number of lattitudinal divisions. (integer)

                         //lattt,  The number of lattitudinal divisions.
(integer)
 1,   // SphereGrid_radius,  The radius of the sphere. (float)

                              //ObjectRadius,  The radius of the sphere. (float)
 0,   // SphereGrid_center,  The center coordinates of the sphere. (vector)

                                 //ObjectCenter,  The center coordinates of the
sphere. (vector)
 0.01,   // SphereGrid_thickness,  The thickness of the grid lines. (float)

                                       //LineThickness, The thickness of the
grid lines. (float)
 0,   // SphereGrid_offset,  Determines whether the divisions are offset by half
the amount (sometimes necessary when doing cut-aways at intervals matching the
grid's divisions). (boolian)//OffsetBool  Determines whether the divisions are
offset by half the amount (sometimes necessary when doing cut-aways at
intervals matching the grid's divisions). (boolian)
)


#declare sRadius = 1 ;
#declare sCenter = 0 ;

difference
{
 sphere
 {
  sCenter, sRadius
 }
 box
 {
  sCenter, <-sRadius,sRadius,-sRadius,> * 2
 }
 object
 {
  SphereGrid_Object
 }

 texture
 {
  pigment
  {
   color rgb 1
  }
  finish
  {
   ambient 1
  }
 }
}


Post a reply to this message

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