A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
Illumination to weight map
Posted: 02 May 2017 05:41 AM   [ Ignore ]  
Total Posts:  3
Joined  2009-11-22

Hi
is there a way to read out the illumination by a light on an object and transfer it to a Weight Map?
I tried to read the UVW Data of the PMatterWave Node which essentially does that. But i only get the Random Positions of the Particles.
I tried a basic Setup with The Raycollider Node but it is restricted to only one light and gets complex when i want the same Radius as the Light Cone. 
Thanks in Advance

Profile
 
 
Posted: 02 May 2017 01:03 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi formfrei,

I have two ways to do it, have a look. The first one discusses a little bit more the problems. With that said, later I show a very simple set up to get the data.

Baking the information for further refinement before use.
Some notes about this:
Use floating point formats to do so (Open EXR, Tiff 32bit/channel, etc. Radiance [HDR] is not a quality format and has only 4*8bit, avoid it!)
Set the mid gray point to 0.18, as this is the only possible stable value. There is no black or white point in HDRI; 100% is not white, it is where integer is clipped and lost all color information)
Set a max brightness when things might clip, e.g., 4.0 (400% in integer lingo), and normalize these values to 1.0 max, as the weight map can’t handle values over 1.0 to my knowledge (or 100%)

The Weight maps have no need for UV(W) data, as they are based on the vertices’ ID or “point-number”. So they store only that specific value.

The data taken from an image will of course be translated to sit on the vertices, if via projection or UV(W).

Some notes here:
The value taken from that image is mostly based, for a specific point from a small area of the image.
An image could be blurred or reduced in resolution to provide a more balanced read-out.
The blurred, averaged or down-sampled value will flatten the overall dynamic.

The simplest way would be to use the Shader Effector, and take the information given to the clones,

Scene File
https://www.amazon.com/clouddrive/share/rnHIGmxTL61ocG1QcLC5XeiaVB3OvDMj4fr8Qw4S5Fy?ref_=cd_ph_share_link_copy

The live version
With that all said and done, the base concerns about the representation of light stored in vertex maps can start with Thinking Particles.
Placing particles on each vertices and using the PLight.

Scene file:
https://www.amazon.com/clouddrive/share/gUeY3b7b0QMRbW0tVuyG0VHbcfpzhBibTteEjnOuKZk?ref_=cd_ph_share_link_copy

The particles could store the values in their channels, and being used then later for what ever reasons. Weight stores real values, MoGraph selection can store “boole” values, as in light on or not.

A simpler way would be to ignore particles and take only the PLight node, which needs only the position and light to evaluate the set up

Scene file:
https://www.amazon.com/clouddrive/share/IOlsC8Rlw9P3H1TncXeAJ4NCFfZkJYUY5FZST5U8fXm?ref_=cd_ph_share_link_copy

You might check out if Color or Intensity needs to be multiplied and normalized, as discussed above. Here is an option just color * intensity

Scene file:
https://www.amazon.com/clouddrive/share/OW2MwQDLxtkpcxzDIOxePFzjIUpWlz5ydMObyX89ZtH?ref_=cd_ph_share_link_copy

I placed the copy of that object into the scene to show the effect.

Screen-shot:
https://www.amazon.com/clouddrive/share/o77igWMXwcIjygH3vdzxk53JgBmYSNzpGr18NdulII?ref_=cd_ph_share_link_copy

All the best

