POV-Ray : Newsgroups : povray.general : Patch idea Server Time
4 Aug 2024 02:18:02 EDT (-0400)
  Patch idea (Message 1 to 9 of 9)  
From: Micheal (Mike) Williams
Subject: Patch idea
Date: 26 Aug 2003 00:40:52
Message: <3f4ae4d4$1@news.povray.org>
For anyone who plays with the povray source:

I have been toying with an idea. All objects in real life have a thickness
to them. The metal of a car is thick enough that we can see it rounded at
the edges. The idea is to treat triangles as though they have a thickness.
Rather than the ray calculated to strike the triangle it is calculated at a
point near the triangle. I was kind of thanking that this is how it worked
anyway. The ray is incremented at a constant value. The triangle strike
point might just lay between he ray steps. I would be guessing but is it not
already calculated on the assumption of when it got with in a step of the
triangle. Am I wrong here? In any case the idea that came out of my feeble
try at understanding retracing was to make the triangle thick some how. The
thickness could be a setting with in the triangle command. The edge could be
calculated by blending from a norm parallel to the triangle and the norm of
the triangle. I know I am talking as if it is simple but I do understand the
programming might be complicated.
Any one interested? If you are take it and run. I will be glad to use it.

--
Mike Williams


IBO#770070
www.quixtar.com
www.espring.com
www.nutrilite.com
www.blionline.com


Post a reply to this message

From: Hugo Asm
Subject: Re: Patch idea
Date: 26 Aug 2003 03:40:33
Message: <3f4b0ef1@news.povray.org>
> I will be glad to use it.

Sounds interesting but what would you use it for? Meshes can have a well
defined interior if there are triangles "on both sides", so to say.

Regards,
Hugo


Post a reply to this message

From: ABX
Subject: Re: Patch idea
Date: 26 Aug 2003 06:27:54
Message: <tjcmkvk7j6jg2c3nqhc3fi9lm2pvb5roc7@4ax.com>
On Mon, 25 Aug 2003 23:44:57 -0500, "Micheal \(Mike\) Williams"
<mic### [at] quixnetnet> wrote:
> I have been toying with an idea. All objects in real life have a thickness
> to them. The metal of a car is thick enough that we can see it rounded at
> the edges. The idea is to treat triangles as though they have a thickness.

Such patch exist as internal function and is included in MegaPOV 1.0. It is
also available without patching as written in SDL function within IsoCSG
library. I made with it several meshes like f_teapot, see:
http://news.povray.org/povray.binaries.images/29800/. See:
http://abx.art.pl/pov/patches/f_triangle.php . Every optimization with faster
calculations is welcome.

ABX


Post a reply to this message

From: Warp
Subject: Re: Patch idea
Date: 26 Aug 2003 07:19:11
Message: <3f4b422f@news.povray.org>
"Micheal \(Mike\) Williams" <mic### [at] quixnetnet> wrote:
> I have been toying with an idea. All objects in real life have a thickness
> to them. The metal of a car is thick enough that we can see it rounded at
> the edges. The idea is to treat triangles as though they have a thickness.

  Why? What would be the advantage of this?

> The ray is incremented at a constant value. The triangle strike
> point might just lay between he ray steps.

  No, in raytracing rays are not incremented by steps (that would be
awfully slow anyways).
  The intersection of a ray with a surface is calculated mathematically.
For example, when you want to get the intersection of a ray and a sphere
you take the function of a line representing the ray and the function
of the spherical surface, make them equal and solve where they get the
same value. See http://povray.org/documentation/view/116/ for an
example implementation of this.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Warp
Subject: Re: Patch idea
Date: 26 Aug 2003 07:20:20
Message: <3f4b4274@news.povray.org>
ABX <abx### [at] abxartpl> wrote:
> On Mon, 25 Aug 2003 23:44:57 -0500, "Micheal \(Mike\) Williams"
> <mic### [at] quixnetnet> wrote:
>> I have been toying with an idea. All objects in real life have a thickness
>> to them. The metal of a car is thick enough that we can see it rounded at
>> the edges. The idea is to treat triangles as though they have a thickness.

> Such patch exist as internal function and is included in MegaPOV 1.0. It is
> also available without patching as written in SDL function within IsoCSG
> library.

  I don't understand how creating an isosurface from a mesh adds thickness
to the triangles.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: ABX
Subject: Re: Patch idea
Date: 26 Aug 2003 08:02:55
Message: <1cimkvcsi4j1006e556tnjevf2s6ups42f@4ax.com>
On 26 Aug 2003 07:20:20 -0400, Warp <war### [at] tagpovrayorg> wrote:
> I don't understand how creating an isosurface from a mesh adds thickness
> to the triangles.

Tenth parameter of f_triangle is Thickness.
http://megapov.inetart.net/manual/expressions.html#f_triangle
Translating this f_function into macro with the same input parameters it could
be represented as CSG

