Announcement

Collapse
No announcement yet.

Custom Instancer question

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

  • Custom Instancer question

    Hi everyone,

    We are trying to find a way to build a plugin that does instancing at rendertime, so far we found a couple of good examples how to generate mesh at rendertime. But we couldn't find a way to instance a single mesh that has been compiled before.

    For example, take a node like this: (psuedo)


    GeomStaticMesh mesh1_mesh{}
    GeomStaticMesh mesh2_mesh{}
    GeomStaticMesh mesh3_mesh{}

    Node mesh1_node{}
    Node mesh2_node{}
    Node mesh3_node{}


    MyInstancer instancer_node_geo {
    instanced_meshes="mesh1;mesh2;mesh3";
    positions=ListVectorHex("ZIPB......");
    }

    Node instancer_node {
    transform=Transform(....);
    geometry=instancer_node_geo;
    visible=1;
    }


    Obviously there are a bunch more parameters that should control the instances.

    Can someone point me into the right direction to pull this off? Also let me know if this isn't clear enough.

    Jeroen,
    House of Secrets

  • #2
    Also, is there any documentation about the GeomStaticNURBS plugin?
    I like to read the surface data and get surface position at a certain UV coordinate.
    I couldn't find anything about NURBS in the documentation.

    Regards,
    Jeroen

    Comment


    • #3
      Alright, so far I have simple spheres mapped onto a NURBS surface at rendertime. However can somebody explain to me how I convert a parameter object to a plugin?

      Plugin *plug = static_cast<Plugin *>(getParameter("surface")->getObject());

      Doesn't seem to work.
      The surface param is of type Plugin, getObject returns a PluginBase, but this gives me a base object that isn't of any use.
      All I need is an InstanceID and I am good to go..

      Any thoughts?

      Jeroen,
      House of Secrets

      EDIT: False alarm.. seems to work, vrscene wasn't set up correctly
      Last edited by Hos; 13-08-2012, 07:16 AM.

      Comment


      • #4
        Sorry for the late reply; I just saw the thread - but it looks like you figured it out already

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

        Comment


        • #5
          Yes we are on a good track now, starting to understand the API a little better every day.

          The only thing I still have to figure out is how I should use a BitmapInterface before the resource has been loaded. When requesting the size, the render crashes.
          I figure it is because the resources are loaded after the plugin is done.

          Log looks like:
          ...
          Starting render sequence.
          Preparing renderer...
          <-- This is where the plugin is working
          Creating bitmap manager <-- Loads the resources
          ...

          Is there a workaround for this? I promise I will free the bitmap when I'm done

          Jeroen
          House of Secrets

          Comment


          • #6
            Let me try to clarify, you want to use a bitmap plugin before any rendering is done? In which method are you trying to use it?

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

            Comment


            • #7
              Yes, that is right. We like to use a density map for our instancing. But we like to do this at rendertime.
              So I tried linking a BitmapBuffer plugin. But this didn't work out, so I'm looking for alternatives.

              Jeroen,
              House of Secrets

              Comment


              • #8
                Nevermind, since we are recalculating the scatter points every frame. This enabled the bitmapManager, now I'm able to access the BitmapInterface options.
                This was just a happy coincidence, I still haven't figured out how we had to accomplish this in beginSequence though.

                Jeroen,
                House of Secrets

                Comment


                • #9
                  You might have to initialize the bitmap plugin manually in this case (i.e. calling its renderBegin() method first).

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

                  Comment


                  • #10
                    Sorry for the late reply, we have made some nice progress with the plugin. We are at the point of stabelizing the features and memory usage.
                    Thanks for pointing at the renderBegin() method, I could use this information the next time!

                    Is there a way to launch vray in a debug mode?

                    Jeroen,
                    House of Secrets

                    Comment


                    • #11
                      By "debug mode" you mean with the debug visual studio runtime?

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

                      Comment


                      • #12
                        Yes, I am developing under Linux and Windows so I tried to attach gdb, but I am not sure how.
                        But information about either gdb or visual studio is welcome.

                        Jeroen,
                        House of Secrets

                        Comment


                        • #13
                          Either of them should work fine; there is no problem to debug the version of V-Ray that you have. You won't get symbol information, but it will work fine and you can still debug your code.

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

                          Comment

                          Working...
                          X