POV-Ray : Newsgroups : povray.general : Iridescence code Server Time
1 Mar 2024 18:31:57 EST (-0500)
  Iridescence code (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Bald Eagle
Subject: Iridescence code
Date: 21 Dec 2023 15:45:00
Message: <web.6584a34d1626f6071f9dae3025979125@news.povray.org>
Does anyone know how to implement the irid {} feature in the finish {} block of
a texture?

Or to be more accurate, how do I get iridescence to be visible on a clear
surface?

clipka posted some beautiful bubbles, and I can't seem to achieve anything close
to the transparent but well-defined iridescent pattern that he gets.

I tried adding interior {ior 1.4} but that didn't work (and I get weird
artefacts}

http://news.povray.org/povray.binaries.images/thread/%3C4ed6f24c@news.povray.org%3E/

I looked in the distro, and it appears that we're missing an example scene for
this feature.

- BW


Post a reply to this message


Attachments:
Download 'bubblecurvature.png' (141 KB)

Preview of image 'bubblecurvature.png'
bubblecurvature.png


 

From: jr
Subject: Re: Iridescence code
Date: 21 Dec 2023 16:10:00
Message: <web.6584a971f07d5fbb7f6d9cf76cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Does anyone know how to implement the irid {} feature in the finish {} block of
> a texture?
>
> Or to be more accurate, how do I get iridescence to be visible on a clear
> surface?
>
> clipka posted some beautiful bubbles, and I can't seem to achieve anything close
> to the transparent but well-defined iridescent pattern that he gets.
>
> I tried adding interior {ior 1.4} but that didn't work (and I get weird
> artefacts}

"sideways thought", no idea re iridescence :-).  wondering if messing with the
(file) gamma will not get you the "punchier" look.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Iridescence code
Date: 21 Dec 2023 22:55:00
Message: <web.658507f4f07d5fbb1f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> "sideways thought", no idea re iridescence :-).  wondering if messing with the
> (file) gamma will not get you the "punchier" look.

Oh, it definitely darkens the bubbles, but didn't really give me that
"transparent glass" effect.

So I went a-lookin' into the drop-down insert menu under
textures and materials | mirrors and glasses | window glass no ior

And modified that a bit.
Still sucked, but I could tell it was better.

Then, as with many things, it struck me that the object likely needs a suitable
environment to interact with, rather than my usual ultra-lazy white sky_sphere.

So plopped in a pre-made scene setup, and it looked WAY better.

A wee bit more tweaking, and it's looking pretty much where I'd like it to be.


 texture {
  pigment {rgbft <0.98, 0.98, 0.98, 0.5, 0.2>}
  finish {
   diffuse 0.1
   specular 0.8
   reflection 0.2 roughness 0.0003
   irid {1 thickness 0.4 turbulence 0.75}
  }

 }

The f and t values really have a profound effect on the look, and need to be
balanced to achieve the effect one desires.

- BW

Also:


While I was searching for an answer, I happened upon a very interesting approach
by Anders Kaesorg at:
https://www.quora.com/Can-there-be-a-bubble-cube-Is-it-possible-to-form-a-perfect-cubical-compartment-in-a-free-floatin
g-bubble-i-e-no-wires-etc-perhaps-by-simply-merging-six-equally-sized-bubbles/answer/Anders-Kaseorg

His texture is procedurally generated with a loop, and the single frame that I
rendered took a while.




// Anders Kaseorg <and### [at] mitedu>

#version 3.7;
#include "colors.inc"
#include "skies.inc"
#include "transforms.inc"

global_settings {assumed_gamma 1}

camera {
  sky z
  direction -x
  right -image_width/image_height*x
  location <9, 5, 3>
  look_at 0
  angle 30
}

light_source {<10, -10, 20> color White parallel point_at 0}
sky_sphere {S_Cloud1 rotate 90*x}
plane {z, -3 pigment {color Black}}

#declare Bubble = texture {
  aoi
  texture_map {
    #for (I, 1/256, 1 - 1/256, 1/256)
      #local T = exp(-0.05/abs(cos(I*pi)));
      [I
       pigment {rgbt <0.7, 1, 0.7, T>}
       finish {
         reflection {1 - T}
         specular 10*(1 - T)
         roughness 0.001
         irid {0.5 thickness 0.5 turbulence 0.5}
       }]
    #end
  }
};

