Cycles: Remove Volume Nodes GPU warning and gray out Sampling Method button when using GPU.

This commit is contained in:
Thomas Dinges 2014-08-24 14:54:48 +02:00
parent 7a026971dc
commit 8ed818e0a1
2 changed files with 6 additions and 20 deletions

View File

@ -929,7 +929,9 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
col = split.column()
col.label(text="Volume:")
col.prop(cworld, "volume_sampling", text="")
sub = col.column()
sub.active = use_cpu(context)
sub.prop(cworld, "volume_sampling", text="")
col.prop(cworld, "homogeneous_volume", text="Homogeneous")
@ -1031,7 +1033,9 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
col = split.column()
col.label(text="Volume:")
col.prop(cmat, "volume_sampling", text="")
sub = col.column()
sub.active = use_cpu(context)
sub.prop(cmat, "volume_sampling", text="")
col.prop(cmat, "homogeneous_volume", text="Homogeneous")

View File

@ -954,18 +954,6 @@ static void node_shader_buts_subsurface(uiLayout *layout, bContext *C, PointerRN
}
static void node_shader_buts_volume(uiLayout *layout, bContext *C, PointerRNA *UNUSED(ptr))
{
/* Volume does not work on GPU yet */
PointerRNA scene = CTX_data_pointer_get(C, "scene");
if (scene.data) {
PointerRNA cscene = RNA_pointer_get(&scene, "cycles");
if (cscene.data && (RNA_enum_get(&cscene, "device") == 1 && U.compute_device_type != 0))
uiItemL(layout, IFACE_("Volumes not supported on GPU"), ICON_ERROR);
}
}
static void node_shader_buts_toon(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "component", 0, "", ICON_NONE);
@ -1122,12 +1110,6 @@ static void node_shader_set_butfunc(bNodeType *ntype)
case SH_NODE_SUBSURFACE_SCATTERING:
ntype->draw_buttons = node_shader_buts_subsurface;
break;
case SH_NODE_VOLUME_SCATTER:
ntype->draw_buttons = node_shader_buts_volume;
break;
case SH_NODE_VOLUME_ABSORPTION:
ntype->draw_buttons = node_shader_buts_volume;
break;
case SH_NODE_BSDF_TOON:
ntype->draw_buttons = node_shader_buts_toon;
break;