POV-Ray : Newsgroups : povray.binaries.images : Chromadepth scaling to model : Re: Chromadepth scaling to model Server Time
28 Apr 2024 03:06:43 EDT (-0400)
  Re: Chromadepth scaling to model  
From: Mike Horvath
Date: 17 Feb 2018 15:24:28
Message: <5a888f7c$1@news.povray.org>
I ended up using this:


// This script assumes the depth effect is *linear* from near to far, 
which may not be the case.
// red, white, blue
#macro MakeChromadepthTextureCameraRWB(CameraLocation, CameraLookAt, 
FudgePercent)
	#local FudgeMin = FudgePercent/100/2;
	#local FudgeMax = 1 - FudgePercent/100/2;
	pigment
	{
		spherical
		color_map
		{
			[0.0		color srgb <0,0,1>]
			[FudgeMin	color srgb <0,0,1>]
			[0.5		color srgb <1,1,1>]
			[FudgeMax	color srgb <1,0,0>]
			[1.0		color srgb <1,0,0>]
		}
	}
//	finish
//	{
//		ambient 1
//		diffuse 0
//	}
	scale vlength(CameraLocation - CameraLookAt) * 2
	translate CameraLocation
#end



I can shrink and grow the texture using the FudgePercent parameter. I 
think this is as close as I'll get.


Mike


Post a reply to this message

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