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

Deprecation of WebGL 1.0 support in c3DEngine #2186

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/tutorials/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"Fundamentals": {
"title": "Fundamentals"
},
"webgl": {
"title": "WebGL 1.0/2.0"
},
"Raster-data-Lambert93": {
"title": "Lambert conformal conic"
},
Expand Down
32 changes: 0 additions & 32 deletions docs/tutorials/webgl.md

This file was deleted.

6 changes: 6 additions & 0 deletions src/Core/Deprecated/Undeprecator.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,10 @@ export const deprecatedFeature2MeshOptions = (options) => {
}
};

export const deprecatedC3DEngineWebGLOptions = (options) => {
if (options.isWebGL2 === false) {
console.warn('WebGL1 support (isWebGL2=false) is deprecated and will be removed in iTowns 2.43. This follows its deprecation by three.js. If you are impacted by this change, please discuss in the following issue: https://github.com/iTowns/itowns/issues/2152.');
}
};

export default {};
6 changes: 0 additions & 6 deletions src/Core/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ class View extends THREE.EventDispatcher {
* var view = itowns.View('EPSG:4326', viewerDiv, { camera: { type: itowns.CAMERA_TYPE.ORTHOGRAPHIC } });
* var customControls = itowns.THREE.OrbitControls(view.camera.camera3D, viewerDiv);
*
* @example <caption><b>Enable WebGl 1.0 instead of WebGl 2.0.</b></caption>
* var viewerDiv = document.getElementById('viewerDiv');
* const extent = new Extent('EPSG:3946', 1837816.94334, 1847692.32501, 5170036.4587, 5178412.82698);
* var view = new itowns.View('EPSG:4326', viewerDiv, { renderer: { isWebGL2: false } });
*
* @param {string} crs - The default CRS of Three.js coordinates. Should be a cartesian CRS.
* @param {HTMLElement} viewerDiv - Where to instanciate the Three.js scene in the DOM
* @param {Object=} options - Optional properties.
Expand All @@ -145,7 +140,6 @@ class View extends THREE.EventDispatcher {
* a default one will be constructed. In this case, if options.renderer is an object, it will be used to
* configure the renderer (see {@link c3DEngine}. If not present, a new &lt;canvas> will be created and
* added to viewerDiv (mutually exclusive with mainLoop)
* @param {boolean} [options.renderer.isWebGL2=true] - enable webgl 2.0 for THREE.js.
* @param {?Scene} [options.scene3D] - [THREE.Scene](https://threejs.org/docs/#api/en/scenes/Scene) instance to use, otherwise a default one will be constructed
* @param {?Color} options.diffuse - [THREE.Color](https://threejs.org/docs/?q=color#api/en/math/Color) Diffuse color terrain material.
* This color is applied to terrain if there isn't color layer on terrain extent (by example on pole).
Expand Down
3 changes: 3 additions & 0 deletions src/Renderer/c3DEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import Capabilities from 'Core/System/Capabilities';
import { unpack1K } from 'Renderer/LayeredMaterial';
import WEBGL from 'ThreeExtended/capabilities/WebGL';
import Label2DRenderer from 'Renderer/Label2DRenderer';
import { deprecatedC3DEngineWebGLOptions } from 'Core/Deprecated/Undeprecator';

const depthRGBA = new THREE.Vector4();
class c3DEngine {
constructor(rendererOrDiv, options = {}) {
deprecatedC3DEngineWebGLOptions(options);

const NOIE = !Capabilities.isInternetExplorer();
// pick sensible default options
if (options.antialias === undefined) {
Expand Down