Announcement

Collapse
No announcement yet.

Create custom geometry in Using vray in Maya

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

  • Create custom geometry in Using vray in Maya

    Hi,
    I would like to create a custom geometry with vray in maya (c++).
    The only provided Maya samples, vraysphere and vrayplane, seem to use standard primitives.
    How to create custom geometry generated on the fly in c++ ?

    I tried to add a simple triangle in the compileGeometry function, but the setIntersectionData function never gets called upon rendering:
    Code:
    void compileGeometry(VR::VRayRenderer *vray, VR::TraceTransform *theTMs, double *times, int tmCount)
    {
    	BaseInstance::compileGeometry(vray, theTMs, times, tmCount);
      	rayCache.frameBegin(vray);
    	VR::RayServerInterface2 *rayserver=vray->getRayServer();
    
            VR::Vector p[3];
    
            p[0].x=0; p[0].y=0; p[0].z=0;
            p[1].x=10; p[1].y=0; p[1].z=0;
            p[2].x=0; p[2].y=0; p[2].z=10;
            
            int addingTriangle=rayserver->storeStaticTriangle(static_cast<GeometryGenerator*>(this), rayserver->getNewRenderID(), p);
           // addingTriangle is equal to 1 after calling storeStaticTriangle.
    }
    What am I missing ?

    Thanks !
    Last edited by lcrivell; 06-12-2015, 02:59 PM. Reason: Added code

  • #2
    There are a lot of other geometry plugins in the SDK. Even lights, for example vray_lightsphere pushes raw triangles into the ray server.
    V-Ray/PhoenixFD for Maya developer

    Comment

    Working...
    X