POV-Ray : Newsgroups : povray.newusers : How can I fix surface perfections on my render? Server Time
21 Nov 2024 08:05:25 EST (-0500)
  How can I fix surface perfections on my render? (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: circuit
Subject: How can I fix surface perfections on my render?
Date: 9 May 2020 19:45:01
Message: <web.5eb73fc759256ef14eff8dd80@news.povray.org>
Hey all. Just started using POV-Ray with FreeCAD. I'm trying to render a solid
assembly, and so far have had reasonable success. The issue I'm facing is that
the output surface has a lot of imperfections around edges. You can see what I
mean here:

https://i.imgur.com/jmSYFlA.png

I've played around with a bunch of settings, but nothing seems to work. Here's
my current .ini settings:

        Input_File_Name="tester.pov"
        Width=1600
        Height=1200
        Output_Alpha=true
        Antialias=On
        Antialias_Threshold=0.05
        Output_File_Type=N
        Initial_Frame=1
        Final_Frame=20
        Subset_Start_Frame=1
        Subset_End_Frame=20

Here's the .pov template:

            // Persistence of Vision Ray Tracer Scene Description File
            // for FreeCAD (http://www.freecadweb.org)

            #version 3.6;

            #include "colors.inc"
            #include "metals.inc"
            #include "rad_def.inc"

            global_settings {
                radiosity {
                    Rad_Settings(Radiosity_Normal,off,off)
                }
            }

            #default {finish{ambient 0}}

            sky_sphere {
                pigment {
                    gradient y
                    color_map {
                        [0.0  color LightGray]
                        [0.3  color White]
                        [0.7  color LightGray]
                    }
                }
            }

            // Standard finish
            #declare StdFinish = finish { crand 0.01 diffuse 0.8 };

            //RaytracingContent

            //default light
            light_source {
                cam_location
                color White
                area_light <100, 0, 0>, <0, 0, 100>, 10, 10
                adaptive 1
                jitter
            }


Finally here's the camera view in FreeCAD:

        // Generated by FreeCAD (http://www.freecadweb.org/)
        #declare cam_location =  <427.57,263.719,-212.527>;
        #declare cam_look_at  = <59.4051,145.125,-29.1809>;
        #declare cam_sky      = <-0.271638,0.959461,0.0751569>;
        #declare cam_angle    = 45;
        camera {
          location  cam_location
          look_at   cam_look_at
          sky       cam_sky
          angle     cam_angle
          right x*800/600


Any tips would be appreciated!


Post a reply to this message

From: Bald Eagle
Subject: Re: How can I fix surface perfections on my render?
Date: 9 May 2020 20:00:00
Message: <web.5eb743e649257b65fb0b41570@news.povray.org>
"circuit" <nomail@nomail> wrote:

Update to #version 3.8 if at all possible.

>         Antialias_Threshold=0.05

I truly don't know squat about aa settings, but maybe try 0.3 - which seems
standard.


>             // Standard finish
>             #declare StdFinish = finish { crand 0.01 diffuse 0.8 };

Get rid of crand.  _Especially_ if you're doing an animation.
Diffuse seems a bit high, I might be tempted to add a touch of specular
(0.1-0.2), but that's inconsequential to your problem.


>             //default light
>             light_source {
>                 cam_location
>                 color White
>                 area_light <100, 0, 0>, <0, 0, 100>, 10, 10
>                 adaptive 1
>                 jitter
>             }

That seems - excessive?  Especially for a simple render.
And it might have something to do with the weird look.
Just use a standard point light source, and you'll get adequate lighting and
good shadows.

Hard to really say what other potential problems may be without seeing the scene
as a whole.   You can post .pov files in the scene files section if the above
doesn't fix anything.


Post a reply to this message

From: Cousin Ricky
Subject: Re: How can I fix surface perfections on my render?
Date: 9 May 2020 20:47:22
Message: <5eb74f1a$1@news.povray.org>
On 2020-05-09 7:43 PM (-4), circuit wrote:
> Hey all. Just started using POV-Ray with FreeCAD. I'm trying to render a solid
> assembly, and so far have had reasonable success. The issue I'm facing is that
> the output surface has a lot of imperfections around edges. You can see what I
> mean here:
> 
> https://i.imgur.com/jmSYFlA.png

Without seeing the whole scene description file, it's hard to say, but 
the "imperfections" in the image look like radiosity artifacts.  The 
setting Radiosity_Normal uses:
   count 200
   error_bound 0.3
   pretrace_end 0.01

Increasing count will always improve radiosity, but tweaking the other 
settings can often get the job done more efficiently.  A pretrace_end of 
0.01 seemed fine for POV-Ray 3.6, which is what the scene file was 
designed for; but if your POV-Ray installation is 3.7 or later, 0.01 is 
inadequate.  The rad_def.inc settings were not updated in the 3.7 update.

These settings are usually good enough in my experience:
   error_bound 0.5
   pretrace_end 2 / max (image_width, image_height)
   recursion_limit 2

If there are still artifacts, try changing pretrace_end to:
   pretrace_end 1 / max (image_width, image_height)

P.S. As long as your scene file starts with #version 3.6; and uses 
radiosity, all ambients on non-glowing objects should be set to zero. 
If your objects and textures have ambients individually applied, and 
none of your objects glow in the dark, this is easily done with 
global_settings { ambient_light 0 }.  If you do have glowing objects, 
you cannot change the global ambient_light; you must instead use 
#default { finish { ambient 0 } }, and delete or override any ambients 
on non-glowing objects and textures.


Post a reply to this message

From: circuit
Subject: Re: How can I fix surface perfections on my render?
Date: 9 May 2020 23:00:00
Message: <web.5eb76d4d49257b654eff8dd80@news.povray.org>
Thanks for the tips. I made adjustments based on your feedback. I also messed
around with the radiosity settings according to
http://wiki.povray.org/content/HowTo:Use_radiosity and the combination seems to
have done the trick! Here's what I have so far:

https://i.imgur.com/PUAURpc.gifv

I seem to have some issues with the rear spindle flashing when the wheel is
given transparency. How can I prevent this? I'm not sure how to attach files, so
I uploaded one animation frame's .pov content here (I can uploaded all 20 if
needed):

https://pastebin.com/4euSmKWH

Here's the contents of .ini:

Input_File_Name="tester.pov"
Width=1600
Height=1200
Output_Alpha=true
Antialias=On
Antialias_Threshold=0.3
Output_File_Type=N
Initial_Frame=1
Final_Frame=20
Subset_Start_Frame=1
Subset_End_Frame=20

Thanks again!


Post a reply to this message

From: Bald Eagle
Subject: Re: How can I fix surface perfections on my render?
Date: 10 May 2020 08:10:00
Message: <web.5eb7ee7149257b65fb0b41570@news.povray.org>
"circuit" <nomail@nomail> wrote:
I also messed
> around with the radiosity settings according to
> http://wiki.povray.org/content/HowTo:Use_radiosity and the combination seems to
> have done the trick!

Ah yes - Ricky, that was a good catch with the radiosity.   I've seen it before,
but I don't use it often enough, nor as often as I should  ;)


> I seem to have some issues with the rear spindle flashing when the wheel is
> given transparency. How can I prevent this?

It's hard to tell with so few frames, but:
You may be casting a shadow onto that with your 3-armed object.
add no_shadow to whichever part it is
mesh2 {Part39 no_shadow} and see if that fixes it.
or you could add the "shadowless" keyword to your light_source definition and
that won't cast any shadows for anything.
Later, if you want shadows, but don't want THAT shadow, you may have to split
the scene into different "light groups" or something else.

That _looks_ to me like it could be partly the dreaded "coincident surface"
problem.
You need a tiny amount of space (> 0.000001 POV units) between scene elements
otherwise how does the renderer "know" which texture to make the pixel where 2
objects are that occupy the same pixel?  There's some digital/coding/floating
point error that plays into that that needs to be accounted for, thus the 1e-6
value as insurance against it.

I think if you're just adding a transmit value, that should be ok.  If you use
filter instead, then you will get oscillations when the thick and thin parts
move across that back piece.  Twice the thickness = twice the filtering.

Also, for preliminary developmental purposes, you may want to decrease the size
of your renders, say to 640x480 or even 320x240, and then crank up the number of
frames you render to give a much smoother animation.   I'd shoot for at least 15
FPS or above for the final render.


> I'm not sure how to attach files,

The way this whole thing is set up, you need to use one of the sections that
allows attachments.    povray.binaries.images (p.b.i) is the usual spot.
http://news.povray.org/povray.binaries.images/

Typically, the best way to link threads and perhaps shift the discussion over
there is to post the image first, wait for a bit for the server to process the
image, and then go to your post and copy the link and paste it here in your next
post.


It's looking good so far  :)
Are you running windows?
I know that some folks on here are looking for a functioning modeler, as well as
a way to export to .stl for 3D printing, and they may be interested in how to
set up FreeCAD and what its capabilities are.


Post a reply to this message

From: Cousin Ricky
Subject: Re: How can I fix surface perfections on my render?
Date: 10 May 2020 11:11:11
Message: <5eb8198f$1@news.povray.org>
On 2020-05-09 10:56 PM (-4), circuit wrote:
>  I'm not sure how to attach files, so
> I uploaded one animation frame's .pov content here (I can uploaded all 20 if
> needed):

