POV-Ray : Newsgroups : povray.newusers : Light emitting media and NKFlare Server Time
25 Nov 2024 19:30:08 EST (-0500)
  Light emitting media and NKFlare (Message 1 to 5 of 5)  
From: Beowulf Shaeffer
Subject: Light emitting media and NKFlare
Date: 21 Mar 2005 15:25:01
Message: <web.423f2d627ac04ce31bec960e0@news.povray.org>
I am attempting, largely through trial and error, to make a scene including
the entire solar system. So far, I have a starfield background and a sun (a
sphere containing light emitting media).

Code to get me this is:
#include "colors.inc"
#include "textures.inc"
#include "stars.inc"

camera
{
        location <0, 0, -1000>
        look_at <0, 0, 0>
}

sphere // transparent sphere containing media
 { <0,0,0> 1
  /*texture
 {

 pigment {

   crackle scale 100 turbulence 100
    color_map {
      [0.0 rgbf <1, 0, 0, 0.1>]
      [0.2 rgbf <1, 0.85, 0, 0.4>]
      [0.7 rgbf <1, 0.75, 0, 0.7>]
      [1 rgbf <1, 1, 0, 0.4>]
     }
 }
 }*/

 pigment {rgbt 1} hollow
  interior
   { media
     { emission 20
       density
       { spherical density_map
         { [0 rgb 0]
           //[0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
  }
  scale 80
}

sky_sphere
{

    pigment {
        granite
        color_map {
            [ 0.000  0.270 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.270  0.290 color rgb <.5,.5,.4> color rgb <.8,.8,.4> ]
            [ 0.290  0.470 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.470  0.490 color rgb <.4,.4,.5> color rgb <.4,.4,.8> ]
            [ 0.490  0.680 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.680  0.700 color rgb <.5,.4,.4> color rgb <.8,.4,.4> ]
            [ 0.700  0.880 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.880  0.900 color rgb <.5,.5,.5> color rgb < 1, 1, 1> ]
            [ 0.900  1.000 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
        }
    turbulence 1
    sine_wave
    scale .5
    }
    scale 0.1
}

The pigment in the sky sphere is taken from the stars.inc file. I am also
messing around with a 'crackle' effect to get that slightly broken look on
the sun, but it doesnt look very good so i have commented it out.

Before I move onto the other planets, I want to make the sun have a flare. I
pursuit of this I have been trying to use NKFlare, but I really _can't_ get
the damm thing to work.

I have followed all the instructions (.flr file and nkflare.inc in the
include folder, added this to the library path, .flr files and .inc file in
the same directory as my source file) and included the appropriate
variables and include files. My code now looks like this:

#include "colors.inc"
#include "textures.inc"
#include "stars.inc"
#include "nkflare.inc"
#include "space2.flr"

camera
{
        location <0, 0, -1000>
        look_at <0, 0, 0>
}

#declare cam_loc = <0, 0, -1000>   // use the x, y, and z of your camera
#declare light_loc = <0,0,0> // use the x, y, and z of the light
                              // you wish to flare
#declare lookat = <0, 0, 0>    // the look_at vector of your camera
#declare sky_vect = <0,1,0>

sphere // transparent sphere containing media
 { <0,0,0> 1

 /*texture
 {

 pigment {

   crackle scale 100 turbulence 100
    color_map {
      [0.0 rgbf <1, 0, 0, 0.1>]
      [0.2 rgbf <1, 0.85, 0, 0.4>]
      [0.7 rgbf <1, 0.75, 0, 0.7>]
      [1 rgbf <1, 1, 0, 0.4>]
     }
 }
 }*/

 pigment {rgbt 1} hollow
  interior
   { media
     { emission 20
       density
       { spherical density_map
         { [0 rgb 0]
           //[0.4 rgb <1,0,0>]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]
         }
       }
     }
  }
  scale 80
}

sky_sphere
{
   pigment {
        granite
        color_map {
            [ 0.000  0.270 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.270  0.290 color rgb <.5,.5,.4> color rgb <.8,.8,.4> ]
            [ 0.290  0.470 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.470  0.490 color rgb <.4,.4,.5> color rgb <.4,.4,.8> ]
            [ 0.490  0.680 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.680  0.700 color rgb <.5,.4,.4> color rgb <.8,.4,.4> ]
            [ 0.700  0.880 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.880  0.900 color rgb <.5,.5,.5> color rgb < 1, 1, 1> ]
            [ 0.900  1.000 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
        }
    turbulence 1
    sine_wave
    scale .5
    }
    scale 0.1
}

I have been messing around with the scale a bit (hence scale 80 on the
sphere).

Anyway, when I try to render this POV-Ray jumps to the nkflare.inc file, and
hihlights the line

#local lf_2light = cam_loc - light_loc;

and says (at the bottom) "Parse Error: Cannot initialise uninitialised
identifier"

Can anyone help me to get this to work? It would be much appreciated.

I am using POV-Ray 3.6 for Windows, and this is my third day of POV-Ray.

Thanks


PS sorry about the length of the post


Post a reply to this message

From: Mike Williams
Subject: Re: Light emitting media and NKFlare
Date: 21 Mar 2005 15:44:31
Message: <JUphKDAmIzPCFw7D@econym.demon.co.uk>
Wasn't it Beowulf Shaeffer who wrote:
>
>Before I move onto the other planets, I want to make the sun have a flare. I
>pursuit of this I have been trying to use NKFlare, but I really _can't_ get
>the damm thing to work.
>
>Anyway, when I try to render this POV-Ray jumps to the nkflare.inc file, and
>hihlights the line
>
>#local lf_2light = cam_loc - light_loc;
>
>and says (at the bottom) "Parse Error: Cannot initialise uninitialised
>identifier"
>
>Can anyone help me to get this to work? It would be much appreciated.
>
>I am using POV-Ray 3.6 for Windows, and this is my third day of POV-Ray.


The order in which you do things matters. NKFlare wants to use variables
like "cam_loc", "light_loc", and a pile of stuff that's created in the flr
file, so you have to declare those variables before the #include, and call
space2.flr before nkflare.inc.

Like this:-

#declare cam_loc = <0, 0, -1000>;   // use the x, y, and z of your camera
#declare light_loc = <0,0,0>;       // use the x, y, and z of the light
                                    // you wish to flare
#declare lookat = <0, 0, 0>;        // the look_at vector of your camera
#declare sky_vect = <0,1,0>;

#include "space2.flr"
#include "nkflare.inc"

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Beowulf Shaeffer
Subject: Re: Light emitting media and NKFlare
Date: 21 Mar 2005 16:00:00
Message: <web.423f3580a6783e921bec960e0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> The order in which you do things matters. NKFlare wants to use variables
> like "cam_loc", "light_loc", and a pile of stuff that's created in the flr
> file, so you have to declare those variables before the #include, and call
> space2.flr before nkflare.inc.
>
> Like this:-
>
> #declare cam_loc = <0, 0, -1000>;   // use the x, y, and z of your camera
> #declare light_loc = <0,0,0>;       // use the x, y, and z of the light
>                                     // you wish to flare
> #declare lookat = <0, 0, 0>;        // the look_at vector of your camera
> #declare sky_vect = <0,1,0>;
>
> #include "space2.flr"
> #include "nkflare.inc"
>
> --
> Mike Williams
> Gentleman of Leisure


Thankyou very much, that works very well and looks damm cool too!


Post a reply to this message

From: Beowulf Shaeffer
Subject: Re: Light emitting media and NKFlare
Date: 21 Mar 2005 17:40:00
Message: <web.423f4c5da6783e921bec960e0@news.povray.org>
Anger!

This question may or may not be related to the flare, but I didn't want to
post another thread.

Anyway if I render my code:

#include "colors.inc"
#include "textures.inc"
#include "stars.inc"

#declare cam_loc = <0, 0, -10>;
#declare light_loc = <0,0,0>;
#declare lookat = <0, 0, 0>;
#declare sky_vect = <0,1,0>;
#declare flare_brightness = 5;

#include "bigstar.flr"
#include "nkflare.inc"


camera
{
        location <0, 0, -10>
        look_at <0, 0, 0>
}

sphere // transparent sphere containing media
 { <0,0,0> 1
  pigment {rgbt 1} hollow
  interior
   { media
     { emission 10
       density
       { spherical density_map
         { [0 rgb 0]
           [0.8 rgb <1,1,0>]
           [1 rgb 1]

         }
       }
     }
  }
}

sky_sphere
{

    pigment {
        granite
        color_map {
            [ 0.000  0.270 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.270  0.290 color rgb <.5,.5,.4> color rgb <.8,.8,.4> ]
            [ 0.290  0.470 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.470  0.490 color rgb <.4,.4,.5> color rgb <.4,.4,.8> ]
            [ 0.490  0.680 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.680  0.700 color rgb <.5,.4,.4> color rgb <.8,.4,.4> ]
            [ 0.700  0.880 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
            [ 0.880  0.900 color rgb <.5,.5,.5> color rgb < 1, 1, 1> ]
            [ 0.900  1.000 color rgb < 0, 0, 0> color rgb < 0, 0, 0> ]
        }
    turbulence 1
    sine_wave
    scale .5
    }
    scale 0.1
}

The sun is there and the flare is very nice. Note I am 10 units back on the
Z axis. The shpere radius should also be 1 unit. If I move the camera back
to 100, or 1000 units on the Z axis, the sun still appears to be same size
on the scene!

This isn't what I want to happen - I effectively want to zoon out to get a
wider view. What I am doing wrong and/or have missed in documentation/FAQs?

Thanks very much for your help.

PS If you change the camera position be sure to change cam_loc (near the
top) to the same values.


Post a reply to this message

From: Mike Williams
Subject: Re: Light emitting media and NKFlare
Date: 21 Mar 2005 20:34:30
Message: <ZgllHAAVY3PCFw6d@econym.demon.co.uk>
Wasn't it Beowulf Shaeffer who wrote:
>
>The sun is there and the flare is very nice. Note I am 10 units back on the
>Z axis. The shpere radius should also be 1 unit. If I move the camera back
>to 100, or 1000 units on the Z axis, the sun still appears to be same size
>on the scene!
>
>This isn't what I want to happen - I effectively want to zoon out to get a
>wider view. What I am doing wrong and/or have missed in documentation/FAQs?
>
>Thanks very much for your help.
>
>PS If you change the camera position be sure to change cam_loc (near the
>top) to the same values.

But that's how camera flares behave. If that's not what you want, then
don't use nkflare.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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