A WebGL graphic library for building scalable Web3D applications
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);
Support base64 decode of buffer in glTF loader.
Add transform decompose when creating OrbitControl
Better compatibility on weapp platform
Fix skybox with orthographic camera
Fix uv repeat and uv offset in preZ pass and shadow pass.
Better support for other platforms like wechat.
Fix damping in OrbitControl not work.
Add normalScale
in clay.standard
shader. by @SamuelTS
Implement plugin.GamepadControl
. by @SamuelTS
App3D#createMaterial
add textureLoaded
and texturesReady
callback in parameter object.
More robust #define
parsing in shader.
[fbx2gltf] works in python2.7 by @fmmoret . See https://github.com/pissang/claygl/pull/80
Improve velocity buffer of skinned mesh.
Separate submodules in g-lmatrix. Abstraction of GeometryBase. Reduced core bundled size to 22k(gzipped). See https://github.com/pissang/claygl#minimum-bundle-example
Adjust panorama texture orient.
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.
Fix tree shaking in webpack 4.0 may cause builtin shader lost.
Fix velocity buffer may be wrong.
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;
}
Support alphaCutoff in prez pass and shadow map pass.
App3D#loadModel and App3D#createMaterial add textureConvertToPOT
property in the config.
application.create add autoRender
config.
application.create add methods
config. And these methods can be called outside using app.methods.xxxx
.
Add App3D#render method.
Add App3D#height and App3D#width
Vector3 builtin values like Vector3.ZERO
will always create a new value.
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.
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
Add typescript declarations. See https://github.com/pissang/claygl/tree/master/typescript
[Texture2D] Add convertToPOT property.
Add sideEffects
in package.json to support tree shaking in webpack4.0
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.
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
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
Fix scene light numbers can't change bug
Fix directional light with shadowCascade will throw error.