POV-Ray : Newsgroups : povray.advanced-users : how to make a diamond sparkle? Server Time
24 Nov 2024 10:08:00 EST (-0500)
  how to make a diamond sparkle? (Message 1 to 7 of 7)  
From: inhahe
Subject: how to make a diamond sparkle?
Date: 16 Oct 2007 05:20:01
Message: <web.471481d1aefb64f4e93817f20@news.povray.org>
I'm not an advanced user of POVRay, but I thought only advanced users would
be knowledgeable enough to answer my question.

i want to do refraction where colors are separated, like in the prism
effect.  afaik the feature that does this is photon mapping.  but from a
little bit of reading I get the impression that photon mapping would only
project colors onto surfaces, not onto the camera.  so, e.g. if i created a
diamond i wouldn't see it shine with various colors.

but i had an idea.  let's say I create a white surface, with a lens-shaped
refracting object in front of it, and put a black box around it except for
the lens, like a camera.  then i point this contraption toward the diamond
or whatever, and put the povray camera inside the contraption pointing
toward the white surface.  then of course when the image is rendered I flip
it horizontally and vertically.

will this work?
is it necessary?


Post a reply to this message

From: Alain
Subject: Re: how to make a diamond sparkle?
Date: 16 Oct 2007 11:58:19
Message: <4714df9b$1@news.povray.org>
inhahe nous apporta ses lumieres en ce 2007/10/16 05:18:
> I'm not an advanced user of POVRay, but I thought only advanced users would
> be knowledgeable enough to answer my question.
> 
> i want to do refraction where colors are separated, like in the prism
> effect.  afaik the feature that does this is photon mapping.  but from a
> little bit of reading I get the impression that photon mapping would only
> project colors onto surfaces, not onto the camera.  so, e.g. if i created a
> diamond i wouldn't see it shine with various colors.
> 
> but i had an idea.  let's say I create a white surface, with a lens-shaped
> refracting object in front of it, and put a black box around it except for
> the lens, like a camera.  then i point this contraption toward the diamond
> or whatever, and put the povray camera inside the contraption pointing
> toward the white surface.  then of course when the image is rendered I flip
> it horizontally and vertically.
Overkill.
> 
> will this work?
Maybe.
> is it necessary?
NO!
> 
> 
Whenever you add dispersion you get coloured difraction. If the camera see, 
directly or not, the dispersing object, you'll see the colours. You don't need 
photons for that. Photons will make the caustics that hit some surface coloured 
also.
To see the colours, you need an interior block like:

interior{ior 2.5 dispersion 1.2}

Here,the default dispersion_samples of 7 is unualy enough.
Diamond's ior is about 2.5 and it have a relatively strong dispersion, over done 
here.
If the diamond is "free floating", that's all you need.
If the diamond is resting on something, and you want to see the effect on that 
surface, THEN you need photons:

object{Diamond interior{ior 2.5 dispersion 1.1 dispersion_samples 
15}photons{target refraction on difraction on collect off}}

A larger number of dispersion samples is needed to get smooth coloured caustics 
unless very close to the diamond.
You don't need to add a photons block to the light_source, nor to the surface.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you read about an algorithm or 
datastructure and your first thought is: "How can I use this to speed up 
raytracing?"
Christoph Rieder


Post a reply to this message

From: Alain
Subject: Re: how to make a diamond sparkle?
Date: 16 Oct 2007 12:02:30
Message: <4714e096@news.povray.org>
Alain nous apporta ses lumieres en ce 2007/10/16 11:57:
> inhahe nous apporta ses lumieres en ce 2007/10/16 05:18:
>> I'm not an advanced user of POVRay, but I thought only advanced users 
>> would
>> be knowledgeable enough to answer my question.
>>
>> i want to do refraction where colors are separated, like in the prism
>> effect.  afaik the feature that does this is photon mapping.  but from a
>> little bit of reading I get the impression that photon mapping would only
>> project colors onto surfaces, not onto the camera.  so, e.g. if i 
>> created a
>> diamond i wouldn't see it shine with various colors.
>>
>> but i had an idea.  let's say I create a white surface, with a 
>> lens-shaped
>> refracting object in front of it, and put a black box around it except 
>> for
>> the lens, like a camera.  then i point this contraption toward the 
>> diamond
>> or whatever, and put the povray camera inside the contraption pointing
>> toward the white surface.  then of course when the image is rendered I 
>> flip
>> it horizontally and vertically.
> Overkill.
>>
>> will this work?
> Maybe.
>> is it necessary?
> NO!
>>
>>
> Whenever you add dispersion you get coloured difraction. If the camera 
> see, directly or not, the dispersing object, you'll see the colours. You 
> don't need photons for that. Photons will make the caustics that hit 
> some surface coloured also.
> To see the colours, you need an interior block like:
> 
> interior{ior 2.5 dispersion 1.2}
> 
> Here,the default dispersion_samples of 7 is unualy enough.
> Diamond's ior is about 2.5 and it have a relatively strong dispersion, 
> over done here.
> If the diamond is "free floating", that's all you need.
> If the diamond is resting on something, and you want to see the effect 
> on that surface, THEN you need photons:
> 
> object{Diamond interior{ior 2.5 dispersion 1.1 dispersion_samples 
> 15}photons{target refraction on difraction on collect off}}
> 
> A larger number of dispersion samples is needed to get smooth coloured 
> caustics unless very close to the diamond.
> You don't need to add a photons block to the light_source, nor to the 
> surface.
> 
I forgot, you should add:
finish{specular 0.8 roughness 0.0001} or the light won't cause any highlight.
Very small roughness value due to the diamond's very hard and smooth surface.