#macro CSG_triangle(V1x,V1y,V1z,V2x,V2y,V2z,V3x,V3y,V3z,Thickness)
  #local V1 = <V1x,V1y,V1z>;
  #local V2 = <V2x,V2y,V2z>;
  #local V3 = <V3x,V3y,V3z>;
  #local R = Thickness;
  merge{
    cylinder{ V1 V2 R }
    cylinder{ V2 V3 R }
    cylinder{ V3 V1 R }
    sphere{ V1 R }
    sphere{ V2 R }
    sphere{ V3 R }
    prism{ // created and oriented to fill space between edges
      ...
      transform ...
    }
  }
#end

ABX


Post a reply to this message

From: Micheal (Mike) Williams
Subject: Re: Patch idea
Date: 26 Aug 2003 22:07:52
Message: <3f4c1278@news.povray.org>
Ok now I see. So it is not really tracing the ray but calculating the angles
and intersection points? I gather that this method is fast but also make the
math for radiosity hard. It also explains why media effects slow rendering
down tremendously.

As for why, To make a paper cup which is rather thin but not flat I would
have to model both the inside and out to create the thickness. That is a lot
of surfaces. And the edges still need to be beveled some how to create the
real highlight on the top rim. If the triangles could be rendered as though
they have a thickness then only the shape of the cup would need to be
rendered. The edges would naturally round over to the inside of the cup. It
would be more like the triangle only describe the center planes of the
object. It would be like using the triangle as a blob component where common
edges of each triangle would not be combined.

One of the hardest things I have tried to model is the smooth edges of
objects. Even a piece of paper bounces light off the very edges to show a
small but visible highlight. Basically I am looking for a short cut to
modeling true rounded edges. The real world does not have true sharp edges.
Now I know some are small enough to never be seen but our brains can and do
pick up these little missing parts. It is why indirect illumination is in
such use now. Trying for the most real looking images.

Take this as an artist trying to create the perfect image. Not as a
programmer and mathematician deriving algorithms.

Again thanks for that very good explanation.

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3f4b422f@news.povray.org...
> "Micheal \(Mike\) Williams" <mic### [at] quixnetnet> wrote:
> > I have been toying with an idea. All objects in real life have a
thickness
> > to them. The metal of a car is thick enough that we can see it rounded
at
> > the edges. The idea is to treat triangles as though they have a
thickness.
>
>   Why? What would be the advantage of this?
>
> > The ray is incremented at a constant value. The triangle strike
> > point might just lay between he ray steps.
>
>   No, in raytracing rays are not incremented by steps (that would be
> awfully slow anyways).
>   The intersection of a ray with a surface is calculated mathematically.
> For example, when you want to get the intersection of a ray and a sphere
> you take the function of a line representing the ray and the function
> of the spherical surface, make them equal and solve where they get the
> same value. See http://povray.org/documentation/view/116/ for an
> example implementation of this.
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Patch idea
Date: 27 Aug 2003 00:02:11
Message: <cjameshuff-A79A4F.00021127082003@netplex.aussie.org>
In article <3f4c1278@news.povray.org>,
 "Micheal \(Mike\) Williams" <mic### [at] quixnetnet> wrote:

> Ok now I see. So it is not really tracing the ray but calculating the angles
> and intersection points?

It is tracing the ray by calculating the intersection points. (actually, 
you generally compute the intersection distance along the ray, and use 
that to compute the point)
What you are thinking of is usually called ray marching. Isosurfaces are 
solved this way, which is why they are so slow compared to other shapes.


> I gather that this method is fast but also make the math for radiosity hard.

It does not affect the math for radiosity. Radiosity does not care how 
intersections are found.


> It also explains why media effects slow rendering down tremendously.

Yes...media is done by marching the ray through the media, sampling it 
at various points along the ray. Solving it analytically would be 
faster, but far more limited.


> As for why, To make a paper cup which is rather thin but not flat I would
> have to model both the inside and out to create the thickness. That is a lot
> of surfaces. And the edges still need to be beveled some how to create the
> real highlight on the top rim. If the triangles could be rendered as though
> they have a thickness then only the shape of the cup would need to be
> rendered. The edges would naturally round over to the inside of the cup. It
> would be more like the triangle only describe the center planes of the
> object. It would be like using the triangle as a blob component where common
> edges of each triangle would not be combined.

You could simply use a macro that generates multiple triangles, 8 for 
each input triangle, arranged to make a triangular prism. This would be 
highly inefficient, better to just model the entire surface of the cup.


> Now I know some are small enough to never be seen but our brains can and do
> pick up these little missing parts. It is why indirect illumination is in
> such use now. Trying for the most real looking images.

They are also small enough that the detail will probably never show up 
in the rendering. Even a digitized photo would hide a lot of details you 
can see with the naked eye.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Patch idea
Date: 27 Aug 2003 08:42:25
Message: <3f4ca731@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
>> It also explains why media effects slow rendering down tremendously.

> Yes...media is done by marching the ray through the media, sampling it 
> at various points along the ray. Solving it analytically would be 
> faster, but far more limited.

  Fog in POV-Ray is calculated analytically (instead of ray-marching).
We all know how more limited fog is compared to media (and how faster as
well)...

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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