2
0
Эх сурвалжийг харах

NodeMaterial: Don't use importmap on WebGL for improve compatibilities (#22936)

* cleanup es6 style

* use relative paths for new NodeMaterial system WebGL

* update flow lib
sunag 3 жил өмнө
parent
commit
d13a064712

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
examples/jsm/libs/flow.module.js


+ 23 - 22
examples/jsm/node-editor/NodeEditor.js

@@ -20,30 +20,31 @@ import { NormalEditor } from './accessors/NormalEditor.js';
 import { TimerEditor } from './utils/TimerEditor.js';
 import { OscillatorEditor } from './utils/OscillatorEditor.js';
 import { CheckerEditor } from './procedural/CheckerEditor.js';
-import { EventDispatcher } from 'three';
+
+import { EventDispatcher } from '../../../build/three.module.js';
 
 export const ClassLib = {
-	'StandardMaterialEditor': StandardMaterialEditor,
-	'OperatorEditor': OperatorEditor,
-	'NormalizeEditor': NormalizeEditor,
-	'InvertEditor': InvertEditor,
-	'LimiterEditor': LimiterEditor,
-	'DotEditor': DotEditor,
-	'PowerEditor': PowerEditor,
-	'TrigonometryEditor': TrigonometryEditor,
-	'FloatEditor': FloatEditor,
-	'Vector2Editor': Vector2Editor,
-	'Vector3Editor': Vector3Editor,
-	'Vector4Editor': Vector4Editor,
-	'SliderEditor': SliderEditor,
-	'ColorEditor': ColorEditor,
-	'BlendEditor': BlendEditor,
-	'UVEditor': UVEditor,
-	'PositionEditor': PositionEditor,
-	'NormalEditor': NormalEditor,
-	'TimerEditor': TimerEditor,
-	'OscillatorEditor': OscillatorEditor,
-	'CheckerEditor': CheckerEditor
+	StandardMaterialEditor,
+	OperatorEditor,
+	NormalizeEditor,
+	InvertEditor,
+	LimiterEditor,
+	DotEditor,
+	PowerEditor,
+	TrigonometryEditor,
+	FloatEditor,
+	Vector2Editor,
+	Vector3Editor,
+	Vector4Editor,
+	SliderEditor,
+	ColorEditor,
+	BlendEditor,
+	UVEditor,
+	PositionEditor,
+	NormalEditor,
+	TimerEditor,
+	OscillatorEditor,
+	CheckerEditor
 };
 
 export class NodeEditor extends EventDispatcher {

+ 1 - 1
examples/jsm/node-editor/materials/StandardMaterialEditor.js

@@ -1,6 +1,6 @@
 import { ObjectNode, LabelElement } from '../../libs/flow.module.js';
 import { MeshStandardNodeMaterial, ColorNode, FloatNode } from '../../renderers/nodes/Nodes.js';
-import * as THREE from 'three';
+import * as THREE from '../../../../build/three.module.js';
 
 const NULL_COLOR = new ColorNode();
 const NULL_FLOAT = new FloatNode();

+ 1 - 1
examples/jsm/renderers/nodes/ShaderNode.js

@@ -25,7 +25,7 @@ import JoinNode from './utils/JoinNode.js';
 import SplitNode from './utils/SplitNode.js';
 
 // core
-import { Vector2, Vector3, Vector4, Color } from 'three';
+import { Vector2, Vector3, Vector4, Color } from '../../../../build/three.module.js';
 
 const NodeHandler = {
 

+ 1 - 1
examples/jsm/renderers/nodes/core/Node.js

@@ -1,6 +1,6 @@
 import { NodeUpdateType } from './constants.js';
 
-import { MathUtils } from 'three';
+import { MathUtils } from '../../../../../build/three.module.js';
 
 class Node {
 

+ 1 - 1
examples/jsm/renderers/nodes/core/NodeBuilder.js

@@ -6,7 +6,7 @@ import NodeCode from './NodeCode.js';
 import NodeKeywords from './NodeKeywords.js';
 import { NodeUpdateType } from './constants.js';
 
-import { REVISION, LinearEncoding } from 'three';
+import { REVISION, LinearEncoding } from '../../../../../build/three.module.js';
 
 const shaderStages = [ 'fragment', 'vertex' ];
 

+ 1 - 1
examples/jsm/renderers/nodes/display/ColorSpaceNode.js

@@ -6,7 +6,7 @@ import { ShaderNode,
 
 import { LinearEncoding,
 	sRGBEncoding/*, RGBEEncoding, RGBM7Encoding, RGBM16Encoding,
-	RGBDEncoding, GammaEncoding*/ } from 'three';
+	RGBDEncoding, GammaEncoding*/ } from '../../../../../build/three.module.js';
 
 export const LinearToLinear = new ShaderNode( ( inputs ) => {
 

+ 1 - 1
examples/jsm/renderers/nodes/display/NormalMapNode.js

@@ -8,7 +8,7 @@ import TempNode from '../core/TempNode.js';
 import ModelNode from '../accessors/ModelNode.js';
 import { ShaderNode, cond, add, mul, dFdx, dFdy, cross, max, dot, normalize, inversesqrt, equal } from '../ShaderNode.js';
 
-import { TangentSpaceNormalMap, ObjectSpaceNormalMap } from 'three';
+import { TangentSpaceNormalMap, ObjectSpaceNormalMap } from '../../../../../build/three.module.js';
 
 // Normal Mapping Without Precomputed Tangents
 // http://www.thetenthplanet.de/archives/1180

+ 1 - 1
examples/jsm/renderers/nodes/inputs/ColorNode.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Color } from 'three';
+import { Color } from '../../../../../build/three.module.js';
 
 class ColorNode extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/inputs/Matrix3Node.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Matrix3 } from 'three';
+import { Matrix3 } from '../../../../../build/three.module.js';
 
 class Matrix3Node extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/inputs/Matrix4Node.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Matrix4 } from 'three';
+import { Matrix4 } from '../../../../../build/three.module.js';
 
 class Matrix4Node extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/inputs/Vector2Node.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Vector2 } from 'three';
+import { Vector2 } from '../../../../../build/three.module.js';
 
 class Vector2Node extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/inputs/Vector3Node.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Vector3 } from 'three';
