[Bf-python] Fastest way for RenderEngine to return combined rgba + z

Asbjørn lordcrc at gmail.com
Tue Aug 20 01:03:01 CEST 2013


On 20.08.2013 00:24, Dan Eicher wrote:
> In py-3.2 or 3.3 they added full support for buffer objects so unless
> there's some conversion that needs to be done it should be able to take
> a pure buffer object and do a simple memcpy -- which I'd imagine would
> be a lot faster than 800ms. The Py_buffer struct should be able to
> supply all the information that the current sequence methods currently
> provide.

I was under the impression nothing had changed in the Blender API, I 
could be mistaken of course :)

> As an added plus you could define it as negative strides indexing and do
> away with the bottom to top conversion as well.

Yes, ideally. However internally on our side (LuxRender core) the alpha 
buffer is stored separately from the framebuffer, and Blender requires 
premultiplied alpha always, while our internal data differs depending on 
what the user chose, so we need to do a bit of data juggling and 
conversion anyway.

Still, the data juggling and such only takes about 20ms out of the about 
400ms spent on our side for a 1080p image, which I think is acceptable. 
Better to figure out a way to lower the remaining 380ms :)

Cheers
- Asbjørn



More information about the Bf-python mailing list