POV-Ray : Newsgroups : povray.general : Displacement via Isosurface Server Time
29 Nov 2024 05:45:26 EST (-0500)
  Displacement via Isosurface (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: McHannemann
Subject: Displacement via Isosurface
Date: 14 Apr 2006 11:00:00
Message: <web.443fb7d16cb37305ccef821a0@news.povray.org>
Hello everyone,

I have a question:
I would like to do the following,
I have a Mesh with a displacement map(UV-Mapped in Z-Brush),
I want to use it with the mesh as a isosurface and the texture
as function, how is it done?

#declare disp = function{
 image_map { BITMAP_TYPE "displacement map.bmp")
 }

#declare dispiso =
 isosurface{
  function{
   mesh(x,y,z) - disp(x,y,z).grey)
  }
 }

is a starting idea?



Thnx

Thor


Post a reply to this message

From: Anthony D  Baye
Subject: Re: Displacement via Isosurface
Date: 14 Apr 2006 14:04:51
Message: <443fe443$1@news.povray.org>
McHannemann wrote:
> Hello everyone,
> 
> I have a question:
> I would like to do the following,
> I have a Mesh with a displacement map(UV-Mapped in Z-Brush),
> I want to use it with the mesh as a isosurface and the texture
> as function, how is it done?
> 
> #declare disp = function{
>  image_map { BITMAP_TYPE "displacement map.bmp")
>  }
> 
> #declare dispiso =
>  isosurface{
>   function{
>    mesh(x,y,z) - disp(x,y,z).grey)
>   }
>  }
> 
> is a starting idea?
> 

> 
> Thnx
> 
> Thor
> 
> 
> 
The only way I can think of is to use the object pattern.
f/ex.

#declare disp =
function {
    pigment {
       image_map {
          bmp "displacement_map.bmp"
          map_type 0
          interpolate 0
          once
          }
       }
  }

#declare dispiso =
function {
    pattern {
       object { yourmeshobject }
       }
    }


isosurface {
    function { dispiso(x,y,z) - disp(x,y,z).red }
    max_gradient 10
    threshold 0
    contained_by { box { -obj_max_extent, obj_max_extent } }
    }

This is where I'd start.

Regards,

ADB


Post a reply to this message

From: Christoph Hormann
Subject: Re: Displacement via Isosurface
Date: 14 Apr 2006 14:45:03
Message: <e1oqg3$3mk$1@chho.imagico.de>
McHannemann wrote:
> Hello everyone,
> 
> I have a question:
> I would like to do the following,
> I have a Mesh with a displacement map(UV-Mapped in Z-Brush),
> I want to use it with the mesh as a isosurface and the texture
> as function, how is it done?

You are mixing things up here.  A mesh is a geometry made of small 
planar facets.  An isosurface is a geometry defined by an implicit 
function.  There is no reasonable way of these getting together.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 14 Mar. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Jim Charter
Subject: Re: Displacement via Isosurface
Date: 14 Apr 2006 15:52:05
Message: <443ffd65$1@news.povray.org>
Anthony D. Baye wrote:
> McHannemann wrote:
> 
>> Hello everyone,
>>
>> I have a question:
>> I would like to do the following,
>> I have a Mesh with a displacement map(UV-Mapped in Z-Brush),
>> I want to use it with the mesh as a isosurface and the texture
>> as function, how is it done?
>>
>> #declare disp = function{
>>  image_map { BITMAP_TYPE "displacement map.bmp")
>>  }
>>
>> #declare dispiso =
>>  isosurface{
>>   function{
>>    mesh(x,y,z) - disp(x,y,z).grey)
>>   }
>>  }
>>
>> is a starting idea?
>>

>>
>> Thnx
>>
>> Thor
>>
>>
>>
> The only way I can think of is to use the object pattern.
> f/ex.
> 
> #declare disp =
> function {
>    pigment {
>       image_map {
>          bmp "displacement_map.bmp"
>          map_type 0
>          interpolate 0
>          once
>          }
>       }
>  }
> 
> #declare dispiso =
> function {
>    pattern {
>       object { yourmeshobject }
>       }
>    }
> 
> 
> isosurface {
>    function { dispiso(x,y,z) - disp(x,y,z).red }
>    max_gradient 10
>    threshold 0
>    contained_by { box { -obj_max_extent, obj_max_extent } }
>    }
> 
> This is where I'd start.
> 
> Regards,
> 
> ADB
http://www.econym.demon.co.uk/isotut/dont.htm


Post a reply to this message

From: Mike Williams
Subject: Re: Displacement via Isosurface
Date: 14 Apr 2006 16:06:51
Message: <B3vTiOADDAQEFwI4@econym.demon.co.uk>
Wasn't it Anthony D. Baye who wrote:

>The only way I can think of is to use the object pattern.
>f/ex.

That technique comes top of the list in the "Things That Don't Work"
section in my isosurface tutorial.
http://www.econym.demon.co.uk/isotut/dont.htm