+import { Vector3 } from '../../../../../build/three.module.js';
 
 class Vector3Node extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/inputs/Vector4Node.js

@@ -1,5 +1,5 @@
 import InputNode from '../core/InputNode.js';
-import { Vector4 } from 'three';
+import { Vector4 } from '../../../../../build/three.module.js';
 
 class Vector4Node extends InputNode {
 

+ 1 - 1
examples/jsm/renderers/nodes/lights/LightNode.js

@@ -8,7 +8,7 @@ import MathNode from '../math/MathNode.js';
 import { NodeUpdateType } from '../core/constants.js';
 import { getDistanceAttenuation } from '../functions/BSDFs.js';
 
-import { Color } from 'three';
+import { Color } from '../../../../../build/three.module.js';
 
 class LightNode extends Node {
 

+ 1 - 1
examples/jsm/renderers/nodes/materials/LineBasicNodeMaterial.js

@@ -1,4 +1,4 @@
-import { LineBasicMaterial } from 'three';
+import { LineBasicMaterial } from '../../../../../build/three.module.js';
 
 class LineBasicNodeMaterial extends LineBasicMaterial {
 

+ 1 - 1
examples/jsm/renderers/nodes/materials/MeshBasicNodeMaterial.js

@@ -1,4 +1,4 @@
-import { MeshBasicMaterial } from 'three';
+import { MeshBasicMaterial } from '../../../../../build/three.module.js';
 
 class MeshBasicNodeMaterial extends MeshBasicMaterial {
 

+ 1 - 1
examples/jsm/renderers/nodes/materials/MeshStandardNodeMaterial.js

@@ -1,4 +1,4 @@
-import { MeshStandardMaterial } from 'three';
+import { MeshStandardMaterial } from '../../../../../build/three.module.js';
 
 class MeshStandardNodeMaterial extends MeshStandardMaterial {
 

+ 1 - 1
examples/jsm/renderers/nodes/materials/PointsNodeMaterial.js

@@ -1,4 +1,4 @@
-import { PointsMaterial } from 'three';
+import { PointsMaterial } from '../../../../../build/three.module.js';
 
 class PointsNodeMaterial extends PointsMaterial {
 

+ 1 - 1
examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js

@@ -3,7 +3,7 @@ import SlotNode from './SlotNode.js';
 import GLSLNodeParser from '../../nodes/parsers/GLSLNodeParser.js';
 import WebGLPhysicalContextNode from './WebGLPhysicalContextNode.js';
 
-import { ShaderChunk, LinearEncoding, RGBAFormat, UnsignedByteType, sRGBEncoding } from 'three';
+import { ShaderChunk, LinearEncoding, RGBAFormat, UnsignedByteType, sRGBEncoding } from '../../../../../build/three.module.js';
 
 const shaderStages = [ 'vertex', 'fragment' ];
 

+ 1 - 1
examples/jsm/renderers/webgl/nodes/WebGLNodes.js

@@ -1,7 +1,7 @@
 import { WebGLNodeBuilder } from './WebGLNodeBuilder.js';
 import NodeFrame from '../../nodes/core/NodeFrame.js';
 
-import { Material } from 'three';
+import { Material } from '../../../../../build/three.module.js';
 
 const builders = new WeakMap();
 export const nodeFrame = new NodeFrame();

+ 1 - 8
examples/webgl_materials_nodes_playground.html

@@ -9,13 +9,6 @@
 		<link type="text/css" rel="stylesheet" href="main.css">
   </head>
   <body>
-	<script type="importmap">
-	{
-		"imports": {
-			"three": "../build/three.module.js"
-		}
-	}
-	</script>
 	<style>
 	body {
 		overflow: hidden;
@@ -41,7 +34,7 @@
 	</style>
 	<script type="module">
 
-		import * as THREE from 'three';
+		import * as THREE from '../build/three.module.js';
 
 		import { nodeFrame } from './jsm/renderers/webgl/nodes/WebGLNodes.js';
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно