Skip to content

Commit b98d835

Browse files
committed
Fix - transparancy handling in geo painter
According to this article: http://stackoverflow.com/questions/15994944/ We should specify mesh.renderOrder attribute to help renderer. Otherwise it tries to identify render order via distance, which is totally wrong.
1 parent c130d10 commit b98d835

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Changes in 5.1.x
44
1. Fix - support newest TFormula in TF1 (#127)
55
2. Fix - ignore NaN value in saved TF1 buffer
6+
3. Fix - correctly treat transparancy in geo painter
67

78

89
## Changes in 5.1.1

scripts/JSRootGeoBase.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2910,6 +2910,7 @@
29102910
JSROOT.GEO.ClonedNodes = function(obj, clones) {
29112911
this.toplevel = true; // indicate if object creates top-level structure with Nodes and Volumes folder
29122912
this.name_prefix = ""; // name prefix used for nodes names
2913+
this.maxdepth = 1; // maximal hierarchy depth, required for transparancy
29132914

29142915
if (obj) {
29152916
if (obj.$geoh) this.toplevel = false;
@@ -2970,6 +2971,7 @@
29702971

29712972
obj._refid = this.origin.length;
29722973
this.origin.push(obj);
2974+
if (sublevel>this.maxdepth) this.maxdepth = sublevel;
29732975

29742976
var chlds = null;
29752977
if (kind===0)

scripts/JSRootGeoPainter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,7 @@
11791179

11801180
// keep full stack of nodes
11811181
mesh.stack = entry.stack;
1182+
mesh.renderOrder = this._clones.maxdepth - entry.stack.length; // order of transparancy handling
11821183

11831184
obj3d.add(mesh);
11841185

0 commit comments

Comments
 (0)