You did everything right.  Bug in the implementation.  Fixed here: 
https://github.com/OpenImageIO/oiio/pull/746


On Nov 19, 2013, at 6:42 PM, ryan heniser <[email protected]> wrote:

> I'm trying to do a environment that collects all the results for all the 
> shading points in a RSL plug-in. I git grid aligned artifacts when I do the 
> following:
> 
> 253     float *envResult, *dirData;
> 254     int resultStride, dirStride;
> 255     argv[0]->GetData(&envResult, &resultStride);
> 256     argv[1]->GetData(&dirData, &dirStride);
> 257     RslStringIter filename(argv[2]);
> 258                                                                           
>                                                                               
>      ;                                                                        
>                                         
> 259     // Convert integer runflags to chars.
> 260     unsigned int numPoints;
> 261     const unsigned int* prmanRunFlags = 
> rslContext->GetRunFlags(&numPoints);
> 262     Runflag* runFlags = (Runflag*) alloca(numPoints * sizeof(Runflag));
> 263     for (unsigned int i = 0; i < numPoints; ++i)
> 264         runFlags[i] = (Runflag) prmanRunFlags[i];
> 265         
> 266     Imath::V3f* dirVecData = reinterpret_cast<Imath::V3f*>(dirData);
> 267     int dirVecStride = dirStride / 3;
> 268     OpenImageIO::VaryingRef<Imath::V3f> dirRef(dirVecData, dirVecStride);
> 269     
> 270     Imath::V3f zeroVec(0.0f, 0.0f, 0.0f);
> 271     OpenImageIO::VaryingRef<Imath::V3f> zero(&zeroVec, 0);
> 272     
> 273     OpenImageIO::TextureOptions opts(gTexOpts);
> 274     bool ok = gTexSys->environment(ustring(*filename), opts,
> 275                                    runFlags, 0, numPoints,
> 276                                    dirRef, zero, zero, envResult);
> 
> What am I doing wrong here? I've tried it without the division by 3 on the 
> stride. That didn't work. I am able to get the single-point environment 
> lookups to work. 
> 
> Thanks,
> Ryan
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]



_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to