#version 3.7; #declare RAD = 4; global_settings { assumed_gamma 1 max_trace_level 5 noise_generator 2 #if(RAD > 0) radiosity { pretrace_start 0.08 pretrace_end 0.04/RAD count 60*RAD nearest_count min (20, RAD) error_bound 2/RAD low_error_factor 0.5 recursion_limit 1 gray_threshold 0 minimum_reuse 0.015 brightness 1 adc_bailout 0.005 normal on media off always_sample off } #end } #include "stdinc.inc" camera { location <0,0,-2.5> look_at <0,0,0> right x*4/3 up y angle 50 } #declare fac = 0.5; sky_sphere { pigment { average pigment_map { [1 function {max (min (y, 1), 0)} color_map { [0 srgb fac*2.35] [0.96 srgb fac*4.5] [1 srgb fac*13.5] } ] [1 function {max (min (y, 1), 0)} turbulence 0.2 color_map { [0 srgbt 1] [0.5 srgbt ] } rotate z*-45 ] } } } #macro CRGB2HSL (Color) // Construct hsl from rgb #local Color = color Color; #local R = (Color.red); // Extract Red, Green and Blue components #local G = (Color.green); #local B = (Color.blue); #local MIN = min (R, min (G, B)); // Find minimum and maximum component of RGB #local MAX = max (R, max (G, B)); #local L = (MAX+MIN)*0.5; // Find Lightness #if (L <= 0 | L >= 1) #local HSL = <0,0,min (1, max (0, L))>; #else // Find Saturation #local S = (MAX-MIN)/(L < 0.5 ? (L*2) : (2-L*2)); #if (S <= 0) #local HSL = <0,0,L>; #else #local SR = (R-MIN)/(MAX-MIN); // Find fully saturated version of Red, Green and Blue #local SG = (G-MIN)/(MAX-MIN); #local SB = (B-MIN)/(MAX-MIN); #if (SB = 0) // Construct Angle from SR, SG and SB #if (SR = 1) #local Angle = (SG)*60; #else #local Angle = (1-SR)*60+60; #end #end #if (SR = 0) #if (SG = 1) #local Angle = (SB)*60+120; #else #local Angle = (1-SG)*60+180; #end #end #if (SG = 0) #if (SB = 1) #local Angle = (SR)*60+240; #else #local Angle = (1-SB)*60+300; #end #end #local HSL = ; #end #end #end //________________________________________________________________________________________________ #declare image_width_ = 3375; // 3375 for John Wick 3, 2700 for Deadpool 2 #declare image_height_ = 1898; // 1898 for John Wick 3, 4000 for Deadpool 2 #declare image_width_Old = image_width_; #declare image_ratio = image_width_/image_height_; #declare image_height_Old = image_width_Old/image_ratio; #declare pig_map = function { pigment { image_map {jpeg "john-wick-3-parabellum-poster-qf"} // http://hdqwalls.com/wallpapers/john-wick-3-parabellum-poster-qf.jpg //image_map {jpeg "deadpoolsmall-1525695071"} // https://abcmoviesdownloadc.files.wordpress.com/2018/10/deadpoolsmall-1525695071.jpg scale } } #declare hsl4 = union { #declare nx = 0; #while (nx < image_width_) #declare ny = 0; #while (ny < image_height_) #declare paint_pig = pig_map (nx+0.5,ny+0.5,0); #declare paint_hsl = CRGB2HSL (); sphere { 0, 2/image_width_ texture { pigment {color srgb paint_pig} finish {diffuse albedo 0.75} } translate rotate <0,paint_hsl.x*360,0> } #declare ny = ny+1; #end #declare nx = nx+1; #debug concat (str (nx/image_width_*100, 0, 1)," % processed \n") #end } object {hsl4 rotate x*-90}