Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderable logic improvements to web viewer #1644

Merged
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;
Copy link
Contributor Author

@kwokcb kwokcb Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one cause of extreme slowdown for loading in scenes with a number of standard surface shaders. It is slower for this than say UsdPreviewSurface since there are more uniforms to inspect for debugging. Each causes a pipeline stall. Once removed then the remaining profile time found was for texture load (if any) but this is an incremental load.


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