POV-Ray : Newsgroups : povray.general : Simulating Red and Blue Shift : Re: Simulating Red and Blue Shift Server Time
15 Jun 2024 09:59:45 EDT (-0400)
  Re: Simulating Red and Blue Shift  
From: Thomas de Groot
Date: 1 Apr 2015 03:33:01
Message: <551b9f2d@news.povray.org>
On 31-3-2015 22:31, Sven Littkowski wrote:
> I like both ideas:
> - transparent stars inside black image
> - medium inside cylinder
>
> But would a media not slow down the rendering? And it is only the stars that I
> want to change the colors from white to red and blue, not the black. But how
> would such a media be made? Can you give a sample code?

I was thinking about something like this (not tested) for a cylinder 
oriented along the z-axis:
cylinder {
   <0, -0.5, 0>,<0, 0.5, 0>, 1
   pigment {rgbt <0,0,0,1>}
   hollow
   interior {
     //redshift
     media {
       absorption <0,0,1>
       density {
         cylindrical
         density_map {
           [0 rgb 0]
           [1 rgb 1]
         }
       }
     }

     //blueshift
     media {
       absorption <1,0,0>
       density {
         cylindrical
         density_map {
           [0 rgb 0]
           [1 rgb 1]
         }
       }
     }
   }
   scale MyScale
}

it is possible to vary the absorption value of course as needed and/or 
use a density block inside the media

Drawback might be that you may not be able to use the two media at the 
same time as they coincide. You will have to build in a switch for when 
to use redshift or blueshift.

In terms of dropping render speed, that would be minimal. Scattering 
media is what influences speed most.


-- 
Thomas


Post a reply to this message

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