You appear to be using the Web interface, and the Web interface does not 
allow attachments in povray.newusers.  You can post attachments in 
newsgroups with "binaries" in their name, such as 
povray.binaries.scene-files and povray.binaries.images.  A newsreader 
app can post attachments to any newsgroup, but that is considered bad 
netiquette.


Post a reply to this message

From: Alain Martel
Subject: Re: How can I fix surface perfections on my render?
Date: 10 May 2020 12:18:48
Message: <5eb82968$1@news.povray.org>
Le 2020-05-09 à 19:59, Bald Eagle a écrit :
> 
> "circuit" <nomail@nomail> wrote:
> 
> Update to #version 3.8 if at all possible.
> 
>>          Antialias_Threshold=0.05
> 
> I truly don't know squat about aa settings, but maybe try 0.3 - which seems
> standard.

That antialias setting is ok for final renders. A good compromise would 
be something like 0.1.

> 
> 
>>              // Standard finish
>>              #declare StdFinish = finish { crand 0.01 diffuse 0.8 };
> 
> Get rid of crand.  _Especially_ if you're doing an animation.
> Diffuse seems a bit high, I might be tempted to add a touch of specular
> (0.1-0.2), but that's inconsequential to your problem.

I agree.

> 
> 
>>              //default light
>>              light_source {
>>                  cam_location
>>                  color White
>>                  area_light <100, 0, 0>, <0, 0, 100>, 10, 10
>>                  adaptive 1
>>                  jitter
>>              }
> 
> That seems - excessive?  Especially for a simple render.
> And it might have something to do with the weird look.
> Just use a standard point light source, and you'll get adequate lighting and
> good shadows.

