POV-Ray : Newsgroups : povray.advanced-users : Lighted vs unlighted texture : Re: Lighted vs unlighted texture Server Time
2 May 2024 13:31:19 EDT (-0400)
  Re: Lighted vs unlighted texture  
From: Kenneth
Date: 16 May 2017 18:05:00
Message: <web.591b77376a9a8b37883fb31c0@news.povray.org>
Some hypothetical 'thought-questions':

1) What should happen if there are multiple light sources in the scene, coming
from different directions? One light will be filling in some of the shadow areas
produced by another light; in which case, what constitutes a true shadow?

2) Using only ONE light for simplicity's sake, and a spherical object, should
the 'fading light/shadow terminator' line on that shape be a continuous blend of
both textures, as the light 'disappears' into shadow around the side of the
sphere?

Off the top of my head, here are some (incomplete) thoughts about a possible
approach, when using only ONE light source-- and based on a 4-pass render!! The
scene is first rendered only in greyscale (with white pigments on everything.)
THEN the scene is rendered again with the FIRST real texture on all objects.
Then again with the SECOND real texture. At this point, you have three rendered
images.

The greyscale image is then run through POV-Ray again, using eval_pigment() to
get its grayscale values (1.0 for pure white, 0.0 for pure black, and all grey
values in-between.) Those values are somehow(!) used to pick which of the two
REAL-textured images to apply to a NEW re-rendered 2-D copy of the image, on a
pixel-by-pixel basis. Using lots of tiny flat boxes or polygon shapes for this.
(A function of some kind might be handy for doing this.) The 3-D scene is not
actually rendered again. In effect, this last step is just post-processing.
(I've actually done this for other kinds of scenes-- for example, to get a
pre-rendered image to explode into animated fragments.)

Actually, I can already see that this approach as-is would not produce the
correct *darkening* of the textures in the shadow areas. Maybe the eval_pigment
values could be used for that too.

--- Admittedly, this technique isn't much different from taking the three images
into Photoshop and using greyscale alpha masks to blend the images together.---


Post a reply to this message

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