Blender Git Loki

Git Commits -> Revision 7a90af7

Revision 7a90af7 by Sergey Sharybin (master)
January 12, 2013, 10:59 (GMT)
Packed and generated images support for Cycles

This commit adds support of packed and generated images
for Cycles when using SVM backend. Movies are still not
supported. This changes also doesn't touch OSL which is
much less trivial to adopt for any images which are not
saved to disk.

Implementation details:

- When adding images to Image Manager is now possible
to mark image as builtin. Builtin images will bypass
OIIO loader and will use special loading callbacks.

- Callbacks are set by Blender Session and they're
using C++ RNA interface to obtain needed data (pixels,
dimensions, is_float flag).

- Image Manager assumes file path is used as reference
to a builtin images, but in fact currently image
datablock name is used for reference. This makes it
easy to find an image in BlendData database.

- Added some extra properties to Image RNA:
* channels, which denotes actual number of channels
in ImBuf. This is needed to treat image's pixels
correct (before it wasn't possible because API
used internal number of channels for pixels which
is in fact doesn't correlate with image depth)
* is_float, which is truth if image is stored in
float buffer of ImBuf.

- Implemented string lookup for C++ RNA collections
for cases there's no manual lookup function.

OSL is not supported because it used own image loading
and filtering routines and there's seems to be no API
to feed pre-loaded pixels directly to the library.

Think we'll either need to add some API to support
such kind of feeding or consider OSL does not have
support of packed images at all.

Movies are not supported at this moment because of lack
of RNA API to load specified frame. It's not difficult
to solve, just need to consider what to best here:
* Either write some general python interface for ImBuf
and use it via C++ API, or
* Write a PY API function which will return pixels for
given frame, or
* Use bad-level BKE_* call

Anyway, small steps, further improvements later.

Reviewed by Brecht, thanks!

Commit Details:

Full Hash: 7a90af7b5a50bac5bb9fa6bf8ec785dac145a90c
SVN Revision: 53737
Parent Commit: 5e6917a
Lines Changed: +287, -64

9 Modified Paths:

/intern/cycles/blender/blender_session.cpp (+69, -0) (Diff)
/intern/cycles/blender/blender_session.h (+4, -0) (Diff)
/intern/cycles/blender/blender_shader.cpp (+28, -4) (Diff)
/intern/cycles/render/image.cpp (+102, -49) (Diff)
/intern/cycles/render/image.h (+7, -3) (Diff)
/intern/cycles/render/nodes.cpp (+8, -6) (Diff)
/intern/cycles/render/nodes.h (+2, -0) (Diff)
/source/blender/makesrna/intern/makesrna.c (+21, -2) (Diff)
/source/blender/makesrna/intern/rna_image.c (+46, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021