Skip to content

Commit

Permalink
Renderable logic improvements to web viewer (AcademySoftwareFoundatio…
Browse files Browse the repository at this point in the history
…n#1644)

- Adds in proper parsing of renderable elements vs always just picking the first surface shader found.
  - The test suite files which have (multiple) nodegraph outputs and top level outputs will now load properly.
- Adds in UI to mark folders as renderable (using a shaderball icon) 
- Adds in "soloing" capability to allow picking a renderable and have it show up on all geometry. When nothing is solo'ed the default material assignment is used.
- Includes fixes for:
  - Dag path assignment matching .
  - Missing exposure of NodeGraph::getDownStreamPorts() in JS.
  - Addressing the big performance hit when binding materials to geometry in ThreeJS. The code by default is some quite slow code for reflection / debugging purposes which is now turned off. Chess set load is seconds vs minutes. This affects the 'solo'ing workflow significantly as each switch is a geometry re-bind. If the material is not already cached then slow code will be hit which can cause seconds to pass when selecting a new material -- which appears like a "hang" from a user perspective.
  • Loading branch information
kwokcb authored Jan 10, 2024
1 parent 96276bb commit f004153
Show file tree
Hide file tree
Showing 6 changed files with 296 additions and 30 deletions.
7 changes: 7 additions & 0 deletions javascript/MaterialXView/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
.peditorfolder {
background-color: #333333;
}
.peditor_material_assigned {
background-color: #006cb8;
}
.peditor_material_assigned:hover {
background-color: #32adff;
}
</style>
</head>
<body style="margin: 0px; overflow: hidden;">
Expand Down
5 changes: 5 additions & 0 deletions javascript/MaterialXView/public/shader_ball.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions javascript/MaterialXView/public/shader_ball2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions javascript/MaterialXView/source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ function init()
// Set up renderer
renderer = new THREE.WebGLRenderer({ canvas, context });
renderer.setSize(window.innerWidth, window.innerHeight);
// Disable introspection for shader debugging for deployment.
// - The code associated with getting program information can be very slow when
// dealing with shaders with lots of input uniforms (such as standard surface, openpbr shading models)
// as each call is blocking.
// - Adding this avoids the chess set scene from "hanging" the Chrome browser on Windows to a few second load.
// - Documentation for this flag: https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer.debug
renderer.debug.checkShaderErrors = false;

composer = new EffectComposer(renderer);
const renderPass = new RenderPass(scene.getScene(), scene.getCamera());
Expand Down
Loading

0 comments on commit f004153

Please sign in to comment.