POV-Ray : Newsgroups : povray.binaries.images : Refraction is iffy through media, revisited Server Time
12 Sep 2025 18:12:42 EDT (-0400)
  Refraction is iffy through media, revisited (Message 1 to 1 of 1)  
From: Cousin Ricky
Subject: Refraction is iffy through media, revisited
Date: 6 Sep 2025 18:45:45
Message: <68bcb999$1@news.povray.org>
See
https://news.povray.org/povray.binaries.images/thread/%3C544aa501%241%40news.povray.org%3E/

This update uses recommendations by Bill Pokorny from my recent posts in
pbi and p.bugreports.  Interestingly, the changes broke the POV-Ray 3.6
renders, so there must have been some changes to media and photons
between 3.6 and 3.7.

---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
#version max (3.5, min (3.8, version));

global_settings
{ assumed_gamma 1
  max_trace_level 15
  photons { spacing 0.005 autostop 0 media 200 }
}

camera
{ orthographic
  location -28 * z
  right 28 * x
  up 21 * y
}

// Medium to reveal the path of the light beam:
box
{ -<9.99, 10.5, 0.05025>, <14, 10.5, 0.05025> hollow
  pigment { rgbt 1 }
  finish { specular 0 reflection 0 }
  interior
  { media
    { scattering { 1, 1 extinction 0 }
      samples 3, 3
      aa_level 2
    }
  }
  photons
  { #if (version < 3.7)
      pass_through
    #else
      target reflection on refraction on
    #end
    collect off
  }
}

// The light beam:
light_source
{ <-10, -10, 0>, rgb 10
  cylinder radius 0.025 falloff 0.05 point_at 0
  parallel point_at 0
  #if (version >= 3.7) media_interaction off #end
}

// Refracting block:
box
{ -1, 1 scale <5, 10, 0.05>
  hollow
  pigment { rgbf 1 }
  finish { reflection { 0 1 fresnel } conserve_energy specular 0.2 }
  interior { ior 1.5 }
  photons { target refraction on reflection on collect off }
}

// Environmental light to make the refracting block visible:
light_source
{ <-1, 1, -1> * 28000, rgb 1
  parallel point_at 0
  media_interaction off
  photons { reflection off refraction off  }
}

// Annotation
#declare Annot =
  text { ttf "cyrvetic" concat ("v", str (version, 0, 2)) 1, 0 }
object
{ Annot
  translate -max_extent (Annot) * y
  scale 7/5
  translate <-13.5, 10, -1>
  pigment { rgb 0.6 }
  finish { diffuse 0 ambient #if (version >= 3.7) 0 emission #end 1 }
}
--->%----->%----->%----->%----[END CODE]---->%----->%----->%----->%---


Post a reply to this message


Attachments:
Download 'unsplit_beam-by36.png' (5 KB) Download 'unsplit_beam-by37.png' (6 KB)

Preview of image 'unsplit_beam-by36.png'
unsplit_beam-by36.png

Preview of image 'unsplit_beam-by37.png'
unsplit_beam-by37.png


 

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