Unfortunately, any path through the isosurface encounters a point where
the value jumps instantly from 0 to 1, so the actual max_gradient of
every point on the surface is infinite. Instead of getting a few nasty
little holes in our nice isosurface, we get a few tiny patches of
surface and the rest is hole, unless very extreme values of max_gradient
are used (and then it takes ages).

Also, the idea of adding a displacement function to the surface doesn't
work quite like what you'd intuitively expect. Adding a function to the
object pattern function gives one region of space where the function
evaluates to 1.0+displacement and in the rest of space it evaluates to
0.0+displacenent. 

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Warp
Subject: Re: Displacement via Isosurface
Date: 14 Apr 2006 16:51:02
Message: <44400b36@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> >The only way I can think of is to use the object pattern.
> >f/ex.

> That technique comes top of the list in the "Things That Don't Work"
> section in my isosurface tutorial.
> http://www.econym.demon.co.uk/isotut/dont.htm

  If objects had a proximity function, ie. a function which tells from
a point its closest distance to the surface of the object, it would then
be possible.

  A fast proximity function would indeed be the holy grail of raytracing.
Unfortunately no such thing is known to exist in the generic case (special
cases for certain primitives can naturally be made, but there's no
generic solution which would work with all objects).

  An approximating generic proximity function could be made by using a
sampling algorithm, but this is really slow, especially if the function
is then used in a (perturbed) isosurface.

-- 
                                                          - Warp


Post a reply to this message

From: McHannemann
Subject: Re: Displacement via Isosurface
Date: 15 Apr 2006 01:25:00
Message: <web.444082f9d9d74d17ccef821a0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Mike Williams <nos### [at] econymdemoncouk> wrote:
> > >The only way I can think of is to use the object pattern.
> > >f/ex.
>
> > That technique comes top of the list in the "Things That Don't Work"
> > section in my isosurface tutorial.
> > http://www.econym.demon.co.uk/isotut/dont.htm
>
>   If objects had a proximity function, ie. a function which tells from
> a point its closest distance to the surface of the object, it would then
> be possible.
>
>   A fast proximity function would indeed be the holy grail of raytracing.
> Unfortunately no such thing is known to exist in the generic case (special
> cases for certain primitives can naturally be made, but there's no
> generic solution which would work with all objects).
>
>   An approximating generic proximity function could be made by using a
> sampling algorithm, but this is really slow, especially if the function
> is then used in a (perturbed) isosurface.
>
> --
>                                                           - Warp

ok....grrr
so how do I displace then the mesh?
If I would import the mesh with displacement as polys
I would have 2.5 mil polys only for that......
is there any other option???
Displacement on Meshes is a very important feature to me,
so maybe there can be something done about it,
even the old renderman engines are able to get along with it.
REgards,
THor


Post a reply to this message

From: Warp
Subject: Re: Displacement via Isosurface
Date: 15 Apr 2006 07:04:05
Message: <4440d324@news.povray.org>
McHannemann <nomail@nomail> wrote:
> so how do I displace then the mesh?

  If you can't subdivide&displace the mesh in the program which created
the mesh, and all you have is a SDL 'mesh' or 'mesh2', then you can't
*directly* do neither thing in POV-Ray.

  You could, however, convert the mesh to the PCM format
(http://www.geocities.com/ccolefax/pcm.html) and then use the surface
subdivision suite (http://www.geocities.com/evilsnack/nsss.htm)
for subdividing&displacing.

  (Note that the PCM program only supports the mesh format as input.
I have a beta version for windows which supports mesh2, but the macros
have yet not been updated for it.)

> Displacement on Meshes is a very important feature to me,
> so maybe there can be something done about it,
> even the old renderman engines are able to get along with it.

  POV-Ray does not (yet) support on-the-fly subdivision&displacement
of meshes like renderman does, sorry.

-- 
                                                          - Warp


Post a reply to this message

From: Jim Charter
Subject: Re: Displacement via Isosurface
Date: 15 Apr 2006 09:29:42
Message: <4440f546$1@news.povray.org>
McHannemann wrote:

> ok....grrr
> so how do I displace then the mesh?
> If I would import the mesh with displacement as polys
> I would have 2.5 mil polys only for that......

Pretty much the only option if using POV natively

> is there any other option???

PoseRay supports some displacement options.

http://mysite.verizon.net/sfg0000/


Post a reply to this message

From: ingo
Subject: Re: Displacement via Isosurface
Date: 15 Apr 2006 10:54:42
Message: <Xns97A6AC08D24E9seed7@news.povray.org>
in news:web.443fb7d16cb37305ccef821a0@news.povray.org McHannemann wrote:

> is a starting idea?
> 

as the others already explained this won't work. But there may be an 
alternative route, not an easy one though:

from your mesh create a density file, use that for the isosurface and 
apply the displacement funtion.

Creating the density file can be done by intersecting a "solid" mesh 
(inside_vector) with a thin box. Move the box through the object and put 
all the resulting images into a density file. Now the difficult part 
comes, you'll have to blurr the density file. There are some applications 
for medical visualisation that can be of help here. Maybe the blurring of 
the induvidual slices ie enough and you can use any image editor. The 
total process will be slow and to get some quality/resolution the files 
will be huge.

Ingo


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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