union {
  #declare K = sqrt(5);
  intersection {
    sphere {K*x, K*sqrt(2)}
    sphere {-K*x, K*sqrt(2)}
    sphere {K*y, K*sqrt(2)}
    sphere {-K*y, K*sqrt(2)}
    sphere {K*z, K*sqrt(2)}
    sphere {-K*z, K*sqrt(2)}
  }
  merge {
    sphere {x, sqrt(2)}
    sphere {-x, sqrt(2)}
    sphere {y, sqrt(2)}
    sphere {-y, sqrt(2)}
    sphere {z, sqrt(2)}
    sphere {-z, sqrt(2)}
  }
  #declare O = plane {
    x + y, 0
    clipped_by {
      difference {
        sphere {x, sqrt(2)}
        sphere {-K*x, K*sqrt(2)}
        plane {x + z, 0}
        plane {x - z, 0}
      }
    }
  };
  object {O rotate <0, 0, 0>}
  object {O rotate <0, 0, 90>}
  object {O rotate <0, 0, 180>}
  object {O rotate <0, 0, 270>}
  object {O rotate <90, 0, 0>}
  object {O rotate <90, 0, 90>}
  object {O rotate <90, 0, 180>}
  object {O rotate <90, 0, 270>}
  object {O rotate <270, 0, 0>}
  object {O rotate <270, 0, 90>}
  object {O rotate <270, 0, 180>}
  object {O rotate <270, 0, 270>}

  hollow

  transform {Axis_Rotate_Trans(<1, -1, 1>, clock*120)}
  texture {Bubble}
}


Post a reply to this message


Attachments:
Download 'bubblecurvature.png' (979 KB)

Preview of image 'bubblecurvature.png'
bubblecurvature.png


 

From: William F Pokorny
Subject: Re: Iridescence code
Date: 21 Dec 2023 23:30:53
Message: <658510fd$1@news.povray.org>
On 12/21/23 15:42, Bald Eagle wrote:
> I looked in the distro, and it appears that we're missing an example scene for
> this feature.

.../textures/pigments/irid.pov

I'm no expert, but looks like you've figured things out from your most 
recent post.

Aside: I've never had much luck setting diffuse to larger values as you 
recently, elsewhere suggested - and as suggested by others in the past. 
With most finish{} contributions, you have to leave room in the totaled 
'color response' for the finish contributions for them to be seen. Room 
before the totaled color contributions turn white (in most outputs).

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Iridescence code
Date: 22 Dec 2023 07:00:00
Message: <web.6585791cf07d5fbb1f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 12/21/23 15:42, Bald Eagle wrote:
> > I looked in the distro, and it appears that we're missing an example scene for
> > this feature.
>
> .../textures/pigments/irid.pov

Oh, right - I forgot about that - I had found that, looked at the rendered
thumbnail, SDL code, and it just wasn't what I was looking for - so I mentally
discarded it.

It was also hard to find, since clipka moved it into the finish {} block, so
that's where I was looking.

> I'm no expert, but looks like you've figured things out from your most
> recent post.
>
> Aside: I've never had much luck setting diffuse to larger values as you
> recently, elsewhere suggested - and as suggested by others in the past.
> With most finish{} contributions, you have to leave room in the totaled
> 'color response' for the finish contributions for them to be seen. Room
> before the totaled color contributions turn white (in most outputs).

That could certainly pose a challenge for many people.
It wouldn't be a bad idea to:
1. Put something in the docs about that.
2. Have a better example scene, with some code commentary to that effect
3. Have a ready-made drop-down insert menu code snippet
4. move (or add) the example code to the finish subdirectory

Also, since it's not a feature that seems to enjoy extensive use, perhaps
consider issuing a warning when irid {} gets implemented in a texture statement
with a high diffuse value. (What is the function range of irid, anyway?}

Also, that seems to be a fairly frequent problem when implementing features with
values that can overrun the 0-1 range.
We have a lot of nuisance warnings in the code like suspicious color value after
rgb, and the scaling by 0 one, so maybe a "rgbft value out of range" warning
might help debug some of the less-obvious problems.

Aside from the future modification of source code, maybe there's a way to make
some example scenes, or a spreadsheet or something, that would help illustrate
the domains and ranges of functions/algorithms/features of POV-Ray and allow the
user to graph their potential interaction and flag problems.

(having the rgbft values visible in some way to SDL would be an interesting
feature too.  Not sure how that could be implemented, since that would be a
surface phenomenon wrt patterns and light-source dependent features like aoi,
irid, etc.  It would also have to be a render-time implementation.  All I can
think of is maybe enable a feature whereby flagged value pixels gets rendered
differently, or logged to a render stats text file, or.....)

Yes, POV-Ray is a raytracer, but as we know, people use it for way more than
that, esp in the math and science communities.

- BW


Post a reply to this message

