Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-11-17 14:13:22 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-11-22 14:00:09 +0300
commit272412f9c0d26f630c5e1e7d07d4ff417b7218e5 (patch)
tree2b3f66b225d32be9fdae18d795b8f52ae6a353e6 /intern/cycles/render/image.h
parent927a168b077fa5182168068315c4fb0ea998edb6 (diff)
Cycles: Implement texture size limit simplify option
Main intention is to give some quick way to control scene's memory usage by clamping textures which are too big. This is really handy on the early production stages when you first create really nice looking hi-res textures and only when it all works and approved start investing time on optimizing your scene. This is a new option in Scene Simplify panel and it acts as following: when texture size is bigger than the given value it'll be scaled down by half for until it fits into given limit. There are various possible improvements, such as: - Use threaded scaling using our own task manager. This is actually one of the main reasons why image resize is manually-implemented instead of using OIIO's resize. Other reason here is that API seems limited to construct 3D texture description easily. - Vectorization of uchar4/float4/half4 textures. - Use something smarter than box filter. Was playing with some other filters, but not sure they are really better: they kind of causes more fuzzy edges. Even with such a TODOs in the code the option is already quite useful. Reviewers: brecht Reviewed By: brecht Subscribers: jtheninja, Blendify, gregzaal, venomgfx Differential Revision: https://developer.blender.org/D2362
Diffstat (limited to 'intern/cycles/render/image.h')
-rw-r--r--intern/cycles/render/image.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h
index 1dc4bf180f8..3da7338985c 100644
--- a/intern/cycles/render/image.h
+++ b/intern/cycles/render/image.h
@@ -30,6 +30,7 @@ CCL_NAMESPACE_BEGIN
class Device;
class DeviceScene;
class Progress;
+class Scene;
class ImageManager {
public:
@@ -67,8 +68,15 @@ public:
ExtensionType extension);
ImageDataType get_image_metadata(const string& filename, void *builtin_data, bool& is_linear);
- void device_update(Device *device, DeviceScene *dscene, Progress& progress);
- void device_update_slot(Device *device, DeviceScene *dscene, int flat_slot, Progress *progress);
+ void device_update(Device *device,
+ DeviceScene *dscene,
+ Scene *scene,
+ Progress& progress);
+ void device_update_slot(Device *device,
+ DeviceScene *dscene,
+ Scene *scene,
+ int flat_slot,
+ Progress *progress);
void device_free(Device *device, DeviceScene *dscene);
void device_free_builtin(Device *device, DeviceScene *dscene);
@@ -114,6 +122,7 @@ private:
typename DeviceType>
bool file_load_image(Image *img,
ImageDataType type,
+ int texture_limit,
device_vector<DeviceType>& tex_img);
int type_index_to_flattened_slot(int slot, ImageDataType type);
@@ -122,10 +131,20 @@ private:
uint8_t pack_image_options(ImageDataType type, size_t slot);
- void device_load_image(Device *device, DeviceScene *dscene, ImageDataType type, int slot, Progress *progess);
- void device_free_image(Device *device, DeviceScene *dscene, ImageDataType type, int slot);
-
- void device_pack_images(Device *device, DeviceScene *dscene, Progress& progess);
+ void device_load_image(Device *device,
+ DeviceScene *dscene,
+ Scene *scene,
+ ImageDataType type,
+ int slot,
+ Progress *progess);
+ void device_free_image(Device *device,
+ DeviceScene *dscene,
+ ImageDataType type,
+ int slot);
+
+ void device_pack_images(Device *device,
+ DeviceScene *dscene,
+ Progress& progess);
};
CCL_NAMESPACE_END