POV-Ray : Newsgroups : povray.binaries.images : The Colony Ship : Re: The Colony Ship Server Time
8 Jul 2024 00:31:20 EDT (-0400)
  Re: The Colony Ship  
From: clipka
Date: 14 Feb 2016 15:17:11
Message: <56c0e0c7@news.povray.org>
Am 14.02.2016 um 20:50 schrieb Sven Littkowski:
> Hi Alain, not sure if I understood.
> 
> You're saying, that I could use a full-color image as heightfield? Like
> the same file for texture and heightfield? But I am thinking, a texture
> that shows green meadows and brown (soil) paths through them, would give
> me the accurate heights. But maybe I am misunderstanding.
> 
> Or do you mean, instead of a gray-scale image, I should use a red-scale
> image (or green-scale, or blue-scale)? Can you explain in easier words
> for me, or give me a sample image? Thanks.

Alain is saying the following:

- You are currently using a grayscale image.

- When evaluating a grayscale image, for the sake of functionality it is
irrelevant whether you evaluate the .red, .blue or .green component, or
the .gray pseudo-component, because in a grayscale image they are
guaranteed to all have the same value.

- Using the .gray pseudo-component comes at a performance disadvantage,
because it evaluates the .red, .blue AND .green components, then
computes a weighted average of them.

=> You should use .gred (or .blue or .green) instead of .gray in your code.


(The above is true even if the input image is a true grayscale image
having a single brightness channel instead of three colour channels,
because image format details like number of channels are abstracted away
at a very low level, and POV-Ray always uses a 4-channel RGBA interface
when evaluating an image_map.)


Post a reply to this message

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