POV-Ray : Newsgroups : povray.newusers : Reflect light inside box Server Time
2 Jun 2024 14:24:40 EDT (-0400)
  Reflect light inside box (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 19:27:36
Message: <50c7cf78@news.povray.org>
Am 12.12.2012 00:13, schrieb Rhonda:
> Thanks for the input. Any thoughts on why this isn't working:
>
> texture{
>     object{
>      box{<-9,1,0.0001>,<9,10,1 >}
>      my_texture,
>      pigment {rgbt 1}
>    }
>    }

Try this:

   texture{
     object {
       box{<-9,1,0.0001>,<9,10,1 >}
       texture { my_texture },
       texture { pigment {rgbt 1} }
     }
   }


Post a reply to this message

From: Alain
Subject: Re: Reflect light inside box
Date: 11 Dec 2012 21:47:20
Message: <50c7f038$1@news.povray.org>

> This is all really helpful, thank you. I think I'm making progress. I still have
> a few issues.
>
> This is what I now have:
>
> global_settings{photons{spacing 0.1}}
>
> #declare my_texture =
>   texture {
>    finish{
>       reflection{
>        0.3, 1
>        fresnel
>      metallic
>     }
>     specular 1
>     roughness 0.1
>    }
>   }
>
> background { color Blue }
> camera {
>      location <0, 10, -50>
>      look_at  <0, 0,  20>
>
>    }
>
> difference{
>    box{< -10,  0,  0>,<10,  20,   20>}//outside of the box
>    box{<-9.6, 0.4, 0.4>,<9.6, 19.6, 19.6>}//inside of the box
> // the walls now have a thickness of 0.4 unit
>    box{<-9,1, 0>,<9, 10, 0.4>}// the opening
>    texture{
>     object{
>      box{<-9,1,0.0001>,<9,10,1 >}
>      my_texture,
>      pigment {rgbt 1}
>    }
>    }
>
>
> photons{target reflection on}
>
>   rotate y*20
> }
>
> light_source { <5, 20, -30>
>   color White
> }
>
> I'm getting an error on the
>
> texture{
>     object{
>      box{<-9,1,0.0001>,<9,10,1 >}
>      my_texture,
>      pigment {rgbt 1}
>    }
>    }
>
> code, saying that there is a missing }, but I don't see it.
>
> Also, did I put the photons{target reflection on} in the right place, or do I
> need to create an object that includes the box and the photons?
>
> Rhonda
>
>
>

Using the box with the difference, you don't need to use the object 
pattern. It's a way of simulating an opening if you use a transparent 
pigment. Remove:
    object{
     box{<-9,1,0.0001>,<9,10,1 >}
     my_texture,
     pigment {rgbt 1}
   }

and only use:
texture{ my_texture }

Your photons block is correctly placed.


Alain


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Reflect light inside box
Date: 12 Dec 2012 03:38:47
Message: <50c84297$1@news.povray.org>


> ... going back into my corner now.

   To experiment with better metals, I hope... :)

--
Jaime


Post a reply to this message

From: James Holsenback
Subject: Re: Reflect light inside box
Date: 12 Dec 2012 05:52:38
Message: <50c861f6$1@news.povray.org>
On 12/12/2012 03:38 AM, Jaime Vives Piqueres wrote:

>
>> ... going back into my corner now.
>
>    To experiment with better metals, I hope... :)
>
> --
> Jaime
>
LOL ... in my case there's only hope!


Post a reply to this message

From: Kenneth
Subject: Re: Reflect light inside box
Date: 12 Dec 2012 22:15:00
Message: <web.50c94541cf1ff5fec2d977c20@news.povray.org>
Try this slightly corrected, working version. I found a few syntax
errors--nothing to worry about, as we all make them from time to time. I've
included some helpful notes in the code.

 #include "colors.inc" // for your "White" and "Blue" colors
 global_settings{photons{spacing 0.1}}

 #declare my_texture =
   texture {
    // Did you mean to leave out a pigment? If so, that's OK, because a
    // 'default' pigment is substituted (but I think it's black, i.e., <0,0,0>)
    pigment{rgb .7} // POV-Ray expands this to <.7,.7,.7> or a bright gray
     finish{
        reflection{
        0.3, 1 // Might be too much reflection; try .2,.7
        fresnel
        metallic
                }
      specular 1
      roughness 0.1
           }
           }

 background { color Blue }

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

 difference{
    box{< -10,  0,  0>,<10,  20,   20>}//outside of the box
    box{<-9.6, 0.4, 0.4>,<9.6, 19.6, 19.6>}//inside of the box
 // the walls now have a thickness of 0.4 unit
    //box{<-9,1, 0>,<9, 10, 0.4>}// the opening. [This box doesn't work the
    //way you want, the dimensions are a little bit off. Try this one...
    box{<-9.1,1,-.1>,<9,10,.5>}
    texture{
      my_texture  // As Alain mentioned. BTW, no comma should go after this.
           }
  // There was an extra } bracket here, so I removed it

 photons{target reflection on}
 rotate y*30
 } // end of the difference

 light_source { <5, 20, -30>
   color White
 }

//-------------

