diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-18 05:13:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-23 20:57:58 +0300 |
commit | 04896d223d8de7612f4559f0ca837c64d96b3256 (patch) | |
tree | e5d13e0103fe0a72c524b86c2f35dbbb6728f175 /intern | |
parent | 15fb8ad6ae5920ab508d536ca7619009a3ab718d (diff) |
Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 1 | ||||
-rw-r--r-- | intern/cycles/render/attribute.cpp | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 6f1c49774f2..c87329711e7 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -367,6 +367,8 @@ static void create_mesh_volume_attributes(Scene *scene, create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_FLAME, frame); if(mesh->need_attribute(scene, ATTR_STD_VOLUME_HEAT)) create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_HEAT, frame); + if(mesh->need_attribute(scene, ATTR_STD_VOLUME_TEMPERATURE)) + create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_TEMPERATURE, frame); if(mesh->need_attribute(scene, ATTR_STD_VOLUME_VELOCITY)) create_mesh_volume_attribute(b_ob, mesh, scene->image_manager, ATTR_STD_VOLUME_VELOCITY, frame); } diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index d9301125641..679221fc18b 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -1066,7 +1066,8 @@ void BlenderSession::builtin_image_info(const string &builtin_name, if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_DENSITY) || builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_FLAME) || - builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_HEAT)) + builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_HEAT) || + builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) channels = 1; else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_COLOR)) channels = 4; @@ -1287,6 +1288,13 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, return true; } } + else if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_TEMPERATURE)) { + SmokeDomainSettings_temperature_grid_get_length(&b_domain.ptr, &length); + if(length == num_pixels) { + SmokeDomainSettings_temperature_grid_get(&b_domain.ptr, pixels); + return true; + } + } else { fprintf(stderr, "Cycles error: unknown volume attribute %s, skipping\n", diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 44e7fd46adc..26b5a27807c 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -798,6 +798,7 @@ typedef enum AttributeStandard { ATTR_STD_VOLUME_COLOR, ATTR_STD_VOLUME_FLAME, ATTR_STD_VOLUME_HEAT, + ATTR_STD_VOLUME_TEMPERATURE, ATTR_STD_VOLUME_VELOCITY, ATTR_STD_POINTINESS, ATTR_STD_NUM, diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 2c22db8189d..f959b1fef8b 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -281,6 +281,8 @@ const char *Attribute::standard_name(AttributeStandard std) return "flame"; case ATTR_STD_VOLUME_HEAT: return "heat"; + case ATTR_STD_VOLUME_TEMPERATURE: + return "temperature"; case ATTR_STD_VOLUME_VELOCITY: return "velocity"; case ATTR_STD_POINTINESS: @@ -425,6 +427,7 @@ Attribute *AttributeSet::add(AttributeStandard std, ustring name) case ATTR_STD_VOLUME_DENSITY: case ATTR_STD_VOLUME_FLAME: case ATTR_STD_VOLUME_HEAT: + case ATTR_STD_VOLUME_TEMPERATURE: attr = add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); break; case ATTR_STD_VOLUME_COLOR: |