POV-Ray : Newsgroups : povray.binaries.images : Crevice grime : Re: Crevice grime Server Time
31 Jul 2024 00:25:20 EDT (-0400)
  Re: Crevice grime  
From: Trevor G Quayle
Date: 17 Mar 2011 11:05:00
Message: <web.4d82220c50dd01dd81c811d20@news.povray.org>
Had a look at addressing the issue I was having with shallow angles picking up
ridges.  I did some testing and found that this is a result of how trace works
(on smooth meshes in particular).  The intersection returned is the intersection
with the flat, unsmoothed surface of the mesh (unperturbed), whereas the surface
normal returned is based on the smoothed surface normal at the point.  What
happens is that very shallow traces end up intersecting with the mesh in some
locations, particularly close to triangle edges.

I thought of several solutions to avoid this:

1) have the trace function return the perturbed intersection point, not the
triangle surface:  this would have to be done in the POV source.  I imagine this
is difficult if not nearly impossible, hence we still get the shadow line issue
with meshes. Not likely solution at present.

2) have the trace function return the unperturbed normal at the intersection:
again this would have to be done in the POV source and would be much simpler, if
not trivial to do compared to 1.  However this would change the way trace works
and, in most situations, may not be desirable, and could break older scenes.
Not likely solution.

3) manual method of 2), have two instances of the mesh used, one smoothed, one
not. the smoothed one gets used for rendering, the unsmoothed for tracing:  Not
an elegant solution as it requires creating and loading two separate instances
of the same mesh.

4) similar to 3), but have encoded in mesh objects and additional "unsmooth"
keyword that would allow for the mesh smoothing to be ignored for certain
circumstances:  Again, this would require POV source coding, but may be simple
to do from a coding perspective without breaking old scenes.  However, not
likely a curren t solution unless I want to get into source coding.

5) manual method of 1), this is not strictly equivalent to 1, but basically
manually set an offset value to start the traces from.  Essentially the initial
trace sets the intersection point and grabs the surface normal, but the
subsequent grime traces start from a point just off the surface: Very simple
flexible solution from the user standpoint as testing can be done to find the
optimal offset to use, doesn't require internal coding of trace handling.

Following my simple solution #5, I added this capability into my current macro
with good results.  See the attached image.   For reference, the model is 200
units high, normal angle set to 85, control depth set to 20.  The first image is
run with no offset.  Distinct artifacts and mesh lines can be seen, particularly
the lines along the body and legs.  The second image uses the same parameters
but with a offset of 0.1 with fairly favourable results.

-tgq


Post a reply to this message


Attachments:
Download 'trace2.jpg' (166 KB)

Preview of image 'trace2.jpg'
trace2.jpg


 

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