POV-Ray : Newsgroups : povray.general : Mapping Textures on irregular shapes Server Time
5 May 2024 15:29:32 EDT (-0400)
  Mapping Textures on irregular shapes (Message 21 to 30 of 47)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 29 Apr 2020 02:50:00
Message: <web.5ea9230a72e01857dc1270cd0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
> Op 26/04/2020 om 23:45 schreef Josh:
> > 2) I also like how you can create df3 files and use them as a function from the
> > warp example. Is there any 3d modelers that can export df3? Are there other
> > programs/ways to create simple df3 files of simple shapes?
> >
>
> You may be interesting in:
> https://www.oyonale.com/modeles.php?lang=en&page=36
>
> --
> Thomas

Yes, that is beautiful and probably can be modified to do what I am looking for.
Thanks!


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 29 Apr 2020 03:10:01
Message: <web.5ea9274e72e01857dc1270cd0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Josh" <nomail@nomail> wrote:
> > ...
> > 2) I also like how you can create df3 files and use them as a function from the
> > warp example. Is there any 3d modelers that can export df3? Are there other
> > programs/ways to create simple df3 files of simple shapes?
>
> if you're using some Linux, there's the 'df3 tools':
>
> <http://news.povray.org/web.5b43d8aa43fdfea9635cc5ad0%40news.povray.org>
>
>
> regards, jr.

Thanks! Definitely worth playing with.

I'm not sure if proper etiquette here would be to start a new post, but since
it's still on the same basic subject, I'll just continue...

How do I align a pigment with a normal? Say I have an isosurface that I want to
apply an agate normal to, but also an agate pigment_map that matches perfectly,
so that I can color just the 'valleys' of the normal map? Does that make sense?
It almost looks like it matches, but when I render one time with just the
pigment_map and one time with just the normal, I don't think they are the same
pattern.

Josh

isosurface
{
....

  texture
  {
    pigment
    {
      agate
      pigment_map
      {
        [0.00 rgb <0,1,.7>]
        [0.02 rgb <0,.3,.1>]
 [0.15 rgb <0,0,0>]
      }
      scale 0.2
    }

    normal
    {
      agate .5
      scale .2
    }
  }
}


Post a reply to this message

From: Thomas de Groot
Subject: Re: Mapping Textures on irregular shapes
Date: 29 Apr 2020 03:12:05
Message: <5ea928c5$1@news.povray.org>
Op 29/04/2020 om 08:47 schreef Josh:
> Thomas de Groot <tho### [at] degrootorg> wrote:
>> Op 26/04/2020 om 23:45 schreef Josh:
>>> 2) I also like how you can create df3 files and use them as a function from the
>>> warp example. Is there any 3d modelers that can export df3? Are there other
>>> programs/ways to create simple df3 files of simple shapes?
>>>
>>
>> You may be interesting in:
>> https://www.oyonale.com/modeles.php?lang=en&page=36
>>
>> --
>> Thomas
> 
> Yes, that is beautiful and probably can be modified to do what I am looking for.
> Thanks!
> 
> 
You certainly can! I did some exploration along that line back in 2013. 
In the newsgroups, look for my name and 'df3'. There are different 
discussions.

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Mapping Textures on irregular shapes
Date: 29 Apr 2020 07:05:00
Message: <web.5ea95e8672e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> How do I align a pigment with a normal? Say I have an isosurface that I want to
> apply an agate normal to, but also an agate pigment_map that matches perfectly,
> so that I can color just the 'valleys' of the normal map? Does that make sense?
> It almost looks like it matches, but when I render one time with just the
> pigment_map and one time with just the normal, I don't think they are the same
> pattern.

Looks like you're doing it right.
Might just be the the way the light strikes it, or the way the eyes are more
sensitive to the finer changes in colors of the pigment map vs the effect of the
normal.

Notice I did pigment and normal and THEN scaled (easier to keep track of, and
ensures they're exactly the same)

Maybe play around with the bump_size.

http://www.povray.org/documentation/view/3.6.1/339/
The PATTERN_TYPE may optionally be followed by a float value that controls the
apparent depth of the bumps. Typical values range from 0.0 to 1.0 but any value
may be used. Negative values invert the pattern. The default value if none is
specified is 0.5.

#version 3.8;

global_settings {
 assumed_gamma 1.0
}

#include "colors.inc"

#declare Aspect = image_width/image_height;
#declare Zoom = 120;
camera {
 orthographic
 right     x*image_width/Zoom
 up   y*image_height/Zoom
 location <0, 0, -10>
 look_at  <0, 0, 0>
}


light_source {<0, 0.2, -20> color White } //shadowless}
sky_sphere {pigment {rgb 1}}

#declare B = 0.4;

box {<-1, -1, -0.1>, <0, 1, 0>
 texture {
      pigment {
   agate
   pigment_map {
    [0.00 rgb <0,1,.7>]
    [0.02 rgb <0,.3,.1>]
    [0.15 rgb <0,0,0>]
   } // end pigment map
  } // end pigment

  normal {
   agate B
  } // end pigment
 } // end texture
}

box {<0, -1, -0.1>, <1, 1, 0>
 texture {
/*  pigment {
   agate
   pigment_map {
    [0.00 rgb <0,1,.7>]
    [0.02 rgb <0,.3,.1>]
    [0.15 rgb <0,0,0>]
   } // end pigment map
  } */ //end pigment

  normal {
   agate B
  } // end pigment
 } // end texture
}


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 29 Apr 2020 13:55:00
Message: <web.5ea9bf2d72e01857dc1270cd0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Josh" <nomail@nomail> wrote:
>
> > How do I align a pigment with a normal? Say I have an isosurface that I want to
> > apply an agate normal to, but also an agate pigment_map that matches perfectly,
> > so that I can color just the 'valleys' of the normal map? Does that make sense?
> > It almost looks like it matches, but when I render one time with just the
> > pigment_map and one time with just the normal, I don't think they are the same
> > pattern.
>
> Looks like you're doing it right.
> Might just be the the way the light strikes it, or the way the eyes are more
> sensitive to the finer changes in colors of the pigment map vs the effect of the
> normal.

I see now that you are right. They look a bit mis-aligned but it has more to do
with the pigment map changing more quickly than the normal...

Thanks!

Josh


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 30 Apr 2020 19:50:01
Message: <web.5eab640472e01857dc1270cd0@news.povray.org>
I've found a way to create and use a df3 file as an isosurface. Works well. I'm
trying now to add noise to it and it makes the shape disappear. Any ideas? The
shape shows up fine without the +f_noise3d(x,y,z)*2 statement... Does anyone
know what is happening?

#include "functions.inc"
#declare Fnct00 = function {
    pattern { density_file df3 "aster1.df3" interpolate 0
    }
}
#declare Fnct01 = function (x,y,z) {
    0.025-Fnct00(x,y,z)
}
#declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
#declare Iso00 = isosurface {
    function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
    contained_by { box { -5,5 } }
    threshold 0
    accuracy 0.0005
    max_gradient 6
    all_intersections
    texture {
      pigment { color BaryteGreen }
      finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
    }
}

Josh


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 30 Apr 2020 20:15:00
Message: <web.5eab68e472e01857dc1270cd0@news.povray.org>
"Josh" <nomail@nomail> wrote:
> I've found a way to create and use a df3 file as an isosurface. Works well. I'm
> trying now to add noise to it and it makes the shape disappear. Any ideas? The
> shape shows up fine without the +f_noise3d(x,y,z)*2 statement... Does anyone
> know what is happening?
>
> #include "functions.inc"
> #declare Fnct00 = function {
>     pattern { density_file df3 "aster1.df3" interpolate 0
>     }
> }
> #declare Fnct01 = function (x,y,z) {
>     0.025-Fnct00(x,y,z)
> }
> #declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
> #declare Iso00 = isosurface {
>     function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
>     contained_by { box { -5,5 } }
>     threshold 0
>     accuracy 0.0005
>     max_gradient 6
>     all_intersections
>     texture {
>       pigment { color BaryteGreen }
>       finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
>     }
> }
>
> Josh

Just to clarify, I've tried adding f_noise3d, subtracting it, nothing seems to
allow me to perturb the surface of my df3 shape like I can if my function is
just a simple sphere...

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Mapping Textures on irregular shapes
Date: 30 Apr 2020 20:50:01
Message: <web.5eab717d72e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> > #include "functions.inc"
> > #declare Fnct00 = function {
> >     pattern { density_file df3 "aster1.df3" interpolate 0
> >     }
> > }
> > #declare Fnct01 = function (x,y,z) {
> >     0.025-Fnct00(x,y,z)
> > }
> > #declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
> > #declare Iso00 = isosurface {
> >     function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
> >     contained_by { box { -5,5 } }
> >     threshold 0
> >     accuracy 0.0005
> >     max_gradient 6
> >     all_intersections
> >     texture {
> >       pigment { color BaryteGreen }
> >       finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
> >     }
> > }

You're in the realm of "very tricky" - and I get lost there all the time.   ;)

My best suggestion is to apply the shotgun approach and try to diagnose the
problem in a number of ways.

