Skip to content

Commit

Permalink
Examples: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 4, 2022
1 parent fe276f2 commit ea80c21
Show file tree
Hide file tree
Showing 30 changed files with 80 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/manual/ar/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>فحص توافق WebGL</h1>
</p>

<p>
أضف [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js] إلى جافا سكريبت الخاص بك وقم بتشغيل ما يلي قبل محاولة تقديم أي شيء.
أضف [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js] إلى جافا سكريبت الخاص بك وقم بتشغيل ما يلي قبل محاولة تقديم أي شيء.
</p>

<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/en/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>[name]</h1>
</p>

<p>
Add [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]
Add [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]
to your javascript and run the following before attempting to render anything.
</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/ja/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>[name]</h1>
</p>

<p>
javascriptのコードに[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]を付け加えて、何かを描画する前に以下のコードを実行してください。
javascriptのコードに[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]を付け加えて、何かを描画する前に以下のコードを実行してください。
</p>

<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/ko/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>WebGL 호환성 검사([name])</h1>
</p>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]를 스크립트에 추가하고 무언가를 렌더링하기 전에 아래 코드를 실행해보세요.
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]를 스크립트에 추가하고 무언가를 렌더링하기 전에 아래 코드를 실행해보세요.
</p>

<code>
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/zh/introduction/WebGL-compatibility-check.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>WebGL兼容性检查([name])</h1>
</p>

<p>
请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/WebGL.js]引入到你的文件,并在尝试开始渲染之前先运行该文件。
请将[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/capabilities/WebGL.js]引入到你的文件,并在尝试开始渲染之前先运行该文件。
</p>

<code>
Expand Down
26 changes: 26 additions & 0 deletions examples/js/capabilities/ImportMaps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
( function () {
class ImportMaps {
static isAvailable() {
return 'supports' in HTMLScriptElement && HTMLScriptElement.supports('importmap');
}

static getErrorMessage() {
const message = 'Your browser does not support <a href="https://wicg.github.io/import-maps/" style="color:blue">Import Maps</a>';
const element = document.createElement('div');
element.style.fontFamily = 'monospace';
element.style.fontSize = '13px';
element.style.fontWeight = 'normal';
element.style.textAlign = 'center';
element.style.background = '#fff';
element.style.color = '#000';
element.style.padding = '1.5em';
element.style.width = '400px';
element.style.margin = '5em auto 0';
element.innerHTML = message;
return element;
}

}

THREE.ImportMaps as default = ImportMaps as default;
} )();
File renamed without changes.
27 changes: 27 additions & 0 deletions examples/js/capabilities/WebGPU.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
( function () {
class WebGPU {
static isAvailable() {
return navigator.gpu !== undefined;
}

static getErrorMessage() {
const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a>';
const element = document.createElement('div');
element.id = 'webgpumessage';
element.style.fontFamily = 'monospace';
element.style.fontSize = '13px';
element.style.fontWeight = 'normal';
element.style.textAlign = 'center';
element.style.background = '#fff';
element.style.color = '#000';
element.style.padding = '1.5em';
element.style.width = '400px';
element.style.margin = '5em auto 0';
element.innerHTML = message;
return element;
}

}

THREE.WebGPU as default = WebGPU as default;
} )();
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class WebGPU {

static getErrorMessage() {

const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:#000">WebGPU</a>.';
const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a>';

const element = document.createElement( 'div' );
element.id = 'webgpumessage';
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_buffergeometry_attributes_integer.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

import * as THREE from '../build/three.module.js';

import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_materials_texture2darray.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import Stats from './jsm/libs/stats.module.js';
import { unzipSync } from './jsm/libs/fflate.module.js';

import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_materials_texture3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { NRRDLoader } from './jsm/loaders/NRRDLoader.js';
import { VolumeRenderShader1 } from './jsm/shaders/VolumeShader.js';
import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_materials_texture3d_partialupdate.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { ImprovedNoise } from './jsm/math/ImprovedNoise.js';

import { GUI } from './jsm/libs/lil-gui.module.min.js';
import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_multiple_rendertargets.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

import * as THREE from '../build/three.module.js';

import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';
import { OrbitControls } from './jsm/controls/OrbitControls.js';

let camera, scene, renderer, controls;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_multisampled_renderbuffers.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import { RenderPass } from './jsm/postprocessing/RenderPass.js';
import { ShaderPass } from './jsm/postprocessing/ShaderPass.js';
import { CopyShader } from './jsm/shaders/CopyShader.js';
import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

let camera, renderer, clock, group, container;

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_rendertarget_texture2darray.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
import { unzipSync } from './jsm/libs/fflate.module.js';
import { GUI } from './jsm/libs/lil-gui.module.min.js';

import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_volume_cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { ImprovedNoise } from './jsm/math/ImprovedNoise.js';

import { GUI } from './jsm/libs/lil-gui.module.min.js';
import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_volume_instancing.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { VOXLoader, VOXDataTexture3D } from './jsm/loaders/VOXLoader.js';

import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl2_volume_perlin.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { ImprovedNoise } from './jsm/math/ImprovedNoise.js';

import { GUI } from './jsm/libs/lil-gui.module.min.js';
import { WEBGL } from './jsm/WebGL.js';
import { WEBGL } from './jsm/capabilities/WebGL.js';

if ( WEBGL.isWebGL2Available() === false ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_compute.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

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

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import WebGPUStorageBuffer from './jsm/renderers/webgpu/WebGPUStorageBuffer.js';
import WebGPUUniformBuffer from './jsm/renderers/webgpu/WebGPUUniformBuffer.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_instance_uniform.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

import * as THREE from 'three';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import { TeapotGeometry } from './jsm/geometries/TeapotGeometry.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_lights_custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

import * as THREE from 'three';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import { OrbitControls } from './jsm/controls/OrbitControls.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_lights_selective.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { TeapotGeometry } from './jsm/geometries/TeapotGeometry.js';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import * as Nodes from './jsm/renderers/nodes/Nodes.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

import * as THREE from 'three';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import { TeapotGeometry } from './jsm/geometries/TeapotGeometry.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_nodes_playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@

import * as THREE from 'three';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import { NodeEditor } from './jsm/node-editor/NodeEditor.js';
import { StandardMaterialEditor } from './jsm/node-editor/materials/StandardMaterialEditor.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_rtt.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

import * as THREE from 'three';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPUTextureRenderer from './jsm/renderers/webgpu/WebGPUTextureRenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import * as Nodes from './jsm/renderers/nodes/Nodes.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

import { DDSLoader } from './jsm/loaders/DDSLoader.js';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import * as Nodes from './jsm/renderers/nodes/Nodes.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_skinning.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

import { FBXLoader } from './jsm/loaders/FBXLoader.js';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import LightsNode from './jsm/renderers/nodes/lights/LightsNode.js';

Expand Down
4 changes: 2 additions & 2 deletions examples/webgpu_skinning_points.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>

<div id="info">
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - WebGPU - Skinning Points
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGPU - Skinning Points
</div>

<script type="importmap">
Expand Down Expand Up @@ -40,8 +40,8 @@

import { FBXLoader } from './jsm/loaders/FBXLoader.js';

import WebGPU from './jsm/capabilities/WebGPU.js';
import WebGPURenderer from './jsm/renderers/webgpu/WebGPURenderer.js';
import WebGPU from './jsm/renderers/webgpu/WebGPU.js';

import * as Nodes from './jsm/renderers/nodes/Nodes.js';

Expand Down

0 comments on commit ea80c21

Please sign in to comment.