three APIs
- Vector3
- Mesh
- Vector2
- Color
- Matrix4
- PerspectiveCamera
- MeshBasicMaterial
- Scene
- ShaderMaterial
- BufferGeometry
- Quaternion
- Object3D
- LineBasicMaterial
- TextureLoader
- EventDispatcher
- DoubleSide
- LineSegments
- FileLoader
- UniformsUtils
- Vector4
- Box3
- Group
- DirectionalLight
- BufferAttribute
- MathUtils
- NearestFilter
- LinearFilter
- Spherical
- OrthographicCamera
- WebGLRenderer
- BackSide
- Float32BufferAttribute
- MeshPhongMaterial
- Points
- MOUSE
- WebGLRenderTarget
- AmbientLight
- MeshStandardMaterial
- PlaneBufferGeometry
- BoxGeometry
- Raycaster
- FrontSide
- Sphere
- Loader
- PointsMaterial
- TOUCH
- sRGBEncoding
- AdditiveBlending
- Line
- RepeatWrapping
- RGBAFormat
- RGBFormat
- Plane
- ClampToEdgeWrapping
- ShaderLib
- UniformsLib
- Clock
- FloatType
- UnsignedByteType
- BoxBufferGeometry
- Euler
- Texture
- VertexColors
- InterleavedBufferAttribute
- Material
- DepthTexture
- PCFSoftShadowMap
- Matrix3
- LinearMipmapLinearFilter
- LoaderUtils
- AnimationClip
- Bone
- PointLight
- QuaternionKeyframeTrack
- Skeleton
- SkinnedMesh
- SpotLight
- VectorKeyframeTrack
- NearestMipmapLinearFilter
- DataTextureLoader
- HalfFloatType
- LinearEncoding
- RawShaderMaterial
- CanvasTexture
- Geometry
- MeshNormalMaterial
- DataTexture
- ShaderChunk
- Shape
- SphereGeometry
- SphereBufferGeometry
- HemisphereLight
- FogExp2
- Box3Helper
- InstancedMesh
- Frustum
- Curve
- MirroredRepeatWrapping
- MeshLambertMaterial
- NumberKeyframeTrack
- PropertyBinding
- InterleavedBuffer
- Interpolant
- InterpolateDiscrete
- InterpolateLinear
- LineLoop
- LinearMipmapNearestFilter
- MeshPhysicalMaterial
- NearestMipmapNearestFilter
- TangentSpaceNormalMap
- TriangleFanDrawMode
- TriangleStripDrawMode
- RGBEEncoding
- RGBEFormat
- NoBlending
- PlaneGeometry
- Face3
- AxesHelper
- Uniform
- MeshDepthMaterial
- RGBADepthPacking
- LuminanceFormat
- DepthStencilFormat
- UnsignedInt248Type
- NearestMipMapLinearFilter
- BufferGeometryLoader
- ExtrudeBufferGeometry
- ShapeBufferGeometry
- InstancedInterleavedBuffer
- Line3
- InstancedBufferGeometry
- WireframeGeometry
- NoColors
- LoadingManager
- CameraHelper
- CylinderBufferGeometry
- TorusBufferGeometry
- GridHelper
- RingBufferGeometry
- DefaultLoadingManager
- Ray
- EquirectangularReflectionMapping
- Uint16BufferAttribute
- TrianglesDrawMode
- LinearMipMapLinearFilter
- BoxHelper
- Triangle
- ShapeGeometry
- JSONLoader
- Path
- CylinderGeometry
- ImageUtils
- CompressedTextureLoader
- RGBA_S3TC_DXT3_Format
- RGBA_S3TC_DXT5_Format
- RGB_ETC1_Format
- RGB_S3TC_DXT1_Format
- CurvePath
- EdgesGeometry
- DynamicDrawUsage
- StaticDrawUsage
- RedFormat
- AddEquation
- CustomBlending
- DstAlphaFactor
- DstColorFactor
- UnsignedShortType
- ZeroFactor
- NormalBlending
- SrcAlphaFactor
- OneMinusSrcAlphaFactor
- UnsignedIntType
- WebGLMultisampleRenderTarget
- Camera
- IcosahedronBufferGeometry
- LineDashedMaterial
- CircleGeometry
OtherRelated APIs
three#FogExp2 JavaScript Examples
The following examples show how to use
three#FogExp2.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: mars.js From 3DTilesRendererJS with Apache License 2.0 | 5 votes |
function init() {
const fog = new FogExp2( 0xd8cec0, .0075, 250 );
scene = new Scene();
// primary camera view
renderer = new WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setClearColor( 0xd8cec0 );
renderer.outputEncoding = sRGBEncoding;
document.body.appendChild( renderer.domElement );
renderer.domElement.tabIndex = 1;
camera = new PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 4000 );
camera.position.set( 20, 10, 20 );
// controls
controls = new FlyOrbitControls( camera, renderer.domElement );
controls.screenSpacePanning = false;
controls.minDistance = 1;
controls.maxDistance = 2000;
controls.maxPolarAngle = Math.PI / 2;
controls.baseSpeed = 0.1;
controls.fastSpeed = 0.2;
// lights
const dirLight = new DirectionalLight( 0xffffff );
dirLight.position.set( 1, 2, 3 );
scene.add( dirLight );
const ambLight = new AmbientLight( 0xffffff, 0.2 );
scene.add( ambLight );
const tilesParent = new Group();
tilesParent.rotation.set( Math.PI / 2, 0, 0 );
scene.add( tilesParent );
groundTiles = new TilesRenderer( 'https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize_tileset.json' );
groundTiles.fetchOptions.mode = 'cors';
groundTiles.lruCache.minSize = 900;
groundTiles.lruCache.maxSize = 1300;
groundTiles.errorTarget = 12;
skyTiles = new TilesRenderer( 'https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_sky/0528_0260184_to_s64o256_sky_tileset.json' );
skyTiles.fetchOptions.mode = 'cors';
skyTiles.lruCache = groundTiles.lruCache;
tilesParent.add( groundTiles.group, skyTiles.group );
onWindowResize();
window.addEventListener( 'resize', onWindowResize, false );
const gui = new GUI();
gui.add( params, 'fog' ).onChange( v => {
scene.fog = v ? fog : null;
} );
gui.add( params, 'displayBoxBounds' );
gui.add( params, 'errorTarget', 0, 100 );
gui.open();
}
Example #2
Source File: index.js From map33.js with MIT License | 5 votes |
scene.fog = new FogExp2(0x91abb5, 0.0000001);