You should be able to decrease the accuracy in the simple df3 scene until it's
still ok but not abhorrent - that will speed things up.
Maybe employ the evaluate equations in the isosurface docs and see if that helps
any too.

Make sure your camera is far enough away so you're not "in" the isosurface, use
a simple color, and a sky_sphere to make sure you're lighting the whole object.

Then you can try keywords like open and inverse
make the box bigger (slow)
use a wider thinner box - take only a slice, and see what shows up
change the threshold
use function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2 - 0.01}

write a pseudo-isosurface code block to cycle through X, Y, and Z and have the
function evaluate those, and plot tiny spheres if the function evaluates to +/-
some small value close to 0 pick a good step value for your loops so it doesn't
take FOREVER
--------->  X, Y, and Z - NOT x, y, and z
graph a strip of Fnct01(X, 0, 0) in the same way.
try graphing Y and Z as well

See if any of that works.   That's usuallly everything I go through.

and bookmark:   http://www.econym.demon.co.uk/isotut/index.htm
You'll use it a LOT


Post a reply to this message

From: Alain Martel
Subject: Re: Mapping Textures on irregular shapes
Date: 1 May 2020 12:01:57
Message: <5eac47f5$1@news.povray.org>
Le 2020-04-30 à 20:10, Josh a écrit :
> "Josh" <nomail@nomail> wrote:
>> I've found a way to create and use a df3 file as an isosurface. Works well. I'm
>> trying now to add noise to it and it makes the shape disappear. Any ideas? The
>> shape shows up fine without the +f_noise3d(x,y,z)*2 statement... Does anyone
>> know what is happening?
>>
>> #include "functions.inc"
>> #declare Fnct00 = function {
>>      pattern { density_file df3 "aster1.df3" interpolate 0
>>      }
>> }
>> #declare Fnct01 = function (x,y,z) {
>>      0.025-Fnct00(x,y,z)
>> }
>> #declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
>> #declare Iso00 = isosurface {
>>      function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
>>      contained_by { box { -5,5 } }
>>      threshold 0
>>      accuracy 0.0005
>>      max_gradient 6
>>      all_intersections
>>      texture {
>>        pigment { color BaryteGreen }
>>        finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
>>      }
>> }
>>
>> Josh
> 
> Just to clarify, I've tried adding f_noise3d, subtracting it, nothing seems to
> allow me to perturb the surface of my df3 shape like I can if my function is
> just a simple sphere...
> 
> Josh
> 
> 

Play with the coordinates passed to the function and see what happen.

A starting point :
function { Fnct01(x+sin(y*2+z*3),y-cos(x*7),z+cos(y*5)) }


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 1 May 2020 12:55:01
Message: <web.5eac540972e01857dc1270cd0@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> Le 2020-04-30 à 20:10, Josh a écrit :
> > "Josh" <nomail@nomail> wrote:
> >> I've found a way to create and use a df3 file as an isosurface. Works well. I'm
> >> trying now to add noise to it and it makes the shape disappear. Any ideas? The
> >> shape shows up fine without the +f_noise3d(x,y,z)*2 statement... Does anyone
> >> know what is happening?
> >>
> >> #include "functions.inc"
> >> #declare Fnct00 = function {
> >>      pattern { density_file df3 "aster1.df3" interpolate 0
> >>      }
> >> }
> >> #declare Fnct01 = function (x,y,z) {
> >>      0.025-Fnct00(x,y,z)
> >> }
> >> #declare BaryteGreen = srgb <0.6157,0.7686,0.3725>;
> >> #declare Iso00 = isosurface {
> >>      function { Fnct01(x,y,z) + f_noise3d(x,y,z)*2}
> >>      contained_by { box { -5,5 } }
> >>      threshold 0
> >>      accuracy 0.0005
> >>      max_gradient 6
> >>      all_intersections
> >>      texture {
> >>        pigment { color BaryteGreen }
> >>        finish { ambient <0.03,0.02,0.0> diffuse 0.8,0.4 phong 0.7 }
> >>      }
> >> }
> >>
> >> Josh
> >
> > Just to clarify, I've tried adding f_noise3d, subtracting it, nothing seems to
> > allow me to perturb the surface of my df3 shape like I can if my function is
> > just a simple sphere...
> >
> > Josh
> >
> >
>
> Play with the coordinates passed to the function and see what happen.
>
> A starting point :
> function { Fnct01(x+sin(y*2+z*3),y-cos(x*7),z+cos(y*5)) }

That produced interesting results. It split the shape up and duplicated it a
bunch of times. I'll have to think about it.

In the meantime, does anyone know what the isosurface function would be for a
rounded box?

Thanks!

Josh


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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