Colorshift Reflected or Scattered Light?

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
DeadCenterSoul
Posts: 4
Joined: Wed Sep 18, 2019 6:58 pm

Colorshift Reflected or Scattered Light?

Post by DeadCenterSoul »

A new user of LuxCoreRender in blender, I am coming to the forum for guidance on how to color-shift reflected light (as in, from a mirror) or scattered light (as in, from a homogeneous scattering volume).

As an example, one might want a reflection of "green" light whose intensity is proportional to that of incident "red" light from a mirrored object. Alternatively, one might like to scatter "red" light, but to show the scattered light as "green." And so forth. The idea would seem to involve some kind of custom shader that involves color-swapping or something of that sort, but I am not sufficiently familiar with the available node items or options to make these things happen. Can they be done?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Colorshift Reflected or Scattered Light?

Post by Dade »

It isn't currently possible, mostly because it has never been asked before. I don't think there is any material in reality working in the way you described :?: It is a bit strange.
Support LuxCoreRender project with salts and bounties
DeadCenterSoul
Posts: 4
Joined: Wed Sep 18, 2019 6:58 pm

Re: Colorshift Reflected or Scattered Light?

Post by DeadCenterSoul »

Thank you very much, Dade, for taking a moment to answer. Your reply, though not what I wanted to read, is helpful, insofar as it knocks me out of orbit around the idea that I wanted to use in my model cases. If it can't be done, it can't be done.

I understand from your reply that the interaction of light with scattering or reflective materials in Luxrender should be thought of as a subtractive process, insofar as spectral colors that are not originally present in incident (e.g. white) light can neither be volumetrically scattered nor surface reflected. I think I understand from your reply that colors can only be predominantly scattered or reflected, if they are originally present in the incident light spectrum (as in the case of "white" light, containing, say, "red"). Is that right?

Having said that, I will mention the cases of frequency upconversion or down-conversion (such as in fluorescence) in certain materials. The example of laser comes to mind, in which low-frequency (e.g. IR) light is incident upon a crystal (examples include lithium niobate (LiNbO3), potassium titanyl phosphate (KTP = KTiOPO4), and lithium triborate (LBO = LiB3O5)) to produce light whose color corresponds to a higher (doubled) frequency. I am unaware of any real-world "mirror" that works like this to achieve the stunt that I have hoped to achieve in Blender, but the general idea of outputting light whose intensity is driven by that of incident light but whose color is different is not completely unheard of.

May I please ask, what might you (or anyone) recommend, if I want to shine some light onto a surface within a homogeneous scattering volume, and to see volumetric scatter of the reflected light but not to see any scattering of the incident light? Perhaps there is another method that I just don't know about? I'm really stuck... :|
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Colorshift Reflected or Scattered Light?

Post by kintuX »

Yes, would be nice to have.
Along with refraction colour for replicating Dichroic Glass.
Most likely... or better, hopefully the "next chapter". Since PSR/SDS solution is already in the works.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Colorshift Reflected or Scattered Light?

Post by Dade »

DeadCenterSoul wrote: Sat Sep 21, 2019 1:38 am I understand from your reply that the interaction of light with scattering or reflective materials in Luxrender should be thought of as a subtractive process
It is a multiplicative process in general (glass dispersion aside), the incoming light spectrum is multiplied by the material/volume BSDF (Bidirectional scattering distribution function) evaluation to obtain the spectrum output. This is the reason why you can not swap channels as you need at the moment.
DeadCenterSoul wrote: Sat Sep 21, 2019 1:38 am May I please ask, what might you (or anyone) recommend, if I want to shine some light onto a surface within a homogeneous scattering volume, and to see volumetric scatter of the reflected light but not to see any scattering of the incident light? Perhaps there is another method that I just don't know about?
I don't sincerely understand what do you exactly need :?: Do you want only the light scattered by the volume but not by the surface within ? Do you want to evaluate the amount of light scattered by the volume ? The description of the scene you need to render may help to clarify what you are looking for.
Support LuxCoreRender project with salts and bounties
DeadCenterSoul
Posts: 4
Joined: Wed Sep 18, 2019 6:58 pm

Re: Colorshift Reflected or Scattered Light?

Post by DeadCenterSoul »

Thank you, Dade, for kindly giving your thoughts. Yes, my inquiry may be off the beaten path. And I may have been too vague; so I can describe my circumstance better, at the expense of more tedious detail. I hope this will be useful to other LuxCoreRender users, though I cannot be certain that it will be. I feel like a :geek: for posing this. Nevertheless, I'll do the best I can to explain why I have troubled others with the question. You see...

