Conversation
|
@mikekucera, @chrtannus, @d2fong The AI was kind of on the right track, but it couldn't get the details right. It did at least isolate the problematic function. As expected, the AI isn't great at rendering-related stuff. Its automated test could be bunk; I haven't really looked at it yet. I made a few manual commits to clean things up with a proper fix. You can verify in this branch on the debug/webgl page. Webgl with
Canvas with
|
There was a problem hiding this comment.
This test needs to be evaluated to see if it's worth keeping.
There was a problem hiding this comment.
It validates that the webgl buffers get loaded with the correct data. It's actually a half decent way to test the renderer without it actually rendering. It basically tests that the node's visual properties correctly get interpreted and loaded for webgl.
The line: expect(colorBuffer.view[3]).to.be.closeTo(0.2, 0.000001); is doing the actual test for the inerited opacity. The [3]rd element is the alpha channel. The node's background-opacity is 0.5, and the effectiveOpacity() mock returns 0.4.. 0.4 * 0.5 = 0.2 so yes its being multiplied properly. I'd say its worth keeping. The mocks are ad-hock, might be worth using a real mocking library in the future, but its fine.
|
@d2fong, if this affects Cyweb, then you may want to take a look at this. Otherwise, it might not be interesting. |
There was a problem hiding this comment.
When I set the compound node's 'opacity' to a transparent value (< 1.0), the child nodes are now rendered with the same opacity as the parent, as expected. Setting a 0.5 'opacity' to both the parent and child nodes look correct to me as well--the child node still gets its own opacity, and it's affected by the parent's transparency.
|
@chrtannus, great. Thanks. I'll merge this in next week for a release then -- unless we notice any issues in the meanwhile. |
There was a problem hiding this comment.
It validates that the webgl buffers get loaded with the correct data. It's actually a half decent way to test the renderer without it actually rendering. It basically tests that the node's visual properties correctly get interpreted and loaded for webgl.
The line: expect(colorBuffer.view[3]).to.be.closeTo(0.2, 0.000001); is doing the actual test for the inerited opacity. The [3]rd element is the alpha channel. The node's background-opacity is 0.5, and the effectiveOpacity() mock returns 0.4.. 0.4 * 0.5 = 0.2 so yes its being multiplied properly. I'd say its worth keeping. The mocks are ad-hock, might be worth using a real mocking library in the future, but its fine.
|
Thanks, merging |
…t/fix-child-nodes-opacity-inheritance WebGL: apply compound opacity inheritance to child node bodies and borders


WebGL node rendering was ignoring compound-parent opacity for child nodes, so compound graphs looked different from canvas mode. This updates the WebGL simple-shape path to respect inherited element opacity for child node fills and borders.
Renderer
node.effectiveOpacity()in the WebGL simple-shape node path.background-opacity)border-opacity)Regression coverage
drawNode()that verifies inherited opacity is applied to both body and border output colors.Behavioral alignment