P.S.: Since the position of the vertices doesn’t care about shadows, you might use the Normal Direction of the points to improve the set up. /edit

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 03 May 2017 07:27 AM   [ Ignore ]   [ # 2 ]  
Total Posts:  3
Joined  2009-11-22

Hello Dr. Sassi,

first of all thanks for your effort. I feel kind of honored to “talk” to you since i’ve followed your tutorials since i started C4d long time ago. And very often they saved my live wink.
The P light setup, without particles, is basically what i was searching for. It works very well but unfortunately it seems that it is restricted to one light as well.
To give you more information about the project:
I will have several lights in a room… let’s say roundabout 50 Spotlights in a Grid Array Cloner.
There is a nearly black textured moving Object in the room and everytime the Object gets light by one ore more lights the texture will change or the Object gets displaced in this area.
I thought of the Baking Texture Solution as well.
But since there are many shots and several people working on this Project, i am a little bit concerned of a huge Project size and confusion with name convention etc.
So i thought the Live Setup would be the best to go for.
I included the link to the setup which is based on your solution. I iterate a list of lights with the link list node but the P node only takes one light.
I added several Plight Nodes but when it comes to 50 or more it gets “a little bit” unflexible.
Thank You


https://www.dropbox.com/s/b9zf7zjzdicovth/Light_to_Weight_Map_A.c4d?dl=0

Profile
 
 
Posted: 03 May 2017 02:11 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi formfrei,

Very nice of you to say, I feel the same way, it is and was always a pleasure and an honor to be part of such a great group. All the questions I got since way over a decade, have tough me so much! Thank you.

Thanks as well for the file. It is always good to know what the original idea was, in terms of result.

Please have a look here;

Scene file:
https://www.amazon.com/clouddrive/share/xemX61cHEj9q3A7NXG3fSWuDuOkpjWneqK7ZiJp1Nvs?ref_=cd_ph_share_link_copy
file updated 11:22 PDT

The file _01 has only a single set up and more meant as a sketch to illustrate the idea.

The file _11 has 50 lights in it, and 50 Displacers. Each Light as well Displacer can be set up individually, as long as the light is set up to Spot. You will see instantly how it works, and instead of having the Weigh maps in the middle, it used the Displacer directly. The Falloff of the Displacer could be done also with a Source, which could be an object attached to the light.

I hope that will work for your set up. Let me know…

All the best

P.S.: here is a single Spot light set up with aspect ration and a clear “tan” formula.
https://www.amazon.com/clouddrive/share/6tBZbn9bryG6YqrMXlgLhix807infMRfln6fquoqaqC?ref_=cd_ph_share_link_copy

Screenshot (subdivided model)
https://www.amazon.com/clouddrive/share/CBJFMpSw3uj6BTmv9GOZFfbkjagzkNg79tXTMG2arWS?ref_=cd_ph_share_link_copy

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 04 May 2017 10:41 AM   [ Ignore ]   [ # 4 ]  
Total Posts:  1
Joined  2016-09-26

hey,
I tried a different approach:
I gave the object in question a material with a plain white color. Then I tried to bake this color channel including the illumination. But instead of saving this baked color data to a file on the hard drive, I was looking for a way to channel the baked bitmap data directly into a shader.

It seams I hit a wall very quickly. But just in case, I’d like to post my attempts anyway:
https://www.dropbox.com/s/1hy9lmvso6on1s2/realtimeIllumBake.c4d?dl=1

Maybe someone with more experience in python can make something of it.
Tyvm!

Profile
 
 
Posted: 04 May 2017 01:47 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi RBNH_MSE,

For any Python support and discussion, please have a look here:
https://developers.maxon.net/?page_id=1114

Perhaps explore the Camera Shader.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 11 May 2017 12:29 PM   [ Ignore ]   [ # 6 ]  
Total Posts:  3
Joined  2009-11-22

Hello Dr. Sassi,

Thank you very much. It works of course i am still working to refine it to my needs. Will let you know when i have the setup.
But i still wonder How the Pmatter Node comes to the Illumination Information.
Thanks again

Profile
 
 
Posted: 11 May 2017 12:48 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Thanks for the nice feedback, formfrei.

The Light is connected in the Attribute Manager, just click on the node. Is this the answering the question, or do I miss something?

Here is a scene file and I have set up some parameters to make the effect pretty clear:

Scene file
https://www.amazon.com/clouddrive/share/gDay3cSWEsc9YYcN8JeiHLzj8xiJrI5A9n6PnU3wO6B?ref_=cd_ph_share_link_copy

To get this information into a Weight-Map, the Channels might be a good way to do so.Let me know what your specific interest would be here.

All the best

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 12 May 2017 04:04 AM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.:

Here is a little hint how to get a position information into the Weigh Map.
The idea is here to have some kind of build up and an more organic behavior.

Press Play
Click on the Weight Tag
Move the Null object, preferably in X and Z, but test Y of course as well.

Scene file 01:
https://www.amazon.com/clouddrive/share/wMlrDDSIiR2M6RDvEJ6TTBC51ZiGbjSws8KUFEUoyP?ref_=cd_ph_share_link_copy

… and with Deformer. Move the Null and stop from time to time, it has a reverb.

Scene file 02:
https://www.amazon.com/clouddrive/share/3yEeaKIfZ8FarWN8tvrMWICA18bPVtb9V7fKUhHlDDZ?ref_=cd_ph_share_link_copy

If you use [Point Node] “Deformed Points”, it becomes even more interesting. Perhaps set the Noise Loop to 0.1 as well. So much more natural. grin

Example is here:
https://www.amazon.com/clouddrive/share/H2hf0dMqG8zaQj3z91AacmJhbtrzuIj4oR5eW5WMQI6?ref_=cd_ph_share_link_copy

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile