POV-Ray : Newsgroups : povray.general : Glows show through objects? Server Time
2 Nov 2024 15:25:39 EDT (-0400)
  Glows show through objects? (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: [GDS|Entropy]
Subject: Glows show through objects?
Date: 25 Jan 2009 10:55:51
Message: <497c8b87@news.povray.org>
Hey,

Been bout a year since I've been around here, so, I hope everyone is doing 
well.
I was dicking around the other day and noticed that glows seem to show 
through objects in MP1.21...or that I've done something wrong.

Image posted in p.b.i and scene file in p.t.s-f

Its no big deal or anything, just dicking around with making a fake 
christmas tree macro, with some creative license. :-p

tia,
ian


Post a reply to this message

From: triple r
Subject: Re: Glows show through objects?
Date: 25 Jan 2009 11:45:01
Message: <web.497c96aca7c344784f183f000@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> Hey,
>
> Been bout a year since I've been around here, so, I hope everyone is doing
> well.
> I was dicking around the other day and noticed that glows seem to show
> through objects in MP1.21...or that I've done something wrong.

I seem to remember the same problem.  I would use the trace function to fix the
problem.  Shoot a ray from the camera toward the object.  Call the glow point
'pt,' the camera point 'cam,' and the point you get shooting a ray from cam
toward pt, 'tr.'  Then if the ray doesn't hit the object at all, or if
vlength(pt-cam) < vlength(tr-cam), draw the glow.  In other words, if the ray
hits the object before it reaches the potential glow, don't draw it.

But there may be a simpler way...

 - Ricky


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Glows show through objects?
Date: 25 Jan 2009 11:56:27
Message: <497c99bb$1@news.povray.org>
o_O'

I haven't the foggiest as to how to implement that...though it sounds 
logical and seems like it would work.

I've never used the trace function, or vlength...you wouldn't happen to have 
a link to an example would you?

This seems like one of those bugs that shouldn't have made it to the final 
version, doesn't it?    >_<

tia,
ian

"triple_r" <nomail@nomail> wrote in message 
news:web.497c96aca7c344784f183f000@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> Hey,
>>
>> Been bout a year since I've been around here, so, I hope everyone is 
>> doing
>> well.
>> I was dicking around the other day and noticed that glows seem to show
>> through objects in MP1.21...or that I've done something wrong.
>
> I seem to remember the same problem.  I would use the trace function to 
> fix the
> problem.  Shoot a ray from the camera toward the object.  Call the glow 
> point
> 'pt,' the camera point 'cam,' and the point you get shooting a ray from 
> cam
> toward pt, 'tr.'  Then if the ray doesn't hit the object at all, or if
> vlength(pt-cam) < vlength(tr-cam), draw the glow.  In other words, if the 
> ray
> hits the object before it reaches the potential glow, don't draw it.
>
> But there may be a simpler way...
>
> - Ricky
>
>
>


Post a reply to this message

From: triple r
Subject: Re: Glows show through objects?
Date: 25 Jan 2009 12:15:00
Message: <web.497c9ddea7c344784f183f000@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> o_O'
>
> I haven't the foggiest as to how to implement that...though it sounds
> logical and seems like it would work.

It's all there:

http://www.povray.org/documentation/
http://www.povray.org/documentation/view/3.6.1/229/

 - Ricky


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Glows show through objects?
Date: 25 Jan 2009 14:12:18
Message: <497cb992$1@news.povray.org>
Hmm...

Ok, that is quite informative, though I haven't a comprehensive enough 
understanding of SDL to make the connection between that and blocking 
irrational rays from being traced (heretofore a territory I havent even 
imagined).

You said you had this issue previously, do you have the source that includes 
a similar solution?
I learn best from examples vs. documentation.

tia
ian

"triple_r" <nomail@nomail> wrote in message 
news:web.497c9ddea7c344784f183f000@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> o_O'
>>
>> I haven't the foggiest as to how to implement that...though it sounds
>> logical and seems like it would work.
>
> It's all there:
>
> http://www.povray.org/documentation/
> http://www.povray.org/documentation/view/3.6.1/229/
>
> - Ricky
>
>
>


Post a reply to this message

From: Thomas de Groot
Subject: Re: Glows show through objects?
Date: 26 Jan 2009 03:39:23
Message: <497d76bb$1@news.povray.org>
"triple_r" <nomail@nomail> schreef in bericht 
news:web.497c96aca7c344784f183f000@news.povray.org...
>
> I seem to remember the same problem.  I would use the trace function to 
> fix the
> problem.  Shoot a ray from the camera toward the object.  Call the glow 
> point
> 'pt,' the camera point 'cam,' and the point you get shooting a ray from 
> cam
> toward pt, 'tr.'  Then if the ray doesn't hit the object at all, or if
> vlength(pt-cam) < vlength(tr-cam), draw the glow.  In other words, if the 
> ray
> hits the object before it reaches the potential glow, don't draw it.
>
> But there may be a simpler way...
>

I thought I remembered that you could set the glow to be hidden by an object 
or not, but after a rapid test, that proved wrong. However, I seem to 
remember now (there I go again) that in the NKFlare lens flare macros the 
flares can indeed be hidden. You have to choose a flare that approximates 
most the megapov glow.

NKFlare can be found at: http://www.nathan.kopp.com/nkflare.htm
See also Chris Colefax's lens effects: 
http://www.geocities.com/SiliconValley/Lakes/1434/lenseffects.html but I 
seem to remember (again!) that those suffered from the same thing. I may be 
wrong, though.

Thomas


Post a reply to this message

From: triple r
Subject: Re: Glows show through objects?
Date: 26 Jan 2009 14:00:01
Message: <web.497e0741a7c34478ef2b9ba40@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> I've never used the trace function, or vlength...you wouldn't happen to have
> a link to an example would you?

Here's an example.  It should be pretty self-explanatory.  Six glows are drawn,
one on each face of a cube, and three are blocked.

 - Ricky





#version unofficial megapov 1.21;
#declare s = seed(123501);

// MACRO

/* Test whether a ray starting at start_pt and
 * ending at target_pt hits test_obj before it
 * gets there.  Returns either true if it reaches
 * it or false otherwise.  Add an extra epsilon
 * so that conindident points ARE drawn. */
#macro test_ray( start_pt, target_pt, test_obj )
    #local epsilon = 1.0e-10;
    #local nrml = <0,0,0>;
    #local direc = target_pt - start_pt;
    #local intersec = trace( test_obj, start_pt, direc, nrml );
    !(vlength(nrml) > 0 & vlength(direc) > vlength(intersec-start_pt)+epsilon)
#end

// SCENE

// Light/camera
light_source{ <15,25,-20> rgb 0.2 }
#declare cam_pt = <2.5,3.0,-3.5>;
camera{
    location cam_pt
    look_at 0
}

#macro draw_glow( pt, cam_pt, test_obj )
    #if(test_ray(cam_pt, pt, test_obj))
        glow{
            type 0
            location pt
            size 0.05
            radius 1.0
            fade_power 2
            color rgb vnormalize(<rand(s),rand(s),rand(s)>)
        }
    #end
#end

// Draw the objects
#declare thing = box{-1,1}
draw_glow(  x, cam_pt, thing )
draw_glow( -x, cam_pt, thing )
draw_glow(  y, cam_pt, thing )
draw_glow( -y, cam_pt, thing )
draw_glow(  z, cam_pt, thing )
draw_glow( -z, cam_pt, thing )
object{ thing pigment{rgb 1} }


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Glows show through objects?
Date: 26 Jan 2009 16:09:54
Message: <497e26a2$1@news.povray.org>
Thank you!
That does illustrate the concept quite effectively.

Now my only task is to make that idea work with objects which are unioned 
with glows in one loop and then translated via a second loop to different 
positions.

:-D

Ian

"triple_r" <nomail@nomail> wrote in message 
news:web.497e0741a7c34478ef2b9ba40@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> I've never used the trace function, or vlength...you wouldn't happen to 
>> have
>> a link to an example would you?
>
> Here's an example.  It should be pretty self-explanatory.  Six glows are 
> drawn,
> one on each face of a cube, and three are blocked.
>
> - Ricky
>
>
>
>
>
> #version unofficial megapov 1.21;
> #declare s = seed(123501);
>
> // MACRO
>
> /* Test whether a ray starting at start_pt and
> * ending at target_pt hits test_obj before it
> * gets there.  Returns either true if it reaches
> * it or false otherwise.  Add an extra epsilon
> * so that conindident points ARE drawn. */
> #macro test_ray( start_pt, target_pt, test_obj )
>    #local epsilon = 1.0e-10;
>    #local nrml = <0,0,0>;
>    #local direc = target_pt - start_pt;
>    #local intersec = trace( test_obj, start_pt, direc, nrml );
>    !(vlength(nrml) > 0 & vlength(direc) > 
> vlength(intersec-start_pt)+epsilon)
> #end
>
> // SCENE
>
> // Light/camera
> light_source{ <15,25,-20> rgb 0.2 }
> #declare cam_pt = <2.5,3.0,-3.5>;
> camera{
>    location cam_pt
>    look_at 0
> }
>
> #macro draw_glow( pt, cam_pt, test_obj )
>    #if(test_ray(cam_pt, pt, test_obj))
>        glow{
>            type 0
>            location pt
>            size 0.05
>            radius 1.0
>            fade_power 2
>            color rgb vnormalize(<rand(s),rand(s),rand(s)>)
>        }
>    #end
> #end
>
> // Draw the objects
> #declare thing = box{-1,1}
> draw_glow(  x, cam_pt, thing )
> draw_glow( -x, cam_pt, thing )
> draw_glow(  y, cam_pt, thing )
> draw_glow( -y, cam_pt, thing )
> draw_glow(  z, cam_pt, thing )
> draw_glow( -z, cam_pt, thing )
> object{ thing pigment{rgb 1} }
>
>
>
>
>
>


Post a reply to this message

From: triple r
Subject: Re: Glows show through objects?
Date: 26 Jan 2009 19:20:00
Message: <web.497e527da7c34478ef2b9ba40@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
> Thank you!
> That does illustrate the concept quite effectively.
>
> Now my only task is to make that idea work with objects which are unioned
> with glows in one loop and then translated via a second loop to different
> positions.

Instead, I would use vtransform() or something to build an array of the point
coordinates as you build an object *without* glows.  Then go back when the full
object has been built, and just use that in place of the box in my example,
applying it to each glow location.  Whatever you do, don't attempt to use the
macro on each individual piece!

 - Ricky


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Glows show through objects?
Date: 30 Jan 2009 14:32:33
Message: <498355d1@news.povray.org>
Ok...I know I'm going to look like a bumbling idiot once I see the answer 
(which is probably right in front of me) to this, but I have been trying 
unsuccessfully for the last few days to integrate your example into this 
relatively simple file, which I have attached, minus my (most probably 
idiotic) attempts to rectify this issue. *slams head against brick wall*

There are definite disadvantages to working 3rd shift and going to college 
in the day...it fries your brain, making otherwise trivial tasks impossible. 
:-(

Nomatter where in my file I try to integrate those macros, or what object or 
variable I attach them to, the result is the same...that being no difference 
vs. what is obtained without said mods.
Is my problem that I need to construct my object within one loop instead of 
two, and then to allocate generated vectors to an array contained within 
said loop? I'm fxxin lost at this point. *prays for sleep*

TIA for any elucidation, disobfuscation, or even a swift kick in the ass. 
:-D

ian

"triple_r" <nomail@nomail> wrote in message 
news:web.497e527da7c34478ef2b9ba40@news.povray.org...
> "[GDS|Entropy]" <gds### [at] hotmailcom> wrote:
>> Thank you!
>> That does illustrate the concept quite effectively.
>>
>> Now my only task is to make that idea work with objects which are unioned
>> with glows in one loop and then translated via a second loop to different
>> positions.
>
> Instead, I would use vtransform() or something to build an array of the 
> point
> coordinates as you build an object *without* glows.  Then go back when the 
> full
> object has been built, and just use that in place of the box in my 
> example,
> applying it to each glow location.  Whatever you do, don't attempt to use 
> the
> macro on each individual piece!
>
> - Ricky
>
>
>


Post a reply to this message


Attachments:
Download 'blueStalk5.pov.txt' (6 KB)

Goto Latest 10 Messages Next 1 Messages >>>

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