Yes, should use adaptive 0

> 
> Hard to really say what other potential problems may be without seeing the scene
> as a whole.   You can post .pov files in the scene files section if the above
> doesn't fix anything.
> 
> 
>


Post a reply to this message

From: Alain Martel
Subject: Re: How can I fix surface perfections on my render?
Date: 10 May 2020 12:29:08
Message: <5eb82bd4$1@news.povray.org>
Le 2020-05-09 à 20:47, Cousin Ricky a écrit :
> On 2020-05-09 7:43 PM (-4), circuit wrote:
>> Hey all. Just started using POV-Ray with FreeCAD. I'm trying to render 
>> a solid
>> assembly, and so far have had reasonable success. The issue I'm facing 
>> is that
>> the output surface has a lot of imperfections around edges. You can 
>> see what I
>> mean here:
>>
>> https://i.imgur.com/jmSYFlA.png
> 
> Without seeing the whole scene description file, it's hard to say, but 
> the "imperfections" in the image look like radiosity artifacts.  The 
> setting Radiosity_Normal uses:
>    count 200
>    error_bound 0.3
>    pretrace_end 0.01
> 
> Increasing count will always improve radiosity, but tweaking the other 
> settings can often get the job done more efficiently.  A pretrace_end of 
> 0.01 seemed fine for POV-Ray 3.6, which is what the scene file was 
> designed for; but if your POV-Ray installation is 3.7 or later, 0.01 is 
> inadequate.  The rad_def.inc settings were not updated in the 3.7 update.

They where not even updated for version 3.5, only the version directive 
got updated. They are based on early 3.3, or maybe even older.
That include is in desperate need of a complete overhaul.
Before version 3.5, low_error_factor defaulted to 0.8. Starting with 
version 3.5, the default low_error_factor is 0.5. red_def.inc use that 
old 0.8 value as a base.

