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/blender/addon
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/blender/addon')
-rw-r--r--intern/cycles/blender/addon/properties.py24
-rw-r--r--intern/cycles/blender/addon/ui.py37
2 files changed, 48 insertions, 13 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index b53f85c3266..fed1524a816 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -129,6 +129,16 @@ enum_device_type = (
('OPENCL', "OpenCL", "OpenCL", 2)
)
+enum_texture_limit = (
+ ('OFF', "No Limit", "No texture size limit", 0),
+ ('128', "128", "Limit texture size to 128 pixels", 1),
+ ('256', "256", "Limit texture size to 256 pixels", 2),
+ ('512', "512", "Limit texture size to 512 pixels", 3),
+ ('1024', "1024", "Limit texture size to 1024 pixels", 4),
+ ('2048', "2048", "Limit texture size to 2048 pixels", 5),
+ ('4096', "4096", "Limit texture size to 4096 pixels", 6),
+ ('8192', "8192", "Limit texture size to 8192 pixels", 7),
+ )
class CyclesRenderSettings(bpy.types.PropertyGroup):
@classmethod
@@ -608,6 +618,20 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
min=0.0, max=1.0,
)
+ cls.texture_limit = EnumProperty(
+ name="Viewport Texture Limit",
+ default='OFF',
+ description="Limit texture size used by viewport rendering",
+ items=enum_texture_limit
+ )
+
+ cls.texture_limit_render = EnumProperty(
+ name="Render Texture Limit",
+ default='OFF',
+ description="Limit texture size used by final rendering",
+ items=enum_texture_limit
+ )
+
# Various fine-tuning debug flags
def devices_update_callback(self, context):
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 1856b278c89..3f7730efbb0 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1587,29 +1587,40 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
cscene = scene.cycles
layout.active = rd.use_simplify
- split = layout.split()
- col = split.column()
- col.label(text="Viewport:")
- col.prop(rd, "simplify_subdivision", text="Subdivision")
- col.prop(rd, "simplify_child_particles", text="Child Particles")
+ col = layout.column(align=True)
+ col.label(text="Subdivision")
+ row = col.row(align=True)
+ row.prop(rd, "simplify_subdivision", text="Viewport")
+ row.prop(rd, "simplify_subdivision_render", text="Render")
- col = split.column()
- col.label(text="Render:")
- col.prop(rd, "simplify_subdivision_render", text="Subdivision")
- col.prop(rd, "simplify_child_particles_render", text="Child Particles")
+ col = layout.column(align=True)
+ col.label(text="Child Particles")
+ row = col.row(align=True)
+ row.prop(rd, "simplify_child_particles", text="Viewport")
+ row.prop(rd, "simplify_child_particles_render", text="Render")
- layout.separator()
+ col = layout.column(align=True)
+ split = col.split()
+ sub = split.column()
+ sub.label(text="Texture Limit Viewport")
+ sub.prop(cscene, "texture_limit", text="")
+ sub = split.column()
+ sub.label(text="Texture Limit Render")
+ sub.prop(cscene, "texture_limit_render", text="")
split = layout.split()
-
col = split.column()
col.prop(cscene, "use_camera_cull")
- col.prop(cscene, "camera_cull_margin", text="Margin")
+ row = col.row()
+ row.active = cscene.use_camera_cull
+ row.prop(cscene, "camera_cull_margin")
col = split.column()
col.prop(cscene, "use_distance_cull")
- col.prop(cscene, "distance_cull_margin", text="Distance")
+ row = col.row()
+ row.active = cscene.use_distance_cull
+ row.prop(cscene, "distance_cull_margin", text="Distance")
def draw_device(self, context):
scene = context.scene