1. In my model case, I have a very irregular mirrored surface to study. The mirror is non-planar in many directions and on many scales. In the real world, it represents a physical surface whose reflection characteristics are important to my work in one branch of physics.

2. Naturally, I cast light on the mirror in a number of ways to study its "performance." If there were some other way to study the mirror performance in Blender, I would give that a try. I'll say more about that later...

3. One illumination case of particular interest involves an area light that casts parallel (0 degree spread angle) light toward the mirror. Another case turns the area light into a thin sheet of light, shown at the mirror. Another case involves an array of "laser"-like parallel emitters that hit the mirror. Another case involves flooding the space near the mirror surface with omni-directional light. For the sake of visualization and for the sake of this discussion, please imagine a rectangular emitter of light shining vertically-down at the mirror under study.

4. So, the goal is to visualize what happens to the light after it leaves the mirror. For all practical purposes, reflection. I am interested in light paths after reflection from the surface... but not before.

5. I need the lamp, only for the purpose of generating light from the mirror surface that obeys the law of reflection. If it were somehow possible to emit light from the surface of my mirror that would behave as if it were reflected according to that law, I would skip the lamp source altogether. I only want to visualize the light path after it leaves the mirror surface. I would guess that this stipulation that I have introduced is what makes my question unusual among Blender applications. Most applications do not require that a distinction between incident and reflected light be so draconian.

6. One way of visualizing light paths is to use volumetric scatter. I like this method as well as any that I have found. It lets me see how the light is distributed in space, including any local focusing effects (bright areas in the "fog"), after reflection from the mirror. If there were a way to "see" the light paths without actually scattering light and introducing all of the computational overhead with the scattering process, I would like that even better. 8-) Can we do that? I don't know of any way to get such a ray-tracing diagram...

7. As I have probably stated too many times (sorry), what I want is to see the volumetric scatter of light only after it leaves the surface of the mirror, without seeing the scatter of light from the lamp source itself. In other words, I don't want to see the light "coming down" from the source. I only want to see the light "going back up" from the mirror.

8. Finally, the requirements outlined above are the reason that I have hoped to be able to change the color of the light upon reflection - literally to re-define its spectral content after it bounces off the mirror. And why? You see, volumetric scatter gives us control over how light scatters, depending on its color. It gives the option of back-scatter, isotropic scatter and forward scatter... depending on the R,G,B content of the light! That's really convenient. And it underlies my question, however ill-conceived it is. My logic is that, if I have a scattering volume in Blender that only forward-scatters, say, "red" light, then I should never see any of that red light entering the camera in my render, unless the camera is looking directly at the light source. If my camera is off axis (which it always is), then no "red" light will be seen in the rendered volume scatter. So, taking my idea further, if I could tell the scattering algorithm to scatter only, say, "green" light, and if the reflected light from the mirror could be forced to be some other color, like green, no matter what the color of the incident light, then I would have a way to visualize only the reflected light as desired. Reflected light would scatter in my virtual "fog," whereas the source light would remain invisible. And that would be very helpful in my case.

So, Dade, there is my belabored description of what I'm really trying to do and why I am trying to do it. Hopefully, it provides better background and motivation for my question. I simply did not know whether the option exists to force reflected light to take-on a desired color, when I posed my original question. I think I have learned that the answer is "no." Too bad.

But... as I've mentioned, if I back-away from the question as posed and pose a slightly different, more general question, there might still be some way to do what I want and to get the end result that I am targeting for my study in Blender. That is: Is there some other way to visualize only reflected light from a mirrored surface? Or, is there some other way to eliminate the need for a lamp at all? Could I define my mirror as an emitter with emission that obeys some manually-defined relationship to the surface normal and the global coordinate system? Perhaps the answers to these questions are more important than the "colorshifting" question that I originally posed. I have no idea.

Thank you once again. :)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Colorshift Reflected or Scattered Light?

Post by Dade »