> 
> These settings are usually good enough in my experience:
>    error_bound 0.5
>    pretrace_end 2 / max (image_width, image_height)
>    recursion_limit 2
> 
> If there are still artifacts, try changing pretrace_end to:
>    pretrace_end 1 / max (image_width, image_height)
> 
> P.S. As long as your scene file starts with #version 3.6; and uses 
> radiosity, all ambients on non-glowing objects should be set to zero. If 
> your objects and textures have ambients individually applied, and none 
> of your objects glow in the dark, this is easily done with 
> global_settings { ambient_light 0 }.  If you do have glowing objects, 
> you cannot change the global ambient_light; you must instead use 
> #default { finish { ambient 0 } }, and delete or override any ambients 
> on non-glowing objects and textures.
> 

With version 3.7 and later, there is no need to set ambient to zero as 
all ambient become zero when radiosity is used.
You need to use emission for glowing objects.


Post a reply to this message

From: Cousin Ricky
Subject: Re: How can I fix surface perfections on my render?
Date: 10 May 2020 13:09:58
Message: <5eb83566@news.povray.org>
On 2020-05-10 12:18 PM (-4), Alain Martel wrote:
> Le 2020-05-09 à 19:59, Bald Eagle a écrit :
>>
>>>              //default light
>>>              light_source {
>>>                  cam_location
>>>                  color White
>>>                  area_light <100, 0, 0>, <0, 0, 100>, 10, 10
>>>                  adaptive 1
>>>                  jitter
>>>              }
>>
>> That seems - excessive?  Especially for a simple render.
>> And it might have something to do with the weird look.
>> Just use a standard point light source, and you'll get adequate 
>> lighting and
>> good shadows.
> 
> Yes, should use adaptive 0

That depends on the scene.  I've had some scenes for which adaptive 0 
was fine, and others for which the result was hideous.


Post a reply to this message

From: circuit
Subject: Re: How can I fix surface perfections on my render?
Date: 11 May 2020 03:20:01
Message: <web.5eb8fc1849257b654eff8dd80@news.povray.org>
Wow, this community is awesome. I appreciate all the responses.

> That _looks_ to me like it could be partly the dreaded "coincident surface"
> problem.
> You need a tiny amount of space (> 0.000001 POV units) between scene elements
> otherwise how does the renderer "know" which texture to make the pixel where 2
> objects are that occupy the same pixel?  There's some digital/coding/floating
> point error that plays into that that needs to be accounted for, thus the 1e-6
> value as insurance against it.

100% sure it's a coincident surface issue. In fact, similar artifacting also
exists in FreeCAD's rendered output. Here's an animation using FreeCAD
"activeView":

https://i.imgur.com/zljJarj.gifv

This is actually not my model... it's just the first demo file I found online
that had assembly constraints, so I ran with it. I have no idea if it was
designed properly. I plan on testing this out more thoroughly with a model I
build myself.

> Also, for preliminary developmental purposes, you may want to decrease the size
> of your renders, say to 640x480 or even 320x240, and then crank up the number of
> frames you render to give a much smoother animation.   I'd shoot for at least 15
> FPS or above for the final render.

For sure. Here's a smoother animation! This time at 20 fps:

https://i.imgur.com/6c3mLUn.gifv

It's definitely a lot quicker to render this way. I took me around 2 minutes for
the 50 frames on my i5 laptop.

> It's looking good so far  :)
> Are you running windows?
> I know that some folks on here are looking for a functioning modeler, as well as
> a way to export to .stl for 3D printing, and they may be interested in how to
> set up FreeCAD and what its capabilities are.

I am on Windows, yup, although I've played around with a few Linux distros in
the past :) I'm by no means a modeller though. I come from an electrical
background, but I have a strong interest in robotics. My plan is to use FreeCAD
to design and simulate (animate) robotic gait. Then of course, once I'm happy,
I'll 3D print the end result. POV-Ray just makes the animation quite a bit
nicer.

From my limited exposure, I'm really liking FreeCAD. I've used Fusion 3D and
Solidworks in the past, and sure, FreeCAD is not quite as polished, but it one
really great thing going for it: Python scripting. The possibilities are
limitless. Other than that, FreeCAD seems to be just as capable as the others
(but once again, I'm not a power user).

I'm happy to help provide guidance if other wants to delve into the tool.

> Yes, should use adaptive 0

I like output a lot better with this change. Edges are better defined.

Cheers everyone.


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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