CINEVERSITY

    Maxon Logo
    • Login
    • Search
    • Recent
    • Popular
    • Users
    • Groups

    Shadow to Vertex map

    Question & Answers
    xpresso vertex map light c4d cinema 4d
    2
    13
    1248
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dr. Sassi
      Dr. Sassi last edited by Dr. Sassi

      Hi Michal,

      To keep the forum readable, new questions need to have a new thread; otherwise, it becomes an endless text. Thanks for considering this in the future.

      I'm unfamiliar with OSL shaders in Octane; as I mentioned, I have zero access to Octane. Perhaps check any related Octane Forum.

      You can bake an image sequence and use this. My understanding of the target here is a rendering. In that way, most parts inside a project can be backed, cached, or expressed somehow.

      A Vertex Map has no idea about its Normal direction, nor is there anything that defines the position inside of a given Vertex Map.
      This needs to be taken from the Point Position and the Light Position. But what happens if one uses a Normal Map? The orientation changes at that moment. A few variables need to be known first to find (perhaps) a solution, but it is more complete than that.
      This is not a straightforward situation. Think about Area lights, parallel lights, different shadow qualities with their edge definitions, etc., not even think how a few lights in concert will work.

      All the best

      Dr. Sassi Sassmannshausen Ph.D.
      Senior Trainer, Maxon Master Trainer, L&D - Strategist
      Cinema 4D mentor since 2004, Member of VES, DCS.

      1 Reply Last reply Reply Quote
      • M
        Michal Rodzinski last edited by

        Hi,
        I will post new questions in new threads in the future. sorry for the mess.
        Thank you for your time explaining what is possible.
        best regards
        Michal

        1 Reply Last reply Reply Quote
        • Dr. Sassi
          Dr. Sassi last edited by Dr. Sassi

          Thanks for understanding, Michal.

          (No need for any sorry here, but thanks for the thought.)

          I believe we like to find something when we go to any forum. I try to make it as easy as possible for anyone.

          BTW, have you tried to place the camera as a child of light (same position, etc.), so a Fresnel Shader will show the angle of the surface and how it changes? This can be backed, even as animation. Then you have the data.
          https://www.dropbox.com/s/gkqbhf65fucqaoa/CV4_2023_drs_23_TXfv_01.zip?dl=0
          Note that the "Use Camera Vector" is enabled; Fresnel needs that.

          Cheers

          Dr. Sassi Sassmannshausen Ph.D.
          Senior Trainer, Maxon Master Trainer, L&D - Strategist
          Cinema 4D mentor since 2004, Member of VES, DCS.

          1 Reply Last reply Reply Quote
          • M
            Michal Rodzinski last edited by

            Thanks,
            Have a nice weekend.

            1 Reply Last reply Reply Quote
            • Dr. Sassi
              Dr. Sassi last edited by

              You're welcome, Michal.

              Enjoy your weekend as well.

              Dr. Sassi Sassmannshausen Ph.D.
              Senior Trainer, Maxon Master Trainer, L&D - Strategist
              Cinema 4D mentor since 2004, Member of VES, DCS.

              1 Reply Last reply Reply Quote
              • Dr. Sassi
                Dr. Sassi last edited by Dr. Sassi

                P.S.: I hope this helps a little bit, as these are the closest I can find that brings shows some surface angle into the game to create a specific result.

                https://github.com/redshift3d/RedshiftOSLShaders/blob/main/Iridescence.osl
                https://github.com/redshift3d/RedshiftOSLShaders/blob/main/Flakes.osl

                Dr. Sassi Sassmannshausen Ph.D.
                Senior Trainer, Maxon Master Trainer, L&D - Strategist
                Cinema 4D mentor since 2004, Member of VES, DCS.

                1 Reply Last reply Reply Quote
                • M
                  Michal Rodzinski last edited by

                  Hi,
                  I solved my problem getting "shadow to vertex map"
                  It's not perfect but it is in real time and that's enough for me for now.
                  I modified a little bit of your expresso and connect point normal to plight normal.
                  https://www.dropbox.com/s/onj94slaskbw57t/07.png?dl=0
                  I hope it's not a bug 🙂
                  Thank you for all your help
                  I will test it with a shader and post some results.
                  Best regards

                  1 Reply Last reply Reply Quote
                  • Dr. Sassi
                    Dr. Sassi last edited by

                    Hi Michal Rodzinski,

                    Yes, that is an option for self-shadowing to a certain degree.

                    The Normal of a Plane point will be 0, 1, 0 even if you take the object axis and rotate the object.
                    The Normal direction inside of a hole (e.g., Donut) might have Normals that point to the light but would receive shadow from itself.

                    The Normal idea is excellent if these limitations are not in the way.
                    Also, this is not an option to evaluate the received shadow from a different object.

                    I would say it is the way it works, not a bug.

                    Anyway, I hope that works for you.

                    Cheers

                    Dr. Sassi Sassmannshausen Ph.D.
                    Senior Trainer, Maxon Master Trainer, L&D - Strategist
                    Cinema 4D mentor since 2004, Member of VES, DCS.

                    1 Reply Last reply Reply Quote
                    • M
                      Michal Rodzinski last edited by

                      Hi Dr. Sassi,
                      I want to share what I have done with the vertex map technique and resolve one problem with this solution.
                      https://youtu.be/-w2yPYcm8SY
                      What I have now is for my sufficient. I think I don't need complex self-shadowing because as you can see in the example there is a solid black toon shadow,
                      that covers this area of the model.
                      But there is one problem.
                      There are two options connecting to Plight

                      1. if from node "Point" I connect Point normal to Normal in Plight - Light rotation is working, moving object is working, rotating object is not working;
                      2. if from node "Point" I connect Point position to Normal - Light rotation is working, Moving object is not working, rotating object is working;
                        and in both cases, deformers don't work.
                        here is a screen capture:
                        https://www.dropbox.com/s/nvckyml24lzzjj8/Desktop%202023.02.10%20-%2013.01.34.01.mp4?dl=0
                        this is the moment I hit the wall - is there any solution to resolve this problem?
                        I'm asking because I will use it on animated characters.
                        thank you for all your help
                        All the Best.
                      1 Reply Last reply Reply Quote
                      • Dr. Sassi
                        Dr. Sassi last edited by Dr. Sassi

                        Hi Michal Rodzinski,

                        The idea is to rotate the points around the axis but not the axis itself.

                        The position of each Point is based on the Object Axis. With this, the Normal is a Local idea. So you need to rotate the "surface" but not the axis. How to do that? Rotate Point from the X-Pool>System Presets> Matrix in XPresso.

                        Example:
                        https://www.dropbox.com/s/3wf6skt6a3w2xe6/CV4_2023_drs_23_XPvr_01.c4d.zip?dl=0
                        I have marked what can be moved and what can be rotated. Any derivation from that and the system is broken.

                        The "surface" can now be rotated or moved" while the Vertex Map is focused on the light source.

                        Since I have no file here, and screen capture nor images tell me that, I can only suggest/guess that you had in the Point Node, not the "Use Deformed Points" checked on.

                        =======

                        With that knowledge, you might use the Cluster Object to rotate the points around, while the Object that rotates the Point is a child of the Object, so it stays at Position 0, 0, 0.

                        My best wishes

                        Dr. Sassi Sassmannshausen Ph.D.
                        Senior Trainer, Maxon Master Trainer, L&D - Strategist
                        Cinema 4D mentor since 2004, Member of VES, DCS.

                        1 Reply Last reply Reply Quote
                        • First post
                          Last post