DeadCenterSoul wrote: Sat Sep 21, 2019 8:07 pm 1. In my model case, I have a very irregular mirrored surface to study. The mirror is non-planar in many directions and on many scales. In the real world, it represents a physical surface whose reflection characteristics are important to my work in one branch of physics.
You seem to describe a micro-facet model (http://www.pbr-book.org/3ed-2018/Reflec ... odels.html). This is usually the solution adopted for the kind of material in the rendering field. However you would have to write your custom material code for LuxCore.

Were you planning to model the irregular mirrored surface as geometry ? I mean inside Blender as a surface approximated by triangles ?
DeadCenterSoul wrote: Sat Sep 21, 2019 8:07 pm 6. One way of visualizing light paths is to use volumetric scatter. I like this method as well as any that I have found. It lets me see how the light is distributed in space, including any local focusing effects (bright areas in the "fog"), after reflection from the mirror. If there were a way to "see" the light paths without actually scattering light and introducing all of the computational overhead with the scattering process, I would like that even better. 8-) Can we do that? I don't know of any way to get such a ray-tracing diagram...
There may be some trick you could use: use laser light source perpendicular to the surface to study (use a laser radius as large as the surface). Place a large flat white plane parallel to the surface. Place a orthographic camera perpendicular to the large white plane.
You will able to observe the "density" of light on the white plane. It will be a bit like observing the ceiling of pool where light is reflected over water:

Image

There are some other trick you could use to "cheat" the volume system and to have scattering of light only after it is reflected on your surface but the above solution looks better to me :?:
Support LuxCoreRender project with salts and bounties
DeadCenterSoul
Posts: 4
Joined: Wed Sep 18, 2019 6:58 pm

Re: Colorshift Reflected or Scattered Light?

Post by DeadCenterSoul »

Dade, I appreciate your thoughtful reply.

1. Yes, I think the micro-facet model may be close to what I am doing. There is one difference that may be important. The ratio of the global surface size to that of the smallest feature or "micro-facet" is not so extreme in my case as in the examples referenced in your link. Still, I do see the similarity. My surface of interest is basically a "mirror" that is simultaneously... curvy, bumpy and jagged, with scattered, nearly-smooth regions here and there - not unlike a mountain terrain with regions of intervening plains or a microscopic metal surface with lots of scratches, as viewed, say, through an SEM.

2. Yes, your first suggestion is a good one for this topic. The method of using a "laser" light source is one that I have, in fact, put to good use in this study - along with that of an area light that has a zero-degree spread angle. In the former case, the aspect ratio of the "laser" source is unfortunately constrained to be 1:1 (unless I am mistaken) which is not always desirable for my model; so I haven't used it as much. Either case seems to provide parallel rays of light directed at the mirrored surface. Is there any important difference, under the hood, between a "laser" and an area light with zero-degree spread?

3. Finally, I like your suggestion of using a plane (essentially a "projector screen") also. Yes, I have used that method, exactly as you describe. I have placed the parallel-ray light source very near to the mirror (low to the surface) and have placed the flat-white plane further away (much higher above the surface), with a camera fixed on the plane (somewhere in between) in a location where the mirror and light source do not obscure the view of the plane. That does give us a nice representation of the light profile. The swimming-pool example is a great analogy.

Unless there are some other clever tricks to be considered, I think I have learned as much as I can in this topic with your kind help. I have learned that, no, we can't do the kinds of things that I was hoping to do with mirror reflections in LuxCoreRender, though there are a few workarounds. I don't know how much of a challenge it would be to allow for the kind of control that I have spoken of in future versions of LuxCoreRender with Blender, but it would be awesome to include it in the add-on feature set, if it is not too much trouble. The applications that come to mind are... several. 8-)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Colorshift Reflected or Scattered Light?

Post by Dade »

DeadCenterSoul wrote: Tue Sep 24, 2019 10:39 am 2. Yes, your first suggestion is a good one for this topic. The method of using a "laser" light source is one that I have, in fact, put to good use in this study - along with that of an area light that has a zero-degree spread angle. In the former case, the aspect ratio of the "laser" source is unfortunately constrained to be 1:1 (unless I am mistaken) which is not always desirable for my model; so I haven't used it as much. Either case seems to provide parallel rays of light directed at the mirrored surface. Is there any important difference, under the hood, between a "laser" and an area light with zero-degree spread?
There is some difference, for instance, a laser is a not intersectable light source (i.e. it is invisible) while an area light is visible (and obstruct the view). So, in your case, the laser may be better.

One is easier to render than the other for some render engine like Path tracing but it is not a factor if you stick to BiDir render engine (the slower and more complete/powerful render engine).
DeadCenterSoul wrote: Tue Sep 24, 2019 10:39 am I don't know how much of a challenge it would be to allow for the kind of control that I have spoken of in future versions of LuxCoreRender with Blender, but it would be awesome to include it in the add-on feature set, if it is not too much trouble. The applications that come to mind are... several. 8-)
LuxCore is mostly used in ArchiViz and for Photorealistic renderings and the features developed are usually prioritized according that kind of applications: you seem to have some very very specific requirements, it is the kind of stuff that is unlikely to be developed in a very near future.
Support LuxCoreRender project with salts and bounties
Post Reply