Claygl Versions Save

A WebGL graphic library for building scalable Web3D applications

1.3.0

5 years ago

Features

  • Add clay.InstancedMesh. Usage:
var instancedMesh = new clay.InstancedMesh({
  geometry: geometry, material: material
});
for (var i = 0; i < 100; i++) {
    var instanceNode = new clay.Node();
    instanceNode.position.set(i - 50, 0, 0);
    instanceNode.update();
    instancedMesh.instances.push({ node: instanceNode });
}
scene.add(instancedMesh);

Enhancements

  • Support base64 decode of buffer in glTF loader.

  • Add transform decompose when creating OrbitControl

  • Better compatibility on weapp platform

Bugfixes

  • Fix skybox with orthographic camera

  • Fix uv repeat and uv offset in preZ pass and shadow pass.

fbx2gltf

  • Add vertex color support by @xAlien95

1.2.2

5 years ago
  • Better support for other platforms like wechat.

  • Fix damping in OrbitControl not work.

1.2.1

5 years ago

Features

  • Add normalScale in clay.standard shader. by @SamuelTS

  • Implement plugin.GamepadControl. by @SamuelTS

  • App3D#createMaterial add textureLoaded and texturesReady callback in parameter object.

Enhancements

1.2.0

6 years ago

Enhancements

Bug fixes

  • Fix finger rotate bug on mobile.

1.1.4

6 years ago

This version is about to fix the build in 1.1.3

1.1.3

6 years ago

Enhancements

  • Reduced the minimum bundled size from 38k to 28k. Here is a minimum example code:
import { Renderer, Geometry, Shader, Material } from 'claygl';
const renderer = new Renderer({
    canvas: document.getElementById('main')
});
const geometry = new Geometry();
// Add triangle vertices to position attribute.
geometry.attributes.position.fromArray([
    [-0.5, -0.5, 0],
    [0.5, -0.5, 0],
    [0, 0.5, 0]
]);
const material = new Material({
    shader: new Shader(vsCode, fsCode)
});
renderer.renderPass([{ geometry, material }]);
  • Skybox support 2D panorama environment map. Skydome is DEPCRATED.

  • Add occlusionMap in clay.standard shader. Also support occlusionTexture in glTF Loader.

  • Use vertex texture to store skin matrices to support devices with limited uniforms number.

  • Compatible with browsers don't support EXT_shader_texture_lod extension.

Bug Fixes

  • Fix tree shaking in webpack 4.0 may cause builtin shader lost.

  • Fix velocity buffer may be wrong.

1.1.2

6 years ago

New Features

  • [GBuffer] Add velocity buffer for usage of motion blur and temporal reprojection. Use GBuffer#enableTargetTexture4 to enable rendering of velocity buffer, use GBuffer#getTargetTexture4 to get the buffer. In the shader code velocity can be extracted like following:
vec4 texel = texture2D(velocityTex, v_Texcoord); 
// If texel has valid velocity info
if (texel.a > 0.0) {
  vec2 vel = texel.rg * 2.0 - 1.0;
}

1.1.1

6 years ago

Enhancements

Bug Fixes

  • Fix image based lighting wrong when roughness is near to 1.

  • Fix lighting bug in deferred rendering.

  • Fix GBuffer#dispose does not work bug.

  • Use blank texture when texture value is not renderable or is null. Remove the warnings.

1.1.0

6 years ago

Breaking Changes

  • All the modules under math have been moved to root for more short reference. For example, clay.math.Vector3 now is clay.Vector3. For now clay.math.Vector can still work but not suggested.

  • Move clay.animation.Timeline to clay.Timeline. For now clay.animation.Timeline can still work but not suggested.

  • Move clay.compositor.createCompositor to clay.createCompositor. For now clay.compositor.createCompositor can still work but not suggested.

  • clay.util.mesh.splitJoints will use the material of input mesh. Not clone a new one for each new-created mesh.

  • Remove Renderable#lineWidth

New Features

Bug Fixes

  • Fix disposeTexture parameter not work in Scene#disposeNode

  • [OrbitControl] Fix dragging will not be stopped when the mouse is out of the viewport.

  • [OrbitControl] Disable the right mouse button.

Enhancements

  • Improve shader parser, support uniform initialization value and multiple declaration in one line. Now code like following can be parsed and extrated uniforms correctly
uniform vec3 color = vec3(0.0, 0.0, 0.0), opacity = 1.0;
  • Performance improvements for the large scenes. Can be up to 50% in the scene of 10k objects.

  • [OrbitControl] Optimize the dragging when mouse events are triggered more frequently than animation frame.

  • [PBR] 4x faster cubemap prefiltering

1.0.4

6 years ago

Enhancements

  • App3D#createCamera add extent parameter when camera type is orthographic

  • Add App3D#cloneNode for cloning skinned models with proper skeleton handling. See example Dancing Group

  • Use indices type instead of vertex count to determine if use OES_element_index_uint extension

Bugfixes

  • Fix scene light numbers can't change bug

  • Fix directional light with shadowCascade will throw error.