POV-Ray : Newsgroups : povray.newusers : Media usage Server Time
23 Dec 2024 15:01:24 EST (-0500)
  Media usage (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Micheus
Subject: Media usage
Date: 12 Jun 2009 20:35:00
Message: <web.4a32f313b31aaa0275f7f8dc0@news.povray.org>
I'm testing a sample at POV-Ray help (2.3.6  Simple Media Tutorial) that lock
like this:

sphere // transparent sphere containing media
 { 0,.7
   pigment { rgbt 1 } hollow
   interior
   {
     media
     { emission 1
       density
       { spherical density_map
         { [0 rgb 0]
           [0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
   }
   translate <-0.5, 1.7, 0.5>
 }


but the objects exported by Wings3D use "declare" statement to define the object
geometry and "object" to declare and define objects. So, why I can't get the
same result by using this way:

#declare nebulosa = sphere // transparent sphere containing media
 { 0,.7
   translate <0.5, 1.7, 0.5>
 }

object { nebulosa
   pigment { rgbt 1 } hollow
   interior
   {
     media
     { emission 1
       density
       { spherical density_map
         { [0 rgb 0]
           [0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
   }
}

I have just moved the pigment an interior properties from "declare" to "object"
and get this result:
http://lh6.ggpht.com/_ZQYpKPHH8hM/SjLyeInLAbI/AAAAAAAAALA/Cg75pZtO9C8/s720/Teste%20Luz%20Volumetrica.jpg
(observe the intersection insed the "glow" sphere)

TIA


Post a reply to this message

From: Slime
Subject: Re: Media usage
Date: 13 Jun 2009 04:28:58
Message: <4a33634a$1@news.povray.org>
Because you moved the position of the "translate". In the original code, the 
translation applies to the media as well as the sphere. In your code, it 
applies only to the sphere and doesn't affect the media within it.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Micheus
Subject: Re: Media usage
Date: 15 Jun 2009 18:00:00
Message: <web.4a36c43a438fc1fb194bff60@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> Because you moved the position of the "translate". In the original code, the
> translation applies to the media as well as the sphere. In your code, it
> applies only to the sphere and doesn't affect the media within it.
>
>  - Slime
>  [ http://www.slimeland.com/ ]

Thanks Slime.
I haven't found this information on documentation.

I have change the code to:
#declare nebulosa = sphere // transparent sphere containing media
 { 0,.7
 }

object { nebulosa
   pigment { rgbt 1 } hollow
   interior
   {
     media
     { emission 1
       density
       { spherical density_map
         { [0 rgb 0]
           [0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
   }
   translate <0.5, 1.7, 0.5>
}
and really work fine (only if "translate" is called after "interior")


So, now I go to an other level...
In the true I want use this effect with "mesh" objects and solved this doubt I
would like to try this code with an irregular mesh (see:
http://img196.imageshack.us/img196/4778/lavalampwings3d.png) - the yellow lava
"balls".
Don't POV have a way to use object shape? (only: bozo, wood, gradient, waves,
spherical, planar, cylindrical, and boxed)


TIA


Post a reply to this message

From: Chris B
Subject: Re: Media usage
Date: 18 Jun 2009 04:36:30
Message: <4a39fc8e$1@news.povray.org>
"Micheus" <nomail@nomail> wrote in message 
news:web.4a36c43a438fc1fb194bff60@news.povray.org...
>
> ...
>
> So, now I go to an other level...
> In the true I want use this effect with "mesh" objects and solved this 
> doubt I
> would like to try this code with an irregular mesh (see:
> http://img196.imageshack.us/img196/4778/lavalampwings3d.png) - the yellow 
> lava
> "balls".

You can fill any shape with an interior, so you can use something similar to 
this effect on a mesh or mesh2 object. The example below uses the POVRay 
blob primitive for lava balls (as I didn't have suitable mesh shapes to 
hand). I think the best approach would be to use a simple flat emission 
color to fill the main body of the object. If you just use the spherical 
emission statement as you had before, you'll get a single red/yellow 
transition passing through the entire multi-blob object.

This doesn't mean you're stuck with flat colors though because you can add 
multiple media statements within an interior block and POV-Ray should add 
the media together. For example, you could have a flat red media and 
superimpose multiple spherical media that transition from yellow to nothing. 
I've added one such yellow transition at the centre of the central blob, but 
you could add one for each blob.

I think you should be able to get about as sophisticated as you want with 
this general approach.

camera {location <-2, 1.2, -5> look_at 0}
light_source {<2,20,-4> color rgb 2}

#declare nebulosa = blob { threshold 0.6
  // Central Blob
  sphere {0,2,1}
  sphere {y,1,1}
  // Left Blob
  sphere {<-1.6,1.6,0.7>,1.5,1}
  sphere {<-1.1,2.2,1  >,1  ,1}
  // Right Blob
  sphere {<1,1.8,1.2>,1.2,1}
  sphere {<1,2.3,1  >,1.2,1}
}

object { nebulosa scale 0.5
  pigment {rgbt 1 } hollow
  interior {
    media {emission rgb <1,0,0>}
    media {emission 1
      density {spherical
        density_map {
          [0   rgb 0]
          [0.2 rgb 0]
          [0.5 rgb <1,1,0>]
          [1   rgb <1,1,0>]
        }
      }
      scale <0.3,0.6,0.3>
      rotate z*8
      translate 0.15*y
    }
  }
}

plane {y,-1 pigment {rgb 0.1}}


> Don't POV have a way to use object shape? (only: bozo, wood, gradient, 
> waves,
> spherical, planar, cylindrical, and boxed)

Yes you can use any pattern and there is an object pattern, which should 
enable you to use any object shape to control the media. The problem with 
this is that it transitions from 0 to 1 immediately at the surface of the 
object, so it doesn't give you any sort of progressive change. I suspect 
that it's therefore mostly useless for what you want to do.

Regards,
Chris B.


Post a reply to this message

From: Micheus
Subject: Re: Media usage
Date: 22 Jun 2009 20:50:01
Message: <web.4a4025f7438fc1f75f7f8dc0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "Micheus" <nomail@nomail> wrote in message
> news:web.4a36c43a438fc1fb194bff60@news.povray.org...
> >
> > ...
> I suspect that it's therefore mostly useless for what you want to do.
________________________

Thanks Chris.

Really I can't make this work with may structure (Wings3D exported structure).

I have tried Your definition with a simple cube made with Wings3D. It's center
at <0,0,0>:
:
:
#declare wm_default = texture{
  pigment{
   color rgbf <1.000000, 1.000000, 1.000000, 0.000000>
  }
  finish {
   ambient rgb <0.000000, 0.000000, 0.000000>
   diffuse 0.700000
   brilliance 1.000000
   metallic 0.000000
   specular 1.000000
   roughness 0.010000
  }
}

#declare wo_0_cube1 = mesh2{
  vertex_vectors { 8, <0.500000, -0.500000, 0.500000>, <0.500000, 0.500000,
0.500000>, <-0.500000, 0.500000, 0.500000>, <-0.500000, -0.500000, 0.500000>,
<0.500000, -0.500000, -0.500000>, <0.500000, 0.500000, -0.500000>, <-0.500000,
0.500000, -0.500000>, <-0.500000, -0.500000, -0.500000>}
  //#local average_center = <0.000000, 0.000000, 0.000000>;
  normal_vectors { 8, <-0.666667, 0.333333, -0.666667>, <-0.408248, -0.816497,
-0.408248>, <0.666667, -0.333333, -0.666667>, <0.408248, 0.816497, -0.408248>,
<-0.408248, 0.816497, 0.408248>, <-0.666667, -0.333333, 0.666667>, <0.408248,
-0.816497, 0.408248>, <0.666667, 0.333333, 0.666667>}
  uv_vectors { 0}
  texture_list { 1, texture{wm_default}}
  face_indices { 12, <0, 3, 2>, 0, <2, 1, 0>, 0, <3, 7, 2>, 0, <7, 6, 2>, 0, <0,
4, 3>, 0, <4, 7, 3>, 0, <2, 6, 1>, 0, <6, 5, 1>, 0, <5, 6, 7>, 0, <5, 7, 4>, 0,
   <1, 5, 0>, 0, <5, 4, 0>, 0}
  normal_indices { 12, <0, 3, 2>, <2, 1, 0>, <3, 7, 2>, <7, 6, 2>, <0, 4, 3>,
<4, 7, 3>, <2, 6, 1>, <6, 5, 1>, <5, 6, 7>, <5, 7, 4>,
   <1, 5, 0>, <5, 4, 0>}
  uv_indices { 12, <0, 0, 0>, <0, 0, 0>, <0, 0, 0>, <0, 0, 0>, <0, 0, 0>, <0, 0,
0>, <0, 0, 0>, <0, 0, 0>, <0, 0, 0>, <0, 0, 0>,
   <0, 0, 0>, <0, 0, 0>}
}


object{ wo_0_cube1
  pigment {rgbt 1 } hollow
  interior {
    media {emission rgb <1,0,0>}
    media {emission 1
      density {spherical
        density_map {
          [0   rgb 0]
          [0.2 rgb 0]
          [0.5 rgb <1,1,0>]
          [1   rgb <1,1,0>]
        }
      }
      scale <0.3,0.6,0.3>
      rotate z*8
      translate 0.15*y
    }
  }
}

If I remove "texture_list" and insert "pigment" into mesh definition I get an
error message (Texture index out of range) or if a try change "wm_default"
texture definition to use the pigment, like this:
#declare wm_default = texture{
  pigment {rgbt 1 } hollow
}
I get an other error message (No matching } in 'texture' hollow found instead).

So I think that is not possible use media with objects exported by Wings3D.

One more time, thanks by Your answer.


Post a reply to this message

From: clipka
Subject: Re: Media usage
Date: 22 Jun 2009 22:45:00
Message: <web.4a40411a438fc1f8a8745f10@news.povray.org>
"Micheus" <nomail@nomail> wrote:
> If I remove "texture_list" and insert "pigment" into mesh definition I get an
> error message (Texture index out of range)

which is only natural because "face_indices" contains not only vertex indices,
but also texture indices (i.e. indices into the texture_list)


> or if a try change "wm_default"
> texture definition to use the pigment, like this:
> #declare wm_default = texture{
>   pigment {rgbt 1 } hollow
> }
> I get an other error message (No matching } in 'texture' hollow found instead).

Which is only natural, too, because "hollow" is an object statement, not part of
the pigment. As it is already in the object definition further below in your
code, the following wm_default should do:

  #declare wm_default = texture{
    pigment {rgbt 1 }
    finish { ambient 0 diffuse 0 specular 0 }
  }


> So I think that is not possible use media with objects exported by Wings3D.

Don't worry: It is.


Post a reply to this message

From: Micheus
Subject: Re: Media usage
Date: 25 Jun 2009 16:25:01
Message: <web.4a43dcf0438fc1f62d939b70@news.povray.org>
"clipka" <nomail@nomail> wrote:
> which is only natural because "face_indices" contains not only vertex indices,
> but also texture indices (i.e. indices into the texture_list)
Now I know this.


> Which is only natural, too, because "hollow" is an object statement, not part > of
the pigment.
I had not understood this when I read about it on help file.


> As it is already in the object definition further below in your
> code, the following wm_default should do:
>
>   #declare wm_default = texture{
>     pigment {rgbt 1 }
>     finish { ambient 0 diffuse 0 specular 0 }
>   }
Yes You right! It's working now!!


Just I have discovered that the result is not exactly wath I thought.
The sample posted by "Chris B" is more bright but when I have used your
definition in my model it looks dark
Chris B sample:
http://lh5.ggpht.com/_ZQYpKPHH8hM/SkPar41Ke2I/AAAAAAAAAMQ/Yf4DuliBDk8/Lava_Media_Teste.jpg
My model (only lava):
http://lh6.ggpht.com/_ZQYpKPHH8hM/SkPasFaOz8I/AAAAAAAAAMU/6RKUnL5-E5s/lava_lamp-close.jpg
My "final" render:
http://lh6.ggpht.com/_ZQYpKPHH8hM/SkPasFh2_AI/AAAAAAAAAMY/Kua3TYoyxNI/lava_lamp.jpg


Thanks all you guys by your patience.


Post a reply to this message

From: Chris B
Subject: Re: Media usage
Date: 25 Jun 2009 18:16:05
Message: <4a43f725@news.povray.org>
"Micheus" <nomail@nomail> wrote in message 
news:web.4a43dcf0438fc1f62d939b70@news.povray.org...
>
> Just I have discovered that the result is not exactly wath I thought.
> The sample posted by "Chris B" is more bright but when I have used your
> definition in my model it looks dark
>

The example I posted contained two media statements within the interior 
statement and they're cumulative, so, if it still contains 2 that could 
potentially explain the difference in brightness. (Just a guess).

Regards,
Chris B.


Post a reply to this message

From: Micheus
Subject: Re: Media usage
Date: 25 Jun 2009 21:25:00
Message: <web.4a44229c438fc1f62d939b70@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> The example I posted contained two media statements within the interior
> statement and they're cumulative, so, if it still contains 2 that could
> potentially explain the difference in brightness. (Just a guess).

Ok.
I will try work around my problem with this tip.

Thanks Chris.


Post a reply to this message

From: Chris B
Subject: Re: Media usage
Date: 26 Jun 2009 03:59:40
Message: <4a447fec$1@news.povray.org>
"Micheus" <nomail@nomail> wrote in message 
news:web.4a44229c438fc1f62d939b70@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>> The example I posted contained two media statements within the interior
>> statement and they're cumulative, so, if it still contains 2 that could
>> potentially explain the difference in brightness. (Just a guess).
>
> Ok.
> I will try work around my problem with this tip.
>
> Thanks Chris.
>

I wasn't really suggesting this as a workaround. I was just suggesting that 
this might be an explanation for the difference.

To turn up the brightness in an image there are several ways that you'll 
probably find easier.
You can adjust the brightness of the output for the whole scene using the 
assumed gamma setting. For example:

global_settings {assumed_gamma 0.7}
Note that reducing the assumed gamma value increases the brightness of your 
scene.

Alternatively you can oversaturate the color of individual components. 
Although individual RGB color components are usually specified as numbers 
from 0 to 1, POV-Ray doesn't stop you specifying higher values. For example, 
if the camera is looking straight at a white light you could choose to 
represent the white light object as having an oversaturated RGB setting of 
<10,10,10> (or give it a high ambient setting) to make sure that all parts 
of it show up as a bright white and you don't any dimming on parts of the 
object.

In the case of your media settings, specifying twice the amount of color in 
a single media statement give the same result as adding duplicate media 
statements. So, where you're using a color of <1,0.8,0> you might like to 
try 2*<1,0.8,0>.

One word of warning; when POV-Ray works out the color of a pixel in the 
output image it will clip any individual color component value the 
calculated value ends up greater than 1. This can change the color. For 
example, If it calculates a pixel to be <1.23,1,0.5> it clips the Red 
channel giving <1,1,0.5>, which actively changes the color balance of that 
pixel.

With emissive media this clipping may actually help to achieve the effect 
you are looking for. I just tried specifying emission rgb 10*<1,0.5,0.1> 
which gives a white centre (the brightest parts are clipped to <1,1,1>) a 
yellow cloud around the edge of the shape (where it gets clipped to 
<1,1,0.n>) and a reddened outer halo near the edge of the container object. 
So you may want to try something like:

object{ wo_0_cube1 hollow
   interior {
    media {emission  rgb 10*<1,0.5,0.1>}
  }
}

Regards,
Chris B.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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