Arnold General Rendering Forum
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ShaderGlobals/AiTextureHandleAccess in Custom Camera

Message 1 of 2
245 Views, 1 Reply

ShaderGlobals/AiTextureHandleAccess in Custom Camera

We're writing a custom camera for Arnold, and running into a simple texture access issue.

Trying to call;

AtRGBA lensmapSample = AiTextureHandleAccess(sg, data->texturehandle, *(data->textureparams));

....results in a segfault if used on multiple cores (works fine on a single core).

Unlike shader_evaluate(), sg isn't defined for camera_create_ray, so we're having to declare & init it with;

AtShaderGlobals* sg = AiShaderGlobals();

... and then pass that along to AiTextureHandleAccess, but my guess is that it's not getting initialized per thread or something like that because any number of threads beyond 1 causes a crash (with 1 thread, it works as expected).

Anyone know how this is supposed to be invoked? Is there an alternate texture access method that should be used at the camera_create_ray step?

Oh, two of the more common errors that appear in the segfault are:

/home/thiago/oiio-arnold/src/libtexture/imagecache.cpp:1449: failed assertion 'memsize() == 0 && size > OIIO_SIMD_MAX_SIZE_BYTES'


* signal caught: SIGSEGV -- Invalid memory reference (address not mapped to object)

My guess is that the first error is likely just another version of the second.

Tags (2)
Labels (2)
Message 2 of 2
in reply to: Anonymous

It's a problem with the sg returned by AiShaderGlobals. Fix in next update.

// Stephen Blair
// Arnold Renderer Support

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators

Autodesk Design & Make Report