Skip to content

Commit ddb15b0

Browse files
committed
small adjusts
1 parent 997df78 commit ddb15b0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/compas_viewer/renderer/renderer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,11 @@ def init(self):
387387

388388
for obj in self.viewer.scene.objects:
389389
obj.init()
390+
391+
for obj in self.viewer.scene.objects:
390392
if not isinstance(obj, TagObject):
391393
self.buffer_manager.add_object(obj)
394+
392395
self.buffer_manager.create_buffers()
393396

394397
# Unbind VAO when setup is complete.

src/compas_viewer/renderer/shaders/model.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void main() {
5858
}
5959

6060
// Apply lighting if needed
61-
if (is_lighted) {
61+
if (is_lighted && !is_grid) {
6262
vec3 ec_normal = normalize(cross(dFdx(ec_pos), dFdy(ec_pos)));
6363
vec3 L = normalize(-ec_pos);
6464
fragColor = vec4(color * dot(ec_normal, L), alpha);

src/compas_viewer/scene/buffermanager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, List, Tuple
1+
from typing import Any, Dict, List
22
import numpy as np
33
from compas_viewer.gl import make_vertex_buffer, make_index_buffer, make_texture_buffer, update_texture_buffer, update_vertex_buffer
44
from compas_viewer.renderer.shaders import Shader
@@ -97,7 +97,6 @@ def _add_buffer_data(self, obj: Any, buffer_type: str) -> None:
9797
col_array = np.array([c.rgba for c in colors], dtype=np.float32).flatten()
9898
elem_array = np.array(elements, dtype=np.int32).flatten()
9999

100-
101100
if buffer_type == "_frontfaces_data" or buffer_type == "_backfaces_data":
102101
opaque_elements = []
103102
transparent_elements = []
@@ -106,7 +105,6 @@ def _add_buffer_data(self, obj: Any, buffer_type: str) -> None:
106105
# print("WARNING: Element index out of range", obj) # TODO: Fix BREP from IFC
107106
continue
108107

109-
110108
if colors[e].a < 1.0 or obj.opacity < 1.0:
111109
transparent_elements.append(e)
112110
else:

0 commit comments

Comments
 (0)