-- 
Alain
-------------------------------------------------
Why do psychics have to ask you for your name?


Post a reply to this message

From: inhahe
Subject: Re: how to make a diamond sparkle?
Date: 16 Oct 2007 16:05:00
Message: <web.471518a2f31680307c077f8e0@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Alain nous apporta ses lumieres en ce 2007/10/16 11:57:
> > inhahe nous apporta ses lumieres en ce 2007/10/16 05:18:
> >> I'm not an advanced user of POVRay, but I thought only advanced users
> >> would
> >> be knowledgeable enough to answer my question.
> >>
> >> i want to do refraction where colors are separated, like in the prism
> >> effect.  afaik the feature that does this is photon mapping.  but from a
> >> little bit of reading I get the impression that photon mapping would only
> >> project colors onto surfaces, not onto the camera.  so, e.g. if i
> >> created a
> >> diamond i wouldn't see it shine with various colors.
> >>
> >> but i had an idea.  let's say I create a white surface, with a
> >> lens-shaped
> >> refracting object in front of it, and put a black box around it except
> >> for
> >> the lens, like a camera.  then i point this contraption toward the
> >> diamond
> >> or whatever, and put the povray camera inside the contraption pointing
> >> toward the white surface.  then of course when the image is rendered I
> >> flip
> >> it horizontally and vertically.
> > Overkill.
> >>
> >> will this work?
> > Maybe.
> >> is it necessary?
> > NO!
> >>
> >>
> > Whenever you add dispersion you get coloured difraction. If the camera
> > see, directly or not, the dispersing object, you'll see the colours. You
> > don't need photons for that. Photons will make the caustics that hit
> > some surface coloured also.
> > To see the colours, you need an interior block like:
> >
> > interior{ior 2.5 dispersion 1.2}
> >
> > Here,the default dispersion_samples of 7 is unualy enough.
> > Diamond's ior is about 2.5 and it have a relatively strong dispersion,
> > over done here.
> > If the diamond is "free floating", that's all you need.
> > If the diamond is resting on something, and you want to see the effect
> > on that surface, THEN you need photons:
> >
> > object{Diamond interior{ior 2.5 dispersion 1.1 dispersion_samples
> > 15}photons{target refraction on difraction on collect off}}
> >
> > A larger number of dispersion samples is needed to get smooth coloured
> > caustics unless very close to the diamond.
> > You don't need to add a photons block to the light_source, nor to the
> > surface.
> >
> I forgot, you should add:
> finish{specular 0.8 roughness 0.0001} or the light won't cause any highlight.
> Very small roughness value due to the diamond's very hard and smooth surface.
>
> --
> Alain
> -------------------------------------------------
> Why do psychics have to ask you for your name?

oh, thanks for the info, but i'm not actually doing a diamond
i'm going to make a glass christmas tree. with branches, subbranches, and
needles.  many many needles.  not next to a surface.

what would be the best settings for that? (i want it as realistic as
possible, preferably the same ray could refract through many objects, if
that's possible)

it's ok if it takes a week to render.

and what ARE photons useful for?


Post a reply to this message

From: Alain
Subject: Re: how to make a diamond sparkle?
Date: 16 Oct 2007 22:26:18
Message: <471572ca$1@news.povray.org>
inhahe nous apporta ses lumieres en ce 2007/10/16 16:03:
> Alain <ele### [at] netscapenet> wrote:
>> Alain nous apporta ses lumieres en ce 2007/10/16 11:57:
>>> inhahe nous apporta ses lumieres en ce 2007/10/16 05:18:
>>>> I'm not an advanced user of POVRay, but I thought only advanced users
>>>> would
>>>> be knowledgeable enough to answer my question.
>>>>
>>>> i want to do refraction where colors are separated, like in the prism
>>>> effect.  afaik the feature that does this is photon mapping.  but from a
>>>> little bit of reading I get the impression that photon mapping would only
>>>> project colors onto surfaces, not onto the camera.  so, e.g. if i
>>>> created a
>>>> diamond i wouldn't see it shine with various colors.
>>>>
>>>> but i had an idea.  let's say I create a white surface, with a
>>>> lens-shaped
>>>> refracting object in front of it, and put a black box around it except
>>>> for
>>>> the lens, like a camera.  then i point this contraption toward the
>>>> diamond
>>>> or whatever, and put the povray camera inside the contraption pointing
>>>> toward the white surface.  then of course when the image is rendered I
>>>> flip
>>>> it horizontally and vertically.
>>> Overkill.
>>>> will this work?
>>> Maybe.
>>>> is it necessary?
>>> NO!
>>>>
>>> Whenever you add dispersion you get coloured difraction. If the camera
>>> see, directly or not, the dispersing object, you'll see the colours. You
>>> don't need photons for that. Photons will make the caustics that hit
>>> some surface coloured also.
>>> To see the colours, you need an interior block like:
>>>
>>> interior{ior 2.5 dispersion 1.2}
>>>
>>> Here,the default dispersion_samples of 7 is unualy enough.
>>> Diamond's ior is about 2.5 and it have a relatively strong dispersion,
>>> over done here.
>>> If the diamond is "free floating", that's all you need.
>>> If the diamond is resting on something, and you want to see the effect
>>> on that surface, THEN you need photons:
>>>
>>> object{Diamond interior{ior 2.5 dispersion 1.1 dispersion_samples
>>> 15}photons{target refraction on difraction on collect off}}
>>>
>>> A larger number of dispersion samples is needed to get smooth coloured
>>> caustics unless very close to the diamond.
>>> You don't need to add a photons block to the light_source, nor to the
>>> surface.
>>>
>> I forgot, you should add:
>> finish{specular 0.8 roughness 0.0001} or the light won't cause any highlight.
>> Very small roughness value due to the diamond's very hard and smooth surface.
>>
>> --
>> Alain
>> -------------------------------------------------
>> Why do psychics have to ask you for your name?
> 
> oh, thanks for the info, but i'm not actually doing a diamond
> i'm going to make a glass christmas tree. with branches, subbranches, and
> needles.  many many needles.  not next to a surface.
> 
> what would be the best settings for that? (i want it as realistic as
> possible, preferably the same ray could refract through many objects, if
> that's possible)
Whenever a ray don't hit an opaque surface and max_trace_level have not been 
reached and adc_bailout have not kicked in, the ray will continue.

Set max_trace_level 256 in the global settings block (256 is the maximum 
supported value):
glabal_settings{max_trace_level 256 adc_bailout 1/128}
adc_bailout have been raised to double it's default value, it can prevent black 
pixels and will accelerate the rendering somewhat.
With that setting, a ray can encounter up to 256 surfaces, and may get split as 
many times...
Add an interior with an ior of 1.5 for glass and a realistic dispersion of 
around 1.01 to 1.06.

Bind the whole glass tree in a single union and apply the folowing to that 
union. This will save memory and can gain some speed, it's also easier to maintain.
Set a texture similar to: (adjust as you please using only a subset of the tree)

texture{
	pigment{rgbft<1,1,1,0.3,0.6>}
	finish{ambient 0 diffuse 0.2 specular 0.7 roughness 0.01
		reflection{0.1, 0.7 fresnel}
		conserve_energy}
	}
interior{fade_color<0.9, 0.97, 0.93>fade_distance 6 fade_power 1001
	ior 1.5 dispersion 1.03 dispersion_samples 9}

The glass is never totaly transparent, it often is very slightly greenish.

If you REALY have lots of time, you can replace the union with merge. It will 
remove the internal faces but will make the rendering time skyrocket. In your 
case, the internal surfaces will possibly be unnoticeable.

A time saver:
Only put the needles near the tips of the branches, real trees have almost no, 
or no needles near the trunk. Remove most needles situated on the rear part of 
the tree, as they will probably not be visible or be lost among all those 
reflections and reflections.
To many needles could ruin the effect, put less needles than in a real tree, 
probably as low as 1 third, or even slightly less. This could give you a beter, 
more pleasant image.
Keep the shape of the needles simple, a simple cylinder chould be all you need.

If you place the camera very close to the tree, only use more "realistic" 
needles near the camera.

> 
> it's ok if it takes a week to render.
> 
> and what ARE photons useful for?
> 
> 
They are made to show physicaly acurate caustics as those projected by 
reflective and transparent objects.
Render the folowing sample scene twice, once as is, then after uncommenting the 
photons block in global_settings, and see the difference:

global_settings{
//photons{spacing 0.01} // uncomment this line to enable photons
}
light_source{<10,3,-12> color rgb 1}
plane{y, 0 pigment{rgb 1}} // to show the photons
cylinder{0, y, 5 open // so that the inside can be seen
	texture{pigment{rgb 1}finish{reflection 1}}
	photons{target reflection on}}
camera{location<0,7,-10>look_at 0} //looking down at the center of the cylinder


-- 
Alain
-------------------------------------------------
   My wife is such a bad cook, in my house we pray after the meal.
   	Rodney Dangerfield


Post a reply to this message

From: inhahe
Subject: Re: how to make a diamond sparkle?
Date: 27 Oct 2007 07:15:01
Message: <web.47231c9df316803055f67db50@news.povray.org>
Thanks. For crystal or diamond, what should I change, if anything other than
IOR?


Post a reply to this message

From: Jan Dvorak
Subject: Re: how to make a diamond sparkle?
Date: 27 Oct 2007 09:32:37
Message: <47233df5@news.povray.org>
inhahe napsal(a):
> Thanks. For crystal or diamond, what should I change, if anything other than
> IOR?
> 
> 
> 
> 
> 
IOR, dispersion, fade_color, surface properties...


Post a reply to this message

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