提交 f2086ff6 编写于 作者: M Mr.doob

Examples: Fixed eslint warnings.

上级 8e605ab3
......@@ -105,7 +105,7 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) );
if ( _hovered !== object && _hovered !== null) {
if ( _hovered !== object && _hovered !== null ) {
scope.dispatchEvent( { type: 'hoveroff', object: _hovered } );
......@@ -113,7 +113,7 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
_hovered = null;
}
if ( _hovered !== object ) {
scope.dispatchEvent( { type: 'hoveron', object: object } );
......
......@@ -114,7 +114,7 @@ var DragControls = function ( _objects, _camera, _domElement ) {
_plane.setFromNormalAndCoplanarPoint( _camera.getWorldDirection( _plane.normal ), _worldPosition.setFromMatrixPosition( object.matrixWorld ) );
if ( _hovered !== object && _hovered !== null) {
if ( _hovered !== object && _hovered !== null ) {
scope.dispatchEvent( { type: 'hoveroff', object: _hovered } );
......@@ -122,7 +122,7 @@ var DragControls = function ( _objects, _camera, _domElement ) {
_hovered = null;
}
if ( _hovered !== object ) {
scope.dispatchEvent( { type: 'hoveron', object: object } );
......
import {
Matrix4,
Vector2
} from "../../../build/three.module.js";
Matrix4,
Vector2
} from '../../../build/three.module.js';
/**
* References:
* https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
......@@ -9,49 +9,49 @@ import {
var SSRShader = {
defines: {
MAX_STEP: 0,
PERSPECTIVE_CAMERA: true,
DISTANCE_ATTENUATION: true,
FRESNEL: true,
INFINITE_THICK: false,
SELECTIVE: false,
},
defines: {
MAX_STEP: 0,
PERSPECTIVE_CAMERA: true,
DISTANCE_ATTENUATION: true,
FRESNEL: true,
INFINITE_THICK: false,
SELECTIVE: false,
},
uniforms: {
'tDiffuse': { value: null },
'tNormal': { value: null },
'tMetalness': { value: null },
'tDepth': { value: null },
'cameraNear': { value: null },
'cameraFar': { value: null },
'resolution': { value: new Vector2() },
'cameraProjectionMatrix': { value: new Matrix4() },
'cameraInverseProjectionMatrix': { value: new Matrix4() },
'opacity': { value: .5 },
'maxDistance': { value: 180 },
'cameraRange': { value: 0 },
'surfDist': { value: .007 },
'thickTolerance': { value: .03 },
},
vertexShader: /* glsl */`
uniforms: {
"tDiffuse": { value: null },
"tNormal": { value: null },
"tMetalness": { value: null },
"tDepth": { value: null },
"cameraNear": { value: null },
"cameraFar": { value: null },
"resolution": { value: new Vector2() },
"cameraProjectionMatrix": { value: new Matrix4() },
"cameraInverseProjectionMatrix": { value: new Matrix4() },
"opacity": { value: .5 },
"maxDistance": { value: 180 },
"cameraRange": { value: 0 },
"surfDist": { value: .007 },
"thickTolerance": { value: .03 },
},
vertexShader: /* glsl */`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`,
`,
fragmentShader: /* glsl */`
fragmentShader: /* glsl */`
// precision highp float;
precision highp sampler2D;
varying vec2 vUv;
......@@ -221,41 +221,41 @@ var SSRShader = {
var SSRDepthShader = {
defines: {
"PERSPECTIVE_CAMERA": 1
},
defines: {
'PERSPECTIVE_CAMERA': 1
},
uniforms: {
uniforms: {
"tDepth": { value: null },
"cameraNear": { value: null },
"cameraFar": { value: null },
'tDepth': { value: null },
'cameraNear': { value: null },
'cameraFar': { value: null },
},
},
vertexShader: /* glsl */`
vertexShader: /* glsl */`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`,
`,
fragmentShader: /* glsl */`
fragmentShader: /* glsl */`
uniform sampler2D tDepth;
uniform sampler2D tDepth;
uniform float cameraNear;
uniform float cameraFar;
uniform float cameraNear;
uniform float cameraFar;
varying vec2 vUv;
varying vec2 vUv;
#include <packing>
#include <packing>
float getLinearDepth( const in vec2 uv ) {
......@@ -273,51 +273,51 @@ var SSRDepthShader = {
}
void main() {
void main() {
float depth = getLinearDepth( vUv );
float depth = getLinearDepth( vUv );
float d = 1.0 - depth;
// d=(d-.999)*1000.;
gl_FragColor = vec4( vec3( d ), 1.0 );
gl_FragColor = vec4( vec3( d ), 1.0 );
}
}
`
`
};
var SSRBlurShader = {
uniforms: {
uniforms: {
"tDiffuse": { value: null },
"resolution": { value: new Vector2() },
"opacity": { value: .5 },
'tDiffuse': { value: null },
'resolution': { value: new Vector2() },
'opacity': { value: .5 },
},
},
vertexShader: /* glsl */`
vertexShader: /* glsl */`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`,
`,
fragmentShader: /* glsl */`
fragmentShader: /* glsl */`
uniform sampler2D tDiffuse;
uniform vec2 resolution;
varying vec2 vUv;
void main() {
uniform sampler2D tDiffuse;
uniform vec2 resolution;
varying vec2 vUv;
void main() {
//reverse engineering from PhotoShop blur filter, then change coefficient
vec2 texelSize = ( 1.0 / resolution );
vec2 texelSize = ( 1.0 / resolution );
vec4 c=texture2D(tDiffuse,vUv);
......
import {
Matrix4,
Vector2
} from "../../../build/three.module.js";
} from '../../../build/three.module.js';
var SSRrShader = {
......@@ -15,21 +15,21 @@ var SSRrShader = {
uniforms: {
"tDiffuse": { value: null },
"tSpecular": { value: null },
"tNormalSelects": { value: null },
"tRefractive": { value: null },
"tDepth": { value: null },
"tDepthSelects": { value: null },
"cameraNear": { value: null },
"cameraFar": { value: null },
"resolution": { value: new Vector2() },
"cameraProjectionMatrix": { value: new Matrix4() },
"cameraInverseProjectionMatrix": { value: new Matrix4() },
"ior": { value: 1.03 },
"cameraRange": { value: 0 },
"maxDistance": { value: 180 },
"surfDist": { value: .007 },
'tDiffuse': { value: null },
'tSpecular': { value: null },
'tNormalSelects': { value: null },
'tRefractive': { value: null },
'tDepth': { value: null },
'tDepthSelects': { value: null },
'cameraNear': { value: null },
'cameraFar': { value: null },
'resolution': { value: new Vector2() },
'cameraProjectionMatrix': { value: new Matrix4() },
'cameraInverseProjectionMatrix': { value: new Matrix4() },
'ior': { value: 1.03 },
'cameraRange': { value: 0 },
'maxDistance': { value: 180 },
'surfDist': { value: .007 },
},
......@@ -240,14 +240,14 @@ var SSRrShader = {
var SSRrDepthShader = {
defines: {
"PERSPECTIVE_CAMERA": 1
'PERSPECTIVE_CAMERA': 1
},
uniforms: {
"tDepth": { value: null },
"cameraNear": { value: null },
"cameraFar": { value: null },
'tDepth': { value: null },
'cameraNear': { value: null },
'cameraFar': { value: null },
},
......
......@@ -3,7 +3,7 @@ import {
Group,
LightProbe,
WebGLCubeRenderTarget
} from "../../../build/three.module.js";
} from '../../../build/three.module.js';
class SessionLightProbe {
......@@ -43,11 +43,11 @@ class SessionLightProbe {
this.xrWebGLBinding = new XRWebGLBinding( session, gl );
this.lightProbe.addEventListener('reflectionchange', () => {
this.lightProbe.addEventListener( 'reflectionchange', () => {
this.updateReflection();
});
} );
}
......
......@@ -92,9 +92,9 @@ class XRHandOculusMeshModel {
const bone = object.getObjectByName( boneName.replace( /%/g, handedness === 'right' ? 'r' : 'l' ) );
if ( bone !== undefined) {
if ( bone !== undefined ) {
bone.jointName = joints [ i ];
bone.jointName = joints[ i ];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册