POV-Ray : Newsgroups : povray.binaries.images : Artifacts in scattering media Server Time
8 Nov 2024 02:26:49 EST (-0500)
  Artifacts in scattering media (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: jceddy
Subject: Artifacts in scattering media
Date: 18 Sep 2013 09:45:01
Message: <web.5239ae4fbc5e76cf314aa6840@news.povray.org>
So I made this image using scattering media to get light "rays" spilling out of
a broken skull.

I am getting artifacts in the media rendering that I don't know how to
handle...I've marked them out with a red box in the attached image. Any ideas?

I've tried:
Upping the media sample min/max a lot.
Increasing the confidence.
Decreasing the variance.
Various combinations of the above.
Messing around with intervals.

Here's the code:

#version 3.7;

#include "colors.inc"
#include "glass.inc"
#include "metals.inc"
#include "stones.inc"
#include "skies.inc"
#include "woods.inc"
#include "golds.inc"
#include "textures.inc"
#include "transforms.inc"

#include "skullmodel_POV_geom.inc"

global_settings
{
  assumed_gamma 2.2
  ambient_light 1
}

#default{ finish{ ambient 0.1 diffuse 0.9 }}

camera {
  orthographic
  location <0,0,200>     // position & direction of view
  look_at  <0,0,0>
  right    x*24.5
  up       y*14.5
}

light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <3, 2.25, 400>
  media_interaction off
}

light_source {
  0*x                  // light's position (translated below)
  color rgb <1,1,1>    // light's color
  translate <0, 0, 10>
}

#declare Min = min_extent(skull_01___Default_);
#declare Max = max_extent(skull_01___Default_);
#declare ScaleFactor = max(Max.x - Min.x, max(Max.y - Min.y, Max.z - Min.z));

#declare skull_ =
object{
  skull_01___Default_

  Center_Trans(skull_01___Default_, x)
  Center_Trans(skull_01___Default_, y)
  Center_Trans(skull_01___Default_, z)

  scale 2/ScaleFactor
}

#declare iso_ =
isosurface {
  function{
    x-f_snoise3d(x, y, z)*5
  }
  contained_by { box {<-10,-10,-10>, <10, 10, 10> } }
  accuracy 0.003
}

intersection {
  object { skull_ scale 5.0 }
  object { iso_ }

  texture {
    pigment {
      color White
    }
    finish {
      specular 0
      roughness 0.09632328
      ambient 0.1

      diffuse 0.7
      reflection 0.2
    }
  }

  translate 10*z
}

sphere {
  <0, 0, 10>, 25

  texture {
    pigment { rgbf 1 }
    finish { ambient 0 }
  }

  interior {
    media {
      scattering { 4, rgb 1 }

      density {
        spherical
        density_map {
          [0 rgb 0.0]
          [1 rgb 0.2]
        }

        scale 10

        translate 10*z
      }

      samples 40, 400
    }
  }

  hollow on
}


Post a reply to this message


Attachments:
Download 'skullthingie02.jpg' (129 KB)

Preview of image 'skullthingie02.jpg'
skullthingie02.jpg


 

From: Thomas de Groot
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 10:16:27
Message: <5239b5bb@news.povray.org>
On 18-9-2013 15:44, jceddy wrote:

>        samples 40, 400

By default, intervals is 1 and method is 3 in version 3.7. Accordingly, 
samples needs only /one/ parameter, the second one being ignored.

instead of 40, try samples 100 or higher. Render time will not be too 
much influenced.

Thomas


Post a reply to this message

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 11:15:01
Message: <web.5239c34c5cbaed3314aa6840@news.povray.org>
> By default, intervals is 1 and method is 3 in version 3.7. Accordingly,
> samples needs only /one/ parameter, the second one being ignored.
>
> instead of 40, try samples 100 or higher. Render time will not be too
> much influenced.

Thanks for the tip on only specifying one parameter for samples.
I increased it to 400 and still get that artifact, although in general the media
effect looks smoother.  I pushed it up way higher and am doing another test
render, although it is progressing much more slowly.

Incidentally, I ran the same code in v 3.6 just to test and have the same
artifact there.


Post a reply to this message

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 12:50:01
Message: <web.5239d9865cbaed3314aa6840@news.povray.org>
> I pushed it up way higher and am doing another test
> render, although it is progressing much more slowly.

The artifact remains after pushing the samples up to 4000, and it took an hour
and a half to render.

I don't think it's something that tweaking samples will fix, but I'm at a loss
to figure out what's causing it.

I attached the file from the 4000 samples run.


Post a reply to this message


Attachments:
Download 'skullthing4000.png' (88 KB)

Preview of image 'skullthing4000.png'
skullthing4000.png


 

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 14:20:01
Message: <web.5239ee6e5cbaed3314aa6840@news.povray.org>
This might be a red herring...I wonder if the artifact is actually due to some
interaction with the isosurface in CSG.


Post a reply to this message

From: James Holsenback
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 15:04:47
Message: <5239f94f$1@news.povray.org>
On 09/18/2013 02:18 PM, jceddy wrote:
> This might be a red herring...I wonder if the artifact is actually due to some
> interaction with the isosurface in CSG.
>
>

maybe not such a red herring ... noticed in your example that you didn't 
set a max_gradient value so it's 1.1 (default) ... was/is there an 
warning message ... if so bump it up some until it goes away. btw: more 
render time is the cost here


Post a reply to this message

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 15:50:01
Message: <web.523a037d5cbaed3314aa6840@news.povray.org>
No, I didn't get a max_gradient warning, but I'll bump it up and re-try anyway,
to see if it helps.

I might try to do it without the isosurface, as well.


Post a reply to this message

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 17:05:01
Message: <web.523a14a15cbaed3314aa6840@news.povray.org>
That was it...I cranked max_gradient on the isosurface up to 5 and the artifacts
went away.

I'm still tweaking the samples value for the media to find the threshold where
"normal" media artifacts go away, but it's somewhere south of 400 for this
scene. ;)

Thanks for the suggestion!


Post a reply to this message

From: Cousin Ricky
Subject: Re: Artifacts in scattering media
Date: 18 Sep 2013 20:55:00
Message: <web.523a4a7f5cbaed3306548240@news.povray.org>
"jceddy" <jce### [at] gmailcom> wrote:
> No, I didn't get a max_gradient warning, but I'll bump it up and re-try anyway,
> to see if it helps.

See "Isosurface: max_gradient warning?" in p.beta-test.


Post a reply to this message

From: jceddy
Subject: Re: Artifacts in scattering media
Date: 24 Sep 2013 12:10:00
Message: <web.5241b8675cbaed3314aa6840@news.povray.org>
Could max_gradient being too low also cause issues when doing CSG between and
isosurface and a solid mesh object?


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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