POV-Ray : Newsgroups : povray.general : Iridescence code : Re: Iridescence code Server Time
9 May 2024 16:56:48 EDT (-0400)
  Re: Iridescence code  
From: Bald Eagle
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


 

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