three_js_core library

Classes

AmbientLight
This light globally illuminates all objects in the scene equally.
AmbientLightProbe
ArrayCamera
name can be used in order to efficiently render a scene with a predefined set of cameras. This is an important performance aspect for rendering VR scenes.
Audio
This utility class holds static references to some global audio objects.
BatchedMesh
Bone
A bone which is part of a Skeleton. The skeleton in turn is used by the SkinnedMesh. Bones are almost identical to a blank Object3D.
Bounds
BoxGeometry
name is a geometry class for a rectangular cuboid with a given width, height, and depth. On creation, the cuboid is centred on the origin, with each edge parallel to one of the axes.
BufferGeometry
A representation of mesh, line, or point geometry. Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.
BufferGeometryParameters
Camera
Abstract base class for cameras. This class should always be inherited when you build a new camera.
CameraView
CanvasTexture
Creates a texture from a canvas element.
Clock
Object for keeping track of time. This uses DateTime.now().millisecondsSinceEpoch.
CompressedArrayTexture
CompressedTexture
Creates an texture 2D array based on data in compressed form, for example from a DDS file.
Console
CubeCamera
Creates 6 cameras that render to a page:WebGLCubeRenderTarget.
CubeTexture
Creates a cube texture made up of six images.
Data3DTexture
Creates a three-dimensional texture from raw data, with parameters to divide it into width, height, and depth.
DataArrayTexture
Creates an array of textures directly from raw data, width and height and depth.
DataTexture
Creates a texture directly from raw data, width and height.
DepthTexture
This class can be used to automatically save the depth information of a rendering into a texture.
DirectionalLight
A light that gets emitted in a specific direction. This light will behave as though it is infinitely far away and the rays produced from it are all parallel. The common use case for this is to simulate daylight; the sun is far enough away that its position can be considered to be infinite, and all light rays coming from it are parallel.
DirectionalLightShadow
This is used internally by DirectionalLights for calculating shadows.
Event
EventTouch
Face
FlutterTexture
Creates a texture from a canvas element.
Fog
This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.
FogBase
FogExp2
This class contains the parameters that define exponential squared fog, which gives a clear view near the camera and a faster than exponentially densening fog farther from the camera.
FramebufferTexture
This class can only be used in combination with WebGLRenderer.copyFramebufferToTexture. final pixelRatio = devicePixelRatio; final textureSize = 128 * pixelRatio;
Frustum
Group
This is almost identical to an Object3D. Its purpose is to make working with animatins of objects syntactically clearer.
GroupMaterial
GroupTexture
HemisphereLight
A light source positioned directly above the scene, with color fading from the sky color to the ground color.
HemisphereLightProbe
ImageDataInfo
ImageElement
InstancedBufferGeometry
An instanced version of BufferGeometry.
InstancedMesh
A special version of Mesh with instanced rendering support. Use name if you have to render a large number of objects with the same geometry and material but with different world transformations. The usage of name will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.
Intersection
Layers
A Layers object assigns an Object3D to 1 or more of 32 layers numbered 0 to 31 - internally the layers are stored as a bit mask, and by default all Object3Ds are a member of layer 0.
Light
Abstract base class for lights - all other light types inherit the properties and methods described here.
LightProbe
Light probes are an alternative way of adding light to a 3D scene. Unlike classical light sources (e.g. directional, point or spot lights), light probes do not emit light. Instead they store information about light passing through 3D space. During rendering, the light that hits a 3D object is approximated by using the data from the light probe.
LightShadow
Serves as a base class for the other shadow classes.
Line
A continuous line.
LineBasicMaterial
A material for drawing wireframe-style geometries.
LineDashedMaterial
A material for drawing wireframe-style geometries with dashed lines.
LineLoop
A continuous line that connects back to the start.
LineSegments
A series of lines drawn between pairs of vertices.
LOD
Level of Detail - show meshes with more or less geometry based on distance from the camera.
Material
Abstract base class for materials.
Mesh
Class representing triangular polygon mesh based objects. Also serves as a base for other classes such as SkinnedMesh.
MeshBasicMaterial
A material for drawing geometries in a simple shaded (flat or wireframe) way.
MeshDepthMaterial
A material for drawing geometry by depth. Depth is based off of the camera near and far plane. White is nearest, black is farthest.
MeshDistanceMaterial
MeshDistanceMaterial is internally used for implementing shadow mapping with PointLights.
MeshGouraudMaterial
MeshLambertMaterial
A material for non-shiny surfaces, without specular highlights.
MeshMatcapMaterial
MeshMatcapMaterial is defined by a MatCap (or Lit Sphere) texture, which encodes the material color and shading.
MeshNormalMaterial
A material that maps the normal vectors to RGB colors.
MeshPhongMaterial
A material for shiny surfaces with specular highlights.
MeshPhysicalMaterial
An extension of the MeshStandardMaterial, providing more advanced physically-based rendering properties:
MeshStandardMaterial
A standard physically based material, using Metallic-Roughness workflow.
MeshToonMaterial
A material implementing toon shading.
MorphColor
MorphNormals
MorphTarget
MultiDrawRenderList
Object3D
This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in 3D space.
Object3dMeta
OpenGLTexture
OrthographicCamera
Camera that uses orthographic projection.
Peripherals
PeripheralsState
PerspectiveCamera
Camera that uses perspective projection.
PlaneGeometry
A class for generating plane geometries.
PMREMGenerator
PMREMGeneratorOptions
PointLight
A light that gets emitted from a single point in all directions. A common use case for this is to replicate the light emitted from a bare lightbulb.
PointLightShadow
This is used internally by PointLights for calculating shadows.
Points
A class for displaying points. The points are rendered by the WebGLRenderer using gl.POINTS.
PointsMaterial
The default material used by Points.
Pool
PositionalAudio
PositionalAudioHelper
ProjectedMaterial
ProjectedMaterialUtils
RawShaderMaterial
This class works just like ShaderMaterial, except that definitions of built-in uniforms and attributes are not automatically prepended to the GLSL shader code.
Raycaster
This class is designed to assist with raycasting. Raycasting is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.
RectAreaLight
RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be used to simulate light sources such as bright windows or strip lighting.
RenderTarget
ReservedRange
Scene
Scenes allow you to set up what and where is to be rendered by three.js.
Settings
ShaderMaterial
A material rendered with custom shaders. A shader is a small program written in GLSL that runs on the GPU. You may want to use a custom shader if you need to:
ShadowMaterial
This material can receive shadows, but otherwise is completely transparent.
Skeleton
Use an array of bones to create a skeleton that can be used by a SkinnedMesh.
SkinnedMesh
A mesh that has a Skeleton with bones that can then be used to animate the vertices of the geometry.
Source
Represents the data source of a texture.
SphereGeometry
A class for generating sphere geometries.
SpotLight
This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.
SpotLightShadow
This is used internally by SpotLights for calculating shadows.
Sprite
A sprite is a plane that always faces towards the camera, generally with a partially transparent texture applied.
SpriteMaterial
A material for a use with a Sprite.
StereoCamera
Dual page:PerspectiveCamera PerspectiveCameras used for effects such as 3D Anaglyph or Parallax Barrier.
Texture
Create a texture to apply to a surface or as a reflection or refraction map.
TextureRangeInfo
TextureUtils
ThreeJS
threeJs utility class. If you want to learn how to connect cannon.js with js, please look at the examples/threejs_* instead.
TypeByteLength
Uniform
Uniforms are global GLSL variables. They are passed to shader programs.
UniformsGroup
UniformsUtils
VideoTexture
VideoTextureOptions
WeakMap<K, V>
A WeakMap lets you garbage-collect its keys. Please note: The key can be garbage-collected, not the value.
WebGL3DRenderTarget
WebGLArrayRenderTarget
WebGLCubeRenderTarget
WebGLRenderer
WebGLRendererParameters
WebGLRenderTarget
WebGLRenderTargetOptions
WebPointerEvent
WebXRManager

Mixins

EventDispatcher
JavaScript events for custom objects.

Extensions

Box3 on BoundingBox
Ex on double

Properties

console Console
getter/setter pair
extraLodSigma List<double>
final
gouraudShader Map<String, dynamic>
final
horizontalBlurShader Map<String, dynamic>
Two pass Gaussian blur filter (horizontal and vertical blur shaders)
getter/setter pair
ID_ATTR_NAME String
final
lodMin int
This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture. This allows different levels of blur to be quickly accessed based on material roughness. It is packed into a special CubeUV format that allows us to perform custom interpolation so that we can support nonlinear formats such as RGBE. Unlike a traditional mipmap chain, it only goes down to the lodMin level (above), and then creates extra even more filtered 'mips' at the same lodMin resolution, associated with higher roughness levels. In this way we maintain resolution to smoothly interpolate diffuse lighting while limiting sampling computation.
getter/setter pair
materialId int
getter/setter pair
shaderChunk Map<String, String>
getter/setter pair
shaderLib Map<String, dynamic>
getter/setter pair
shaderLibStandard Map<String, dynamic>
getter/setter pair
textureId int
getter/setter pair
uniformsLib Map<String, dynamic>
getter/setter pair
verticalBlurShader Map<String, dynamic>
Two pass Gaussian blur filter (horizontal and vertical blur shaders)
getter/setter pair

Functions

ascIdSort(dynamic a, dynamic b) int
checkIntersection(Object3D object, Material? material, Raycaster raycaster, Ray ray, Vector3 pA, Vector3 pB, Vector3 pC, Vector3 point) Intersection?
cloneUniforms(Map<String, dynamic> src) Map<String, dynamic>
cloneUniformsGroups<T>(dynamic src) List
copyAttributeData(dynamic src, dynamic target, [int targetOffset = 0]) → void
getUnlitUniformColorSpace(WebGLRenderer renderer) String
mergeUniforms(dynamic uniforms) Map<String, dynamic>
now() int
serializeImage(dynamic image) Map<String, dynamic>
sortOpaque(Pool a, Pool b) int
sortTransparent(Pool a, Pool b) int
testPoint(Vector3 point, int index, double localThresholdSq, Matrix4 matrixWorld, Raycaster raycaster, List<Intersection> intersects, Object3D object) → void
transformVertex(Vector3 vertexPosition, Vector3 mvPosition, Vector2 center, Vector scale, double? sin, double? cos) → void

Typedefs

OnRender = void Function({Camera? camera, BufferGeometry? geometry, Map<String, dynamic>? group, Material? material, Object3D? mesh, RenderTarget? renderTarget, WebGLRenderer? renderer, Scene? scene})