Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Issue processing multiple AOVs in custom driver

1 ANTWORT 1
GELÖST
Antworten
Nachricht 1 von 2
AaronWPowell
200 Aufrufe, 1 Antwort

Issue processing multiple AOVs in custom driver

I have a custom driver that processes RGBA data and sends it to a callback function to display on screen. It works beautifully if only one AOV is used (for example, just the beauty pass or just the direct pass, etc), but the moment there's more than one it only seems to send data for the last AOV in the outputs. The other passes show up as completely transparent.

 

I have a feeling the buffer content is being overwritten with a new AOV before the previous AOV is rendered on screen, which might explain why the last AOV stays around while the others don't. This is a snippet of the `driver_process_bucket` part of my driver code. Right now I'm calling the callback function after every AOV pass, but should I be waiting until all AOVs are processed and just send one call with ALL of the data at once?

 

Edit: Yes, the driver is initialized to handle multiple outputs, and I'm not getting any warnings or errors in the log that could point me toward a possible issue.

 

 

 

 

driver_process_bucket
{
   AtString aov_name;
   int pixel_type;
   const void* bucket_data;

   while (AiOutputIteratorGetNext(iterator, &aov_name, &pixel_type, &bucket_data))
   {
      float* buffer = (float*)AiMalloc(bucket_size_x * bucket_size_y * sizeof(float) * 4);
   
      for (int j = 0; (j < bucket_size_y); j++)
      {
         for (int i = 0; (i < bucket_size_x); i++)
         {
            // Do stuff with data and fill buffer variable
         }
      }

      DisplayCallback cb = (DisplayCallback) AiNodeGetPtr(node, ASTR::callback);
      if (cb)
      {
         (*cb)(aov_name.c_str(), bucket_xo, bucket_yo, bucket_size_x, bucket_size_y, buffer);
      }
   }
}

 

 

 

 

1 ANTWORT 1
Nachricht 2 von 2
AaronWPowell
als Antwort auf: AaronWPowell

After further testing it looks like there's nothing wrong with the driver here, the issue is on the client side in the callback function.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report