Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    UVW coordinates in ShaderData.Output()

    Cinema 4D SDK
    r23 c++ python
    3
    12
    2.2k
    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.
    • ManuelM
      Manuel
      last edited by

      hi,

      the V axis have been reverse in the UVs editor but not internally. So you have to introduce a 1-V operation.

      Float posX = cd->p.x;
      Float posY = 1 - cd->p.y;
      

      The same issue talked in this thread as you already pointed out

      Cheers,
      Manuel

      MAXON SDK Specialist

      MAXON Registered Developer

      rsodreR 1 Reply Last reply Reply Quote 0
      • rsodreR
        rsodre @Manuel
        last edited by rsodre

        @m_magalhaes Thank you, that works.
        It would be super useful to have this piece of information on the Output() reference.

        What about having the correct uvw on the viewport, is it possible?

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          @rsodre said in UVW coordinates in ShaderData.Output():

          What about having the correct uvw on the viewport, is it possible?

          you mean the render ?

          MAXON SDK Specialist

          MAXON Registered Developer

          rsodreR 1 Reply Last reply Reply Quote 0
          • rsodreR
            rsodre @Manuel
            last edited by

            @m_magalhaes Difference between the viewport uvs and render uvs.

            This is the render, it is correct now, with uvs from 0..2:
            Screen Shot 2021-03-04 at 16.45.59.png

            But the material rendered at viewport does has normalized uvs (0...1):
            Screen Shot 2021-03-04 at 16.46.24.png

            1 Reply Last reply Reply Quote 0
            • M
              mp5gosu
              last edited by

              As far as I remember, Viewport drawing is handled in Draw() method.

              1 Reply Last reply Reply Quote 0
              • ManuelM
                Manuel
                last edited by

                hi,

                I've opened a bug report for that.
                The viewport should reflect as mush as we can the final render.

                Cheers,
                Manuel

                MAXON SDK Specialist

                MAXON Registered Developer

                1 Reply Last reply Reply Quote 1
                • ManuelM
                  Manuel
                  last edited by Manuel

                  hi,

                  the Shader is limited to 0,1 uvs space in the viewport.
                  That's exactly what you can see for example with the noise shader. Except this shader have a special mode (HQ noise) so they can be displayed properly.
                  You can also see that with the brick shader. (HQ Noise doesn't help in that case)

                  Cheers,
                  Manuel

                  MAXON SDK Specialist

                  MAXON Registered Developer

                  rsodreR 1 Reply Last reply Reply Quote 0
                  • rsodreR
                    rsodre @Manuel
                    last edited by

                    @m_magalhaes Ok, is it going to be fixed on the bug report or is that a limitation we have to live with?

                    1 Reply Last reply Reply Quote 0
                    • ManuelM
                      Manuel
                      last edited by

                      hi,

                      the bug report have been defined as a limitation.
                      It doesn't mean that it will never be fixed, but not now.

                      Cheers,
                      Manuel

                      MAXON SDK Specialist

                      MAXON Registered Developer

                      1 Reply Last reply Reply Quote 0
                      • M
                        mp5gosu
                        last edited by mp5gosu

                        And I'm still convinced that I had the same problem a while ago and managed to draw a custom preview via Draw() method. (There should be a BL entry)
                        But still, I don't know if I remember right.

                        1 Reply Last reply Reply Quote 0
                        • ManuelM
                          Manuel
                          last edited by

                          hi,

                          I don't see how we could do it with the Draw Method in a efficient way.

                          Cheers,
                          Manuel

                          MAXON SDK Specialist

                          MAXON Registered Developer

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post