Skip to content

Commit

Permalink
Examples: Fix monaco-editor (mrdoob#28201)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag authored Apr 23, 2024
1 parent 50d4f74 commit c5c42fb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions examples/jsm/nodes/materials/NodeMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class NodeMaterial extends ShaderMaterial {

setupClipping( builder ) {

if ( builder.clippingContext === null ) return null;

const { globalClippingCount, localClippingCount } = builder.clippingContext;

let result = null;
Expand Down
9 changes: 2 additions & 7 deletions examples/webgpu_tsl_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
import WGSLNodeBuilder from 'three/addons/renderers/webgpu/nodes/WGSLNodeBuilder.js';
import GLSLNodeBuilder from 'three/addons/renderers/webgl/nodes/GLSLNodeBuilder.js';
import GLSL1NodeBuilder from 'three/addons/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js';

import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

Expand Down Expand Up @@ -109,7 +108,7 @@

// editor

window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@latest/min/vs' } } );
window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.48.0/min/vs' } } );

require( [ 'vs/editor/editor.main' ], () => {

Expand Down Expand Up @@ -196,10 +195,6 @@

NodeBuilder = GLSLNodeBuilder;

} else {

NodeBuilder = GLSL1NodeBuilder;

}

nodeBuilder = new NodeBuilder( mesh, renderer );
Expand Down Expand Up @@ -238,7 +233,7 @@

const gui = new GUI();

gui.add( options, 'output', [ 'WGSL', 'GLSL ES 3.0', 'GLSL' ] ).onChange( build );
gui.add( options, 'output', [ 'WGSL', 'GLSL ES 3.0' ] ).onChange( build );
gui.add( options, 'shader', [ 'vertex', 'fragment' ] ).onChange( showCode );

gui.add( options, 'outputColorSpace', [ THREE.LinearSRGBColorSpace, THREE.SRGBColorSpace ] ).onChange( ( value ) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_tsl_transpiler.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// editor

window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@latest/min/vs' } } );
window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.48.0/min/vs' } } );

require( [ 'vs/editor/editor.main' ], () => {

Expand Down
2 changes: 1 addition & 1 deletion playground/elements/CodeEditorElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CodeEditorElement extends Element {

this.editor = null; // async

window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@latest/min/vs' } } );
window.require.config( { paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.48.0/min/vs' } } );

require( [ 'vs/editor/editor.main' ], () => {

Expand Down
2 changes: 1 addition & 1 deletion playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</head>
<body>

<script src="https://cdn.jsdelivr.net/npm/monaco-editor@latest/min/vs/loader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.48.0/min/vs/loader.min.js"></script>

<script type="importmap">
{
Expand Down

0 comments on commit c5c42fb

Please sign in to comment.