|
|
On 10/1/19 10:18 AM, IGM wrote:
> Your comment about ray subdivision and stepping led me to think of a first
> approximation to the problem: any object could be subdivided in a certain amount
> of small volumes (cubes? 3D voronoi cells?), each with different ior; something
> similar to FEM analysis. With small enough cells, or small enough ior
> differences, focal_blur could help giving continuity to the whole object. This
> approach can be done without adding new features to povray. User has the
> freedom to choose the right cells dimensions (ie.e degree of approximation) for
> his specific scene.
My mind keeps drifting back to this...
Maybe what you outline couple be a part of some tooling for what you
want. Might be better though to have some interpolation between the
values on the IOR value representation side rather than "smoothing"
after. Better too if the IOR value samples sparse - I'm thinking of a
question years ago on how to represent point charge and equal-potential
regions - a kind of voronoi cell structure but something which
potentially could adjust the number of surfaces. Even better if the IOR
representation doesn't need to be representative values but rather as
simpler gradients / more flexible functions. I think any approach is
going to be inaccurate to a degree no matter what.
Thinking too an isosurface based upon functions a path to representing
many surfaces no requiring they all exist prior. If it can be sorted
might be able to also change the density of refractive surfaces based
upon whether locally the ior is changing much. Surfaces aside we need
some ability to represent the IORs at the surface variably - something
set on each intersection.
Had the thought during the past days that, given you want tracing
through complicated IOR distributions, just stepping short rays in one
direction probably not enough. With distributions - rippling waves of
heat off objects or whatever - it likely happens light rays/paths wander
all over and sometimes locally converge / run over each other in ways
phase and interference matters. In other words, at the camera you don't
really know what light rays from the shape will land on the screen so to
speak. To capture that would require reverse tracing from the shape(s)
you want to 'see' through the IOR distribution without knowledge of
whether of those rays matter to the resultant image in the end.
>
>> In other words, interiors (and so IORs)
>> would be specified by containing shapes (or by patterns/functions)
>> different from those defining the surface intersections. The aim being
>> better ways to define things like a glass full of juice without the
>> coincident surface / surface ordering issues that we fight today.
>
> I'm not a C programmer, and therefore (unfortunately) I cannot help in the deep
> povray development. However, I'm an optical designer, and I work with Zemax
> OpticStudio. In Zemax, the "coincident surface / surface ordering issues" is
> solved in this way: any time two surfaces are coincident, the properties
> governing the scene are those of the surface defined for *last*. I don't know if
> this could help...
Suppose my initial thought is no, but maybe I don't understand what
Zemax is really doing with ordering from what you said.
In a ray tracer the direction of rays is well defined, but not with
respect to any global scene direction. With a glass of juice I have a
shape for the container and a shape shape for the juice. Suppose I
define a glass -> juice shape order by time defined, an assigned numeric
priority or by position relative to some otherwise defined scene direction.
A ray entering in a glass to juice direction gets sorted properly
because I set a glass -> juice ordering. What happens on the other side
of the glass? I need there a juice -> glass ordering. What happens for
rays coming in from the top of my drink where again I need a juice ->
glass ordering. What about internally reflected rays to the juice or
glass IOR?
I can envision 'complicated' book keeping somehow sorting out when to
flip the user orders at each intersection, but such an approach seems
very messy. Especially given that we have, already, numerical issues at
truly coincident surfaces that require we roll up multiple intersections
within some numerical tolerance before applying any kind of defined use
order to the collection of intersections.
With opaque surfaces, defining some order perhaps hard sets what
textures we get on coincidence surfaces - always one over the other no
matter ray direction. With any transparency, it looks complicated to me
- user definable ordering or not.
Zemax I suppose handles these complications. Or maybe there is internal
detail not understood/described. Or maybe I just don't see how a defined
order simplifies things(1a)?
---
What I'd like to get to is interior handling that is not ambiguous in
any way and something which prevents interior overlap(1).
Something which looks for the ior/interior behind and forward of any
'surface only' intersection along with intersections - naturally -
rolling up 'interior only' shapes for inside tests slightly ahead of and
behind the surface intersection defining the IORs at the interface.
Today inside POV-Ray we carry this stack of interiors and track all the
entering and exiting of interiors as the ray moves from surface to
surface. It's messy. It's numerically error prone. It's what causes some
of the bright and dark speckling in images.
FYI. I'm not much of a c++ programmer which hinders my sandbox play.
Anyway! Thinking about your desired feature alongside changes I've
thought some about myself is interesting.
Bill P.
(1) - As collected by the local set of intersections at any given
surface(1a). With any change to interior handling we should also limit
interior shape intersection depths to what is numerically stable. A near
tangent edges of curved surfaces and the interiors would cease to be
seen where the intersection to intersection depths too close.
(1a) - To represent a bubble inside the juice we would, for example,
have one sphere for the surface/change in ior. Two spheres defining the
interiors - in this case probably duplicates of the surface intersection
sphere where one inverted. And, backing off an earlier, peripheral lie,
defined interiors would have a priority order to - sometimes - simplify
the needed interior containing shapes. Bubbles in juice abutting the
glass surface for example.
Post a reply to this message
|
|