Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/mesh.cpp
| Show First 20 Lines • Show All 1,085 Lines • ▼ Show 20 Lines | foreach (Shader *shader, used_shaders) { | ||||
| if (shader->has_displacement && shader->displacement_method != DISPLACE_BUMP) { | if (shader->has_displacement && shader->displacement_method != DISPLACE_BUMP) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| bool Mesh::has_voxel_attributes() const | |||||
| { | |||||
| foreach (const Attribute &attr, attributes.attributes) { | |||||
| if (attr.element == ATTR_ELEMENT_VOXEL) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| float Mesh::motion_time(int step) const | float Mesh::motion_time(int step) const | ||||
| { | { | ||||
| return (motion_steps > 1) ? 2.0f * step / (motion_steps - 1) - 1.0f : 0.0f; | return (motion_steps > 1) ? 2.0f * step / (motion_steps - 1) - 1.0f : 0.0f; | ||||
| } | } | ||||
| int Mesh::motion_step(float time) const | int Mesh::motion_step(float time) const | ||||
| { | { | ||||
| if (motion_steps > 1) { | if (motion_steps > 1) { | ||||
| ▲ Show 20 Lines • Show All 913 Lines • ▼ Show 20 Lines | foreach (const Shader *shader, mesh->used_shaders) { | ||||
| } | } | ||||
| if (shader->has_surface_bssrdf) { | if (shader->has_surface_bssrdf) { | ||||
| mesh->has_surface_bssrdf = true; | mesh->has_surface_bssrdf = true; | ||||
| } | } | ||||
| } | } | ||||
| if (need_update && mesh->has_volume) { | if (need_update && mesh->has_volume) { | ||||
| /* Create volume meshes if there is voxel data. */ | /* Create volume meshes if there is voxel data. */ | ||||
| bool has_voxel_attributes = false; | if (mesh->has_voxel_attributes()) { | ||||
| foreach (Attribute &attr, mesh->attributes.attributes) { | |||||
| if (attr.element == ATTR_ELEMENT_VOXEL) { | |||||
| has_voxel_attributes = true; | |||||
| } | |||||
| } | |||||
| if (has_voxel_attributes) { | |||||
| if (!volume_images_updated) { | if (!volume_images_updated) { | ||||
| progress.set_status("Updating Meshes Volume Bounds"); | progress.set_status("Updating Meshes Volume Bounds"); | ||||
| device_update_volume_images(device, scene, progress); | device_update_volume_images(device, scene, progress); | ||||
| volume_images_updated = true; | volume_images_updated = true; | ||||
| } | } | ||||
| create_volume_mesh(scene, mesh, progress); | create_volume_mesh(scene, mesh, progress); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines | |||||