Sometimes POV-Ray returns an error message that may not make sense (if you can't
easily find the flaw it's reporting.) You'll need to more thoroughly search your
code, up above the flagged error line, to check for any other syntax errors,
missing brackets, etc.

BTW, when making hollow boxes like yours, I find it easier to specify the boxes
like this:

difference{
box{0,1 translate -.5} // i.e., <0,0,0>,<1,1,1>  then centers this unit-size
// box on the origin.
box{0,1 translate -.5 scale .95} // same, but a slightly smaller box
box{0,1 scale <...>  translate <...>  // the cutaway box
 scale <....> // final scale of the completed difference
 texture{...}
 rotate ... // this rotates the difference (and its texture) around
            // the origin--usually more intuitive.
 translate <....> // wherever you want it to go
 }

This way, you don't need to spend time figuring out the precise dimensions of
the inner box to get it 'centered' in the outer box; the 2nd box's scale takes
care of all that. In this case, though, some of the walls may end up with
different thicknesses, if you scale everything into a 'rectangular' shape.

How to go about things most efficiently in POV-Ray just involves experimenting
and practice. You'll find there are many ways of getting a certain result.


Post a reply to this message

From: Rhonda
Subject: Re: Reflect light inside box
Date: 13 Dec 2012 15:25:01
Message: <web.50ca3942cf1ff5fe27603e180@news.povray.org>
This is seriously awesome, thanks so much for your help.

I have a couple more questions.

The light isn't bouncing up into the box as much as I would expect. I increased
max_trace_level, but that didn't change anything. I also tried changing the
position of the light_source, but that didn't change things much either. Is it a
matter of increasing light intensity? Suggestions?

Is there a way to make the box transparent, but have the light rays stay in the
box? I've been moving the camera inside the box to see reflections, but maybe it
would be easier to leave it outside the box and make the box see-through and the
light a different color, such as red.

Rhonda


Post a reply to this message

From: Alain
Subject: Re: Reflect light inside box
Date: 13 Dec 2012 15:43:47
Message: <50ca3e03$1@news.povray.org>

> This is seriously awesome, thanks so much for your help.
>
> I have a couple more questions.
>
> The light isn't bouncing up into the box as much as I would expect. I increased
> max_trace_level, but that didn't change anything. I also tried changing the
> position of the light_source, but that didn't change things much either. Is it a
> matter of increasing light intensity? Suggestions?
>
> Is there a way to make the box transparent, but have the light rays stay in the
> box? I've been moving the camera inside the box to see reflections, but maybe it
> would be easier to leave it outside the box and make the box see-through and the
> light a different color, such as red.
>
> Rhonda
>
>
>
>
>

The intensity decrease after each reflections. After a few, it can 
become to faint to be seen compared to some other elements. If the 
intensity goes under adc_bailout, the tracing just stop and return the 
value so far.

max_trace_level default to 5. In scenes like yours, with mostly 
reflective surfaces, it should be increased. max_trace_level 50 is 
reasonable, it's maximum is 255.

A possibility would be to slightly increase the value for the minimum 
reflection in your finish.

You could try reducing the adc_baulout value in the global_settings. It 
default to 1/256. It can be set lower than that, along with increasing 
max_trace_level. Be warned that it will significantly increase the 
rendering time.

Another viable option could be to use radiosity. It calculate the difuse 
interreflection. It may, or may not, improve things in your case.
Radiosity does take more time.
As a first try, use:

global_settings{ radiosity{} }
or, add:

radiosity{}
in your actual global_settings block.

This turn on radiosity calculation using all the default values.



Alain


Post a reply to this message

From: Kenneth
Subject: Re: Reflect light inside box
Date: 13 Dec 2012 21:20:00
Message: <web.50ca8c67cf1ff5fec2d977c20@news.povray.org>
"Rhonda" <rho### [at] gmailcom> wrote:

>
> I have a couple more questions.
>
> The light isn't bouncing up into the box as much as I would expect. I increased
> max_trace_level, but that didn't change anything. I also tried changing the
> position of the light_source, but that didn't change things much either. Is it a
> matter of increasing light intensity? Suggestions?
>

I commented-out your 'fresnel' keyword and that brightened up the interior very
much.

Here's something I forgot to mention: 'fresnel' in a 'reflection' block also
needs an interior{ior ...} block for it to work correctly. The interior {...}
block goes after the texture{...} block, it's not part of it. *But*, you can't
#declare a texture{...} followed by an interior{...} --POV-Ray treats them as
two completely separate things.  Instead, you can wrap them both in a 'material'
block! It's just a wrapper, and doesn't do anything.

#declare my_texture =
material{
texture{...}
interior{...}
}

Then, when you want to use this, it's:
material{my_texture}
and not texture{my_texture}

By the way, 'photons' almost always look better when the surface of an object is
disturbed in some way, even slightly (i.e., not completely flat.) You can do
this through geometry, or by using a 'normal' block. Try adding this inside your
texture block:

normal{bumps .1 scale 3}

and change global_settings{photons{spacing .1}} to .03  which makes the photon
effect 'tighter' and more detailed (but renders a little slower.)  You'll see
some very nice results!


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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