Hi, I'm trying to learn Vray SDK but a lot of information I haven't find in Help. Can anyone tell me any description about class VUtils:StaticMeshInterfacePrimitive or a couple of samples of using it.
Announcement
Collapse
No announcement yet.
VUtils:StaticMeshInterfacePrimitive
Collapse
X
-
The StaticMeshInterfacePrimitive (declared in meshprimitives.h) is the dynamic raytraced primitive used for rendering VRayProxy objects (or any other objects derived from the MeshInterface class).
If you can provide some more information on what you are trying to do, I will be able to give a more detailed reply.
Best regards,
VladoI only act like I know everything, Rogers.
-
I tryed to use it as:
I tryed to use it as
proxy = newDefaultMeshFile();
proxy->init("J:\\Teapot01.vrmesh");
ThreadManager *thread = VUtils::newDefaultThreadManager();
meshPrimitive.init(proxy, tm, thread, this);
VUtils::deleteDefaultThreadManager(thread);
int expand(VR:ynamicRaycaster<VR::StaticBox> *raycaster, int threadIndex) {if (-1==firstPrimID) firstPrimID=raycaster->getNewRenderID();
raycaster->insertPrimitive(meshPrimitive, &sphere, static_cast<VR::GeometryGenerator*>(this), firstPrimID);return 0;
}
But it result in render hangingLast edited by fobus; 13-12-2007, 06:43 AM.
Comment
-
It should be something like this:
Code:owner=NULL; ownerIndex=renderID; const VR::VRaySequenceData &sdata=vray->getSequenceData(); RayServerInterface *rayserver=vray->getRayServer(); meshPrimitive.init(&mfile, vobjToWorld, sdata.threadManager, static_cast<GeometryGenerator*>(this)); rayserver->storeStaticPrimitive(&meshPrimitive, NULL, rayserver->getNewRenderID());
Also, you need to use the storeStaticPrimitive() method of the rayserver, since this is a top-level primitive, rather than insertPrimitive() which is used for primitives of lower levels.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
One more question...
In case of using StaticMeshInterfacePrimitive
what classes should*i use as inheritance for VRenderInstance?
public VR::Shadeable,public VR::ShadeData,public VR::ShadeInstance,public VR::GeometryGenerator
Should i use void setIntersectionData(Vlado::RSRay &rsray, void *isData) function?
----------------------------------------------------------------------------------------
And one more:
In case of using several same proxies with different transform matrix should i call
for(i =0 ;i<n;i+ +) {
meshPrimitive.init(proxy, tm, sdata.threadManager, this);
rayserver->storeStaticPrimitive(meshPrimitive, NULL, rayserver->getNewRenderID());
}Last edited by fobus; 14-12-2007, 12:15 AM.
Comment
-
For the different transformation matrices, you are correct.
You need the setIntersectionData() function as well to fill the final intersection with the proxy primitive.
You need to have instances of those classes (shadeable, shadedata, shadeinstance and geometrygenerator) as you will need pointers to them in the setIntersectionData(). It is not strictly necessary to use inheritance for this, so long as you have objects of the required type somewhere.
If you email me to vlado@chaosgroup.com, I can send you the source code related to rendering proxies - this part is the most tricky aspect of the V-Ray SDK, so I suppose some example code would be useful.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
Originally posted by fobus View PostAt this moment we load proxy from file to generate instances by surface. But it is not usefull sometimes. Is it possible to get proxy from TriObjec?
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
Originally posted by fobus View Postfor(i =0 ;i<cm;i+ +) rayserver->storeStaticPrimitive(&meshPrimitive, NULL, rayserver->getNewRenderID());
Can we set different materials? If we have mtls.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
Comment