nuttynut
11-08-2010, 10:12 AM
Hey guys
The following function in MRenderUtils needs a raySampler to function properly:
http://download.autodesk.com/us/maya/2011help/API/class_m_render_util.html#c61ddf53fc7286fc1d0ea2cb312facc5
MStatus MRenderUtil::raytrace(
const MFloatVector & rayOrigin,
const MFloatVector & rayDirection,
const void * notUsed,
const void * raySampler,
const short rayDepth,
MFloatVector & resultColor,
MFloatVector & resultTransparency,
const bool isReflectedRays = true
)
How do I aquire one in a non-rendering context: in the compute of a node connected to the mesh. From some initial googling I found out the only way to sample a texture at a given UV is either use MRenderUtil::sampleShadingNetwork or MRenderUtil::raytrace.
If there IS a way to sample a texture color at a given uv without having to render, please tell me :)
Thanks
Waldo
edit: I found a similar topic on creativecrash, but no solution there: https://www.creativecrash.com/forums/api/topics/raytrace-function-from-mpxcommand
The following function in MRenderUtils needs a raySampler to function properly:
http://download.autodesk.com/us/maya/2011help/API/class_m_render_util.html#c61ddf53fc7286fc1d0ea2cb312facc5
MStatus MRenderUtil::raytrace(
const MFloatVector & rayOrigin,
const MFloatVector & rayDirection,
const void * notUsed,
const void * raySampler,
const short rayDepth,
MFloatVector & resultColor,
MFloatVector & resultTransparency,
const bool isReflectedRays = true
)
How do I aquire one in a non-rendering context: in the compute of a node connected to the mesh. From some initial googling I found out the only way to sample a texture at a given UV is either use MRenderUtil::sampleShadingNetwork or MRenderUtil::raytrace.
If there IS a way to sample a texture color at a given uv without having to render, please tell me :)
Thanks
Waldo
edit: I found a similar topic on creativecrash, but no solution there: https://www.creativecrash.com/forums/api/topics/raytrace-function-from-mpxcommand
