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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-09-22 17:57:31 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-09-22 18:05:31 +0300
commit1eba32c3e95effe3d3caef3bb7b6f508786c958f (patch)
tree4bffb7018b18fd13b822f34902e68a8a4eb2ac45 /intern
parent4762a9b09f98523093e5778e52b1ed8abf9fa331 (diff)
Fix T91576: Cycles attribute node with name N for smooth normal no longer working
There was an optimization to remove duplicate storage of normals as attributes when using normal maps. However for named attributes like this we still need to store the attribute. Don't request normal attribute from the normal map node now, instead of skipping it in the geometry code.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/geometry.cpp20
-rw-r--r--intern/cycles/render/nodes.cpp4
2 files changed, 0 insertions, 24 deletions
diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp
index 6804a006fe6..4de458de271 100644
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@ -794,11 +794,6 @@ void GeometryManager::device_update_attributes(Device *device,
foreach (AttributeRequest &req, attributes.requests) {
Attribute *attr = geom->attributes.find(req);
- /* Vertex normals are stored in DeviceScene.tri_vnormal. */
- if (attr && attr->std == ATTR_STD_VERTEX_NORMAL) {
- continue;
- }
-
update_attribute_element_size(geom,
attr,
ATTR_PRIM_GEOMETRY,
@@ -811,11 +806,6 @@ void GeometryManager::device_update_attributes(Device *device,
Mesh *mesh = static_cast<Mesh *>(geom);
Attribute *subd_attr = mesh->subd_attributes.find(req);
- /* Vertex normals are stored in DeviceScene.tri_vnormal. */
- if (subd_attr && subd_attr->std == ATTR_STD_VERTEX_NORMAL) {
- continue;
- }
-
update_attribute_element_size(mesh,
subd_attr,
ATTR_PRIM_SUBD,
@@ -870,11 +860,6 @@ void GeometryManager::device_update_attributes(Device *device,
Attribute *attr = geom->attributes.find(req);
if (attr) {
- /* Vertex normals are stored in DeviceScene.tri_vnormal. */
- if (attr->std == ATTR_STD_VERTEX_NORMAL) {
- continue;
- }
-
/* force a copy if we need to reallocate all the data */
attr->modified |= attributes_need_realloc[Attribute::kernel_type(*attr)];
}
@@ -898,11 +883,6 @@ void GeometryManager::device_update_attributes(Device *device,
Attribute *subd_attr = mesh->subd_attributes.find(req);
if (subd_attr) {
- /* Vertex normals are stored in DeviceScene.tri_vnormal. */
- if (subd_attr->std == ATTR_STD_VERTEX_NORMAL) {
- continue;
- }
-
/* force a copy if we need to reallocate all the data */
subd_attr->modified |= attributes_need_realloc[Attribute::kernel_type(*subd_attr)];
}
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 5303d55242e..03b79d7de3e 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -6749,8 +6749,6 @@ void NormalMapNode::attributes(Shader *shader, AttributeRequestSet *attributes)
attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str()));
attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str()));
}
-
- attributes->add(ATTR_STD_VERTEX_NORMAL);
}
ShaderNode::attributes(shader, attributes);
@@ -7026,8 +7024,6 @@ void VectorDisplacementNode::attributes(Shader *shader, AttributeRequestSet *att
attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str()));
attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str()));
}
-
- attributes->add(ATTR_STD_VERTEX_NORMAL);
}
ShaderNode::attributes(shader, attributes);