Announcement

Collapse
No announcement yet.

shader writting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by genelin1211 View Post
    Does VRay support spline curve for rendering hair primitive? Like riCurve in RenderMan and hair primitive in mental ray?
    Not sure about renderman, but I think mental ray also approximates curves with straight lines (although perhaps with adaptive step depending on curvature).

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #17
      Originally posted by vlado View Post
      This is a bit more tricky and unfortunately we don't provide ready classes for it, so you'll have to do some extra coding (you could use the code from defparams.h as a starting point, of course). You need to re-implement the getXXXX() method of your plugin parameters to take into account the "time" parameter and return different values for different times.

      This will work fine for rendering inside Maya; to export the animated parameter information to .vrscene files, you have to add some extra steps - if you need to do that let me know and I'll post how to do it.

      Best regards,
      Vlado
      Thank you Vlado, I'll try your solution later on. And yes, it's very likely that I'll need to export animated parameter to .vrscene files. So it would be great if you can show me how to do it.
      Thanks!

      Best regards,
      Gene

      Comment


      • #18
        Hi Vlado,

        I've created another class derived from DefIntParam in defparams.h with stl map member store different time/value pairs. It did work well in Maya, however, I've noticed that when VRay was writing vrscene file, it didn't pass time parameter to my re-implementation of getXXXX so the result was incorrectly written in vrscene file. Can you tell me how to make VRay export correct animated parameters?
        Thank you!

        Best regards,
        Gene

        Comment


        • #19
          You need to add support for the EXT_INTERPOLATING interface to your parameter; this is defined in vraypluginsexporter.h. In the newInterface() method of your parameter, you need to add a check for the EXT_INTERPOLATING interface, and return a pointer to MyInterpolatingInterface (similar to how this is done for EXT_SETTABLE_PARAM and EXT_CLONEABLE_PARAM interfaces). The .vrscene exporter will check for this interface, and if present, will use its methods to query the parameter values at different moments of time.

          Note: vraypluginsexporter.h includes a file called "cgauth.h" which you may not have - simply comment the #include line for the time being. This will be solved in newer versions of the SDK.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #20
            Hi Vlado,

            Thank you very much!
            Finally I can export animated parameters now.

            I've implemented a workflow similar to the sample "vray_geom_hair" in vray_plugins directory and I rendered a 10-frame sequence (I've tried both translating and deforming objects).
            When the function "void GeomHairInstance::compileGeometry(VR::VRayRenderer *vray, VR::TraceTransform *tm, double *times, int tmCount)" is called, the parameter "times" contains only 1 element and "tmCount" is always 1, that means it'll always call rayserver->storeStaticPrimitive and no motion blur.
            My question is, how do I make the parameters "times" contain more than 1 elements and "tmCount" larger than 1 such that I can render motion blurred custom geometry?
            Thanks!

            Best regards,
            Gene
            Last edited by genelin1211; 15-09-2011, 01:04 AM.

            Comment


            • #21
              I've figured out a way to make "tmCount" > 1 in compileGeometry. For those who want to do the same as I did, you should set key on the transform of the renderable mesh in Maya (the one used to trigger procedural geometry), then "tmCount" will be larger than 1 and you can store moving primitives. The trick is to apply another step to "cancel" the movement caused by the transform. If anyone knows a better way to trigger moving primitive storing mechanism, please tell me.
              Thanks!

              Best regards,
              Gene

              Comment


              • #22
                It may be enough to make the mesh output of your primitive dependent on the "time" node.

                Best regards,
                Vlado
                I only act like I know everything, Rogers.

                Comment


                • #23
                  Hi Vlado,

                  I've tried connecting the "time" node to an extra attribute "inputTime" in vrayplane plugin example, and the mesh output is dependent on the attribute "inputTime", but in compileGeometry, the tmCount is still 1.
                  Did I do something wrong?
                  Thanks!

                  Best regards,
                  Gene

                  Comment


                  • #24
                    I will have to do a test here to see if I can make it work.

                    Best regards,
                    Vlado
                    I only act like I know everything, Rogers.

                    Comment


                    • #25
                      Hi Vlado,

                      I've downloaded nightly build 17363 and saw a bug fixed: [bug] Incorrect self-shadowing of hairs by themselves for VRayFur and Maya hair - resolved.
                      Is that related to the problem in the post?
                      http://www.chaosgroup.com/forums/vbu...274#post534274

                      If so, could you tell me how to resolve the problem for custom hair geometry? Which part in the sdk sample vray_geom_hair should I modify?
                      Thank you.

                      Best regards,
                      Gene

                      Comment


                      • #26
                        Never mind Vlado,

                        I've rebuilt my plugin with the nightly build 17363 and the problem resolved!
                        Thanks!

                        Best regards,
                        Gene

                        Comment


                        • #27
                          Hi Vlado,

                          I noticed that the online stable build 16694 doesn't resolve the bug "incorrect self shadow problem in hair" yet, only the recent nightly builds resolve it.
                          Can you provide us a stable build that resolves the bug? Our production is ongoing now and we really need a stable build without the problem.
                          Thank you!

                          Best regards,
                          Gene
                          Last edited by genelin1211; 01-12-2011, 03:50 AM.

                          Comment


                          • #28
                            Yes, I will see what can be done about it.

                            Best regards,
                            Vlado
                            I only act like I know everything, Rogers.

                            Comment


                            • #29
                              We ported the fix to the stable branch now. You can find the Windows builds already on the site; the Linux builds will go there tomorrow.

                              Best regards,
                              Vlado
                              I only act like I know everything, Rogers.

                              Comment


                              • #30
                                Thank you Vlado! That was fast!
                                We've rendered our scenes with the stable build and everything worked perfectly!
                                Chaos Group support is the best!

                                Best regards,
                                Gene

                                Comment

                                Working...
                                X