Releases: uinosoft/t3d.js
v0.3.1
变更日志
- 特性:为
TextureBase
添加userData
属性 - 特性:为
DirectionalLightShadow.frustumEdgeFalloff
添加垂直淡出支持 - 特性:为
Matrix3
添加isIdentity
方法 - 特性:为
Renderer
添加asyncReadPixel
选项 - 特性:为
MathUtils
添加lerp
方法 - 修复:解决
CylinderGeometry
中设置多个高度分段缺失三角形的问题 - 修复:当一个盖子的半径为零时,移除
CylinderGeometry
中的共线三角形 - 性能:在
DirectionalLightShadow
渲染期间启用相机剔除 - 重构:同步阴影相机与光源的up方向
- 重构:优化
getPointShadow
方法 - 文档:为
Geometry.instanceCount
添加描述性注释 - 特性(addons):添加数学类
OBB
- 特性(addons):在
GLTFLoader
中添加对KHR_animation_pointer
的支持 - 特性(addons):在
GLTFLoader
中为纹理添加mimeType
信息 - 特性(addons):添加
GLTFExporter
- 特性(addons):在
GLTFExporter
中添加对GLTF_SEPARATE
格式的支持 - 特性(addons):在
GLTFExporter
中添加实例化和光照扩展 - 特性(addons):在
GLTFExporter
中添加draco
选项 - 特性(addons):添加
DRACOExporter
- 特性(addons):引入新的
LightShadowAdapter
- 特性(addons):添加
InstancedMaterial.js
文件,整合所有实例化材质扩展 - 特性(addons):引入
AttenuationMaterial
,整合衰减材质扩展 - 特性(addons):引入
LatheBuilder
- 修复(addons):修正
HeatmapGenerator
和IDWMapGenerator
的dispose
方法 - 修复(addons):当相机在包围盒内时,修正
LightShadowAdapter
中的阴影盒计算 - 修复(addons):修正
TransformControls
中相机处于极端位置时的轴平面位置计算错误 - 重构(addons):将
LightShadowAdapter.bindBox
从Box3
改为OBB
- 重构(addons):移除
Timer
和Clock
中对Date.now()
的兼容性回退 - 特性(examples):添加
material_shader_volume_layered
示例 - 特性(examples):在
geometry_geometries
中添加TorusBuilder
- 重构(examples):清理代码
Changelog
- feat: add
userData
property toTextureBase
- feat: add vertical fade support to
DirectionalLightShadow.frustumEdgeFalloff
- feat: add
isIdentity
method toMatrix3
- feat: add
asyncReadPixel
option toRenderer
- feat: add
lerp
method toMathUtils
- fix: resolve missing triangles issue with multiple height segments in
CylinderGeometry
- fix: remove collinear triangles in
CylinderGeometry
when one cap radius is zero - perf: enable camera culling during DirectionalLightShadow rendering
- refactor: synchronize shadow camera orientation with light source
- refactor: optimize
getPointShadow
method - docs: add descriptive comment for
Geometry.instanceCount
- feat(addons): add
OBB
- feat(addons): add support for
KHR_animation_pointer
inGLTFLoader
- feat(addons): add
mimeType
information to textures inGLTFLoader
- feat(addons): add
GLTFExporter
- feat(addons): add support for
GLTF_SEPARATE
format inGLTFExporter
- feat(addons): add instancing and light extensions to
GLTFExporter
- feat(addons): add
draco
option toGLTFExporter
- feat(addons): add
DRACOExporter
- feat(addons): introduce
LightShadowAdapter
- feat(addons): add
InstancedMaterial.js
- feat(addons): introduce
AttenuationMaterial
- feat(addons): introduce
LatheBuilder
- fix(addons): correct dispose methods for
HeatmapGenerator
andIDWMapGenerator
- fix(addons): correct shadow box calculation in
LightShadowAdapter
when camera is inside Box - fix(addons): correct axis plane position calculation bug in
TransformControls
when the camera is in extreme positions - refactor(addons): change
LightShadowAdapter.bindBox
fromBox3
toOBB
- refactor(addons): drop fallback to
Date.now()
inTimer
andClock
- feat(examples): add
material_shader_volume_layered
example - feat(examples): add
TorusBuilder
ingeometry_geometries
- refactor(examples): cleanup
Full Changelog: v0.3.0...v0.3.1
v0.3.0
迁移指南
把t3d从v0.2.x升级到v0.3.x,主要注意以下接口变更,否则可能会导致升级后项目运行失败:
着色器规则变更
- 新增
alphaTest_pars_frag
,如果您使用了alphaTest_frag
注意要和新片段配合使用。并且ALPHATEST
的宏不再携带alphaTest
的值,alphaTest
的值使用u_AlphaTest
以uniform
的形式传入 - 新增
diffuseMap_pars_vert
与diffuseMap_vert
着色器片段,如果您的自定义着色器中使用了diffuseMap_pars_frag
或diffuseMap_frag
,请注意必须要和新片段搭配使用。 - 宏定义
USE_DIFFUSE_MAP
、USE_ALPHA_MAP
、USE_EMISSIVEMAP
、USE_AOMAP
中不再包含UV通道信息,您可以在DIFFUSEMAP_UV
、ALPHAMAP_UV
、EMISSIVEMAP_UV
、AOMAP_UV
中获取该信息。在新版本中,这四种贴图可以默认支持设置任意0-8的UV通道。
接口兼容移除
- 移除针对带
WebGL
前缀的枚举兼容代码,包括:WEBGL_PIXEL_FORMAT
,WEBGL_PIXEL_TYPE
,WEBGL_TEXTURE_FILTER
,WEBGL_TEXTURE_WRAP
,WEBGL_COMPARE_FUNC
,WEBGL_OP
- 移除针对
WebGLRenderer
上旧属性的兼容代码,包括:renderTarget
,state
,vertexArrayBindings
- 移除针对
WebGLRenderPass
类的兼容代码 - 移除针对
WebGLProperties
类的兼容代码 - 移除针对
MatcapMaterial
类的兼容代码,新代码已转移到addons
- 移除
GLTFUtils.sanitizeNodeName
接口新增告警
CubeGeometry
类新增废弃告警Group
类新增废弃告警WebGLRenderer.gl
接口新增废弃告警WebGLRenderer.render()
接口新增废弃告警Renderer.renderPass
接口新增废弃告警PMREM
新增废弃告警,请使用PMREMGenerator
代替GeometryUtils.mergeBufferAttributes()
接口新增废弃告警,请使用GeometryUtils.mergeAttributes()
代替
变更日志
特性:添加 PIXEL_FORMAT.R11F_G11F_B10F
特性:为 fromArray
和 toArray
方法添加 denormalize
和 normalize
参数
特性:引入 MathUtils
修复:将 afterRender
回调上下文设置为 renderer
重构:移除已弃用的代码
重构:增加对更多 UV
通道的支持
重构:将材质 alphaTest
从 define
移动到 uniform
特性(插件):添加 CircleGeometry
特性(插件):引入 Timer
特性(插件):引入 GradientSky
特性(插件):引入 PlanarReflectionProbe
特性(插件):为 GLTFLoader
添加 EXT_mesh_gpu_instancing
扩展
特性(插件):引入 PolyhedronBuilder
修复(插件):限制 TransformControls
中的指针事件仅响应左键
重构(插件):优化 GLTFLoader
扩展处理
特性(示例):添加 webgl_query_occlusion_tester
示例
Migration Guide
When upgrading t3d from v0.2.x to v0.3.x, pay attention to the following interface changes to avoid potential project failures after the upgrade:
Shader Rule Changes
- Added
alphaTest_pars_frag
. If you usealphaTest_frag
, make sure to use it with the new fragment. Additionally, theALPHATEST
macro no longer carries thealphaTest
value. ThealphaTest
value is now passed as a uniform namedu_AlphaTest
. - New shader chunks
diffuseMap_pars_vert
anddiffuseMap_vert
have been added. If your custom shaders usediffuseMap_pars_frag
ordiffuseMap_frag
, ensure they are used in conjunction with the new chunks. - The macros
USE_DIFFUSE_MAP
,USE_ALPHA_MAP
,USE_EMISSIVEMAP
, andUSE_AOMAP
no longer include UV channel information. You can obtain this information fromDIFFUSEMAP_UV
,ALPHAMAP_UV
,EMISSIVEMAP_UV
, andAOMAP_UV
. In the new version, these four types of maps can support any UV channel from 0 to 8 by default.
Interface Compatibility Removal
- Removed compatibility code for enums with the WebGL prefix, including:
WEBGL_PIXEL_FORMAT
,WEBGL_PIXEL_TYPE
,WEBGL_TEXTURE_FILTER
,WEBGL_TEXTURE_WRAP
,WEBGL_COMPARE_FUNC
,WEBGL_OP
. - Removed compatibility code for old properties on
WebGLRenderer
, including:renderTarget
,state
,vertexArrayBindings
. - Removed compatibility code for the
WebGLRenderPass
class. - Removed compatibility code for the
WebGLProperties
class. - Removed compatibility code for the
MatcapMaterial
class. The new code has been moved toaddons
. - Removed
GLTFUtils.sanitizeNodeName
.
New Deprecation Warnings
- Added deprecation warning for the
CubeGeometry
class. - Added deprecation warning for the
Group
class. - Added deprecation warning for the
WebGLRenderer.gl
interface. - Added deprecation warning for the
WebGLRenderer.render()
interface. - Added deprecation warning for the
Renderer.renderPass
interface. - Added deprecation warning for
PMREM. Please use PMREMGenerator
instead. - Added deprecation warning for
GeometryUtils.mergeBufferAttributes()
. Please useGeometryUtils.mergeAttributes()
instead.
Changelog
- feat: add
PIXEL_FORMAT.R11F_G11F_B10F
- feat: add
denormalize
andnormalize
parameters tofromArray
andtoArray
methods - feat: introduce
MathUtils
- fix: set
afterRender
callback context to renderer - refactor: remove deprecated code
- refactor: add support for more uv coords
- refactor: move material alpha test from define to uniform
- feat(addons): add
CircleGeometry
- feat(addons): introduce
Timer
- feat(addons): introduce
GradientSky
- feat(addons): introduce
PlanarReflectionProbe
- feat(addons): add
EXT_mesh_gpu_instancing
extension forGLTFLoader
- feat(addons): introduce
PolyhedronBuilder
- fix(addons): restrict pointer event to left button in
TransformControls
- refactor(addons): optimize GLTFLoader extensions handling
- feat(examples): add
webgl_query_occlusion_tester
example
Full Changelog: v0.2.8...v0.3.0
v0.2.8
变更日志
- 特性:在
Scene
中新增envDiffuseIntensity
和envSpecularIntensity
属性并标记environmentLightIntensity
为弃用 - 特性:为
Plane
添加静态方法intersectPlanes
- 修复:修正
TextureCube
的mipmap上传 - 重构:优化envMap参数的uniform上传
- 特性(addons):在将对象添加到
VirtualGroup
时检查子父关系 - 特性(addons):引入
EnvLoader
和EnvTextureCubeLoader
- 特性(addons):添加一些额外的纹理加载器
- 修复(addons):修正
InfiniteGridShader
中的变换计算 - 修复(addons):修正正交相机下的分簇照明渲染
- 修复(addons):修正
GLTFLoader
中的重复纹理的问题 - 修复(addons):解决
ViewControls
中的初始渲染问题 - 修复(addons):修正
KTX2Loader
中的ZSTD
解码 - 修复(addons):在
TransformControls
中将acos
参数限制在[-1, 1]以防止NaN - 性能(addons):
GLTFLoader
在Safari >= 17
时使用ImageBitmapLoader
加载图片 - 重构(addons):增强
TransformControls
中的平移交互体验 - 特性(示例):添加
material_alphahash
示例 - 特性(示例):添加
custompass_xray
示例 - 重构(示例):在
animation_skinned_instancing
的GUI中添加Instance Count
滑块 - 重构(示例):重新组织和分类与纹理相关的示例
Changelog
- feat: add
envDiffuseIntensity
andenvSpecularIntensity
attributes inScene
while deprecatingenvironmentLightIntensity
- feat: add static method
intersectPlanes
toPlane
class - fix: correct mipmap uploading for
TextureCube
- refactor: optimize uniform uploading for envMap parameters
- feat(addons): check child-parent relationship when adding object to 'VirtualGroup'
- feat(addons): introduce
EnvLoader
andEnvTextureCubeLoader
- feat(addons): add additional texture loaders
- fix(addons): correct transform in
InfiniteGridShader
- fix(addons): correct clustered lighting for orthographic cameras
- fix(addons): prevent duplicate textures in
GLTFLoader
- fix(addons): resolve initial rendering issue in
ViewControls
- fix(addons): correct ZSTD decoding in
KTX2Loader
- fix(addons): clamp acos parameter to [-1, 1] to prevent NaN in
TransformControls
- perf(addons): use
ImageBitmapLoader
inGLTFLoader
for Safari >= 17 - refactor(addons): enhance interactive experience for translating in
TransformControls
- feat(examples): add
material_alphahash
example - feat(examples): add
custompass_xray
example - refactor(examples): add
Instance Count
slider toanimation_skinned_instancing
GUI - refactor(examples): reorganize and classify texture-related examples
Full Changelog: v0.2.7...v0.2.8
v0.2.7
变更日志
- 特性:新增
Texture2DArray
- 特性:新增
RenderTarget2DArray
- 特性:新增一些数学方法
- 修复:修改viewport取整方法为
round
- 性能:提升
Matrix4.determinant()
性能 - 重构:优化
WebGLTextures
的内部实现 - 特性(addons):新增
CameraHelper
- 特性(addons):新增
SphereHelper
- 特性(addons):
ClusteredLightingManager
支持聚光灯 - 特性(addons):
ExtrudeShapeBuilder
新增generateTop
和generateBottom
选项 - 特性(addons):
TubeBuilder
新增generateStartCap
和generateEndCap
选项 - 修复(addons):修复
GLTFLoader
点渲染模式的赋值bug - 修复(addons):修复
GeometryUtils.applyMatrix4
中interleaved数据引发的bug - 修复(addons):
GLTFLoader
处理accessor的offset比stride大的情况 - 特性(示例):新增
material_shader_background
示例 - 重构(示例):优化
camera_projection
示例中相机切换的动画曲线
Changelog
- feat: introduce
Texture2DArray
- feat: introduce
RenderTarget2DArray
- feat: add some mathematical methods
- fix: change viewport to use
round
instead offloor
- perf: make
Matrix4.determinant()
more efficient - refactor: optimize the internal implementation of
WebGLTextures
- feat(addons): introduce
CameraHelper
- feat(addons): introduce
SphereHelper
- feat(addons): add support for spot lights in
ClusteredLightingManager
- feat(addons): add
generateTop
andgenerateBottom
options forExtrudeShapeBuilder
- feat(addons): add
generateStartCap
andgenerateEndCap
options forTubeBuilder
- fix(addons): rectify points draw mode assignment in
GLTFLoader
- fix(addons): correct the offset of interleaved buffer in
GeometryUtils.applyMatrix4
- fix(addons): handle accessor offset larger than stride in
GLTFLoader
- feat(examples): add
material_shader_background
example - refactor(examples): enhance projection transition linearity in
camera_projection
Full Changelog: v0.2.6...v0.2.7
v0.2.6
变更日志
- 特性:
Matrix4
新增lerpMatrices
方法 - 特性:支持顶点着色器中的自定义扩展语句
- 特性:新增
RenderTarget3D
- 修复:修复聚光灯阴影bug
- 性能:
ShaderPostPass
使用全屏三角面代替矩形面 - 重构:为
AnimationClip
构造函数中的name
参数添加默认值 - 性能(addons):优化
GLTFLoader
中的正则性能 - 重构(addons):优化
DynamicFont
- 重构(addons):新增
PMREMGenerator
并且废弃PMREM
- 重构(addons):移除
raycaster.setFromCamera
方法中的相机类型参数 - 特性(示例):新增
webgl_clipculldistance
示例 - 特性(示例):新增clustered lighting示例
- 重构(示例):替换
material_texture_bumpmap
中的AssimpJson模型为glTF - 重构(示例):替换
camera_cameras
示例为camera_projection
- 重构(示例):移动延迟渲染示例到
renderer
分类
Changelog
- feat: add
lerpMatrices
method toMatrix4
- feat: add support for custom extensions in vertex shader
- feat: add
RenderTarget3D
- fix: spot light shadow bug
- perf: replace fullscreen quad with fullscreen triangle in
ShaderPostPass
- refactor: add remaining default constructor parameters to
AnimationClip
- perf(addons): optimize regular expression matching rules in GLTFLoader
- refactor(addons): optimize
DynamicFont
- refactor(addons): add
PMREMGenerator
and deprecatePMREM
- refactor(addons): remove camera type parameter from
raycaster.setFromCamera
method - feat(examples): add
webgl_clipculldistance
example - feat(examples): add clustered lighting example
- refactor(examples): replace AssimpJson with glTF model in
material_texture_bumpmap
- refactor(examples): replace
camera_cameras
withcamera_projection
example - refactor(examples): move deferred rendering examples to
renderer
category
Full Changelog: v0.2.5...v0.2.6
v0.2.5
变更日志
- 特性:新增
RectAreaLight
- 特性:shader报错信息添加shader名称
- 特性:Vector2新增
negate
和dot
方法 - 修复:修复
RectAreaLight
的更新bug - 修复:修复skeleton的更新bug
- 特性(addons):为
EdgesBuilder.getGeometryData
新增stride
和offset
参数 - 特性(addons):为SkyBox增加雾效过渡功能
- 特性(addons):为SDFTextShader新增阴影和描边功能
- 修复(addons):修复
VirtualGroup
计算pivot的bug - 特性(示例):新增
text_bitmap_dynamic
示例 - 特性(示例):新增
material_texture_lightmap
示例 - 特性(示例):新增
text_sdf_dynamic
示例 - 重构(示例):美化
material_shader_water_pbr
示例
Changelog
- feat: add RectAreaLight
- feat: add name to the shader error log
- feat: add
negate
anddot
methods to Vector2 - fix: rectify bug in
RectAreaLight
- fix: skeleton update bug
- feat(addons): add
stride
andoffset
parameters toEdgesBuilder.getGeometryData
- feat(addons): add fog support to SkyBox
- feat(addons): add support for shadow and outline to SDFTextShader
- fix(addons): VirtualGroup get pivot bug
- feat(examples): add
text_bitmap_dynamic
example - feat(examples): add
material_texture_lightmap
example - feat(examples): add
text_sdf_dynamic
example - refactor(examples): beautify
material_shader_water_pbr
example
Full Changelog: v0.2.4...v0.2.5
v0.2.4
变更日志
- 特性:支持整型数据类型的attribute
- 特性:支持整型数据类型的Texture在shader中的采样
- 重构:为renderer.readRenderTargetPixels添加统一的promise返回
- 特性(addons):新增ViewControls
- 特性(addons):ExtrudeShapeBuilder 支持沿曲线挤出
- 修复(addons):修复InfiniteGridShader
- 修复(addons):修复TransformControls的颜色空间
- 特性(示例):新增曲线运动示例
- 特性(示例):新增3D直方图示例
- 重构(示例):在ik示例中使用TransformControls
- 构建:新增 .vscode/extensions
Changelog
- feat: support integer attributes
- feat: support sampling of integer textures in shader
- refactor: add promise return for renderer.readRenderTargetPixels
- feat(addons): add ViewControls
- feat(addons): supports extrusion along path for ExtrudeShapeBuilder (#22)
- fix(addons): InfiniteGridShader
- fix(addons): fix gizmo colors for TransformControls
- feat(examples): add curve motion example
- feat(examples): add histogram example
- refactor(examples): use TransformControls in ik example
- build: add .vscode/extensions
Full Changelog: v0.2.3...v0.2.4
v0.2.3
Changelog
- feat: support webgl multi draw
- feat: add MIN and MAX for BLEND_EQUATION
- feat: add keyframe interpolants
- refactor: add warning to WebGLRenderer if beginRender is not called before renderRenderableItem
- feat(examples): add planar shadow example
- feat(examples): add webgl_mesh_batch example
- feat(examples): add geometry images example
- feat(examples): add ground projected skybox example
- feat(examples): add bitmap text example
- feat(examples): add oit example
- refactor(examples): moved camera controls examples to controls category
- refactor(examples): update transform controls example
- feat(addons): add ColorGradient
- feat(addons): add TransformControls
- feat(addons): add SceneUtils
- feat(addons): add snapping for transform controls
- feat(addons): add InstancedBasicMaterial
- fix(addons): fix bug in octree.addElement
- fix(addons): fix picking for TransformControls
- refactor(addons): avoid duplicate assignments in Pathfinding
- refactor(addons): make octree more versatile
- refactor(addons): optimize SkeletonHelper
- fix(docs): add return type
v0.2.0
[Breaking Changes]
- WebGLRenderPass -> WebGLRenderer.
- WebGLRenderer: add beginRender() and endRender() methods. If you are using renderScene() method, they are already called internally.
- WebGLRenderer: rename renderer.gl to renderer.context.
- Refactor WebGLProperties to PropertyMap. The key value of webgl resource obtained from the object is changed to
_gl{id}$
.
[Other Changes]
- Material: add forceUpdateUniforms property.
- FileLoader: optimize progress event.
- WebGLRenderPass: export the init method to handle contextlost.
- WebGLRenderPass: add shaderCompileOptions.
- Examples: Add unrealbloom example.
- Remove long-deprecated code.
- GLTFLoader: Remove the unique processing of node names.