From: Alain Martel
Subject: Re: Iridescence code
Date: 22 Dec 2023 09:57:26
Message: <6585a3d6$1@news.povray.org>
Le 2023-12-21 à 15:42, Bald Eagle a écrit :
> Does anyone know how to implement the irid {} feature in the finish {} block of
> a texture?
> 
> Or to be more accurate, how do I get iridescence to be visible on a clear
> surface?
> 
> clipka posted some beautiful bubbles, and I can't seem to achieve anything close
> to the transparent but well-defined iridescent pattern that he gets.
> 
> I tried adding interior {ior 1.4} but that didn't work (and I get weird
> artefacts}
> 
> http://news.povray.org/povray.binaries.images/thread/%3C4ed6f24c@news.povray.org%3E/
> 
> I looked in the distro, and it appears that we're missing an example scene for
> this feature.
> 
> - BW

You just need to remember that iridescence acts pretty much the same way 
as emissive media : It adds to whatever is behind it. So, it tend to not 
show on white surfaces.


Post a reply to this message

From: Droj
Subject: Re: Iridescence code
Date: 22 Dec 2023 10:20:00
Message: <web.6585a827f07d5fbbdec7f1e73b2af915@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Does anyone know how to implement the irid {} feature in the finish {} block of
> a texture?
>
> Or to be more accurate, how do I get iridescence to be visible on a clear
> surface?
>
> clipka posted some beautiful bubbles, and I can't seem to achieve anything close
> to the transparent but well-defined iridescent pattern that he gets.
>
> I tried adding interior {ior 1.4} but that didn't work (and I get weird
> artefacts}
>
> http://news.povray.org/povray.binaries.images/thread/%3C4ed6f24c@news.povray.org%3E/
>
> I looked in the distro, and it appears that we're missing an example scene for
> this feature.
>
> - BW

Hi,

there is an example in the Povray documentation:
scenes\textures\pigments\irid.pov.

I 'misused' it and added some finish_items.

Maybe it helps a bit.

Cheers Droj


Post a reply to this message


Attachments:
Download 'irid_clear.pov.txt' (4 KB)

From: Robert McGregor
Subject: Re: Iridescence code
Date: 23 Dec 2023 15:40:00
Message: <web.65874570f07d5fbb87570eabd4644d08@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Does anyone know how to implement the irid {} feature in the finish {} block of
> a texture?
>
> Or to be more accurate, how do I get iridescence to be visible on a clear
> surface?
>
> clipka posted some beautiful bubbles, and I can't seem to achieve anything close
> to the transparent but well-defined iridescent pattern that he gets.
>
> I tried adding interior {ior 1.4} but that didn't work (and I get weird
> artefacts}
>
> http://news.povray.org/povray.binaries.images/thread/%3C4ed6f24c@news.povray.org%3E/
>
> I looked in the distro, and it appears that we're missing an example scene for
> this feature.
>
> - BW

Here's a bubble material that I came up with back in 2012, after clipka did a
bug fix on the old irid code:

#declare M_Bubble = material {
   texture {
      pigment { rgbt 0.99 }
      finish {
         diffuse 0
         reflection { 0.05, 1 fresnel on }
         specular 0.99 roughness 0.001
         conserve_energy
         irid { 0.25
            thickness 0.25
            turbulence 1.2
         }
      }
   }
   interior { ior 1.001 }
}


Post a reply to this message


Attachments:
Download 'lucy_bubble2012.png' (2280 KB)

Preview of image 'lucy_bubble2012.png'
lucy_bubble2012.png


 

From: Bald Eagle
Subject: Re: Iridescence code
Date: 23 Dec 2023 16:00:00
Message: <web.65874a06f07d5fbb1f9dae3025979125@news.povray.org>
"Robert McGregor" <rob### [at] mcgregorfineartcom> wrote:

> Here's a bubble material that I came up with back in 2012, after clipka did a
> bug fix on the old irid code

Yes, I remember that scene.
It's amazing how one can completely transform the feel and perceived complexity
of an object with the proper texture.
Thanks for posting that as a reminder and providing the texture.

Is that an HDRI light probe you're using?  Radiosity?

Droj just posted his version, and with just a black background, it looked ---
like poop.

But then I just pasted in the simple ground & sky code, and it magically
transformed the exact same texture into beautiful shimmering bubbles!
It truly is an amazing transformation.

I'm betting that if I take your beautiful texture and render with a poor
environment, I would make that look like oil on mud too. The environment is what
gives it life.

- BW


Post a reply to this message

From: Cousin Ricky
Subject: Re: Iridescence code
Date: 23 Dec 2023 23:40:00
Message: <web.6587b58ff07d5fbb60e0cc3d949c357d@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> clipka posted some beautiful bubbles, and I can't seem to achieve anything close
> to the transparent but well-defined iridescent pattern that he gets.
>
> I tried adding interior {ior 1.4} but that didn't work (and I get weird
> artefacts}

Do the artifacts look like refraction distortions?  Bubbles are not solid
spheres, but hollow thin shells, so if you put an IOR on bubbles, you would have
to model them accordingly.


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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