Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsm/capabilities/WebGPU.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let isAvailable = ( typeof navigator !== 'undefined' && navigator.gpu !== undefi

if ( typeof window !== 'undefined' && isAvailable ) {

isAvailable = await navigator.gpu.requestAdapter();
isAvailable = Boolean( await navigator.gpu.requestAdapter() );

}

Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/physics/RapierPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,17 @@ async function RapierPhysics() {
function addHeightfield( mesh, width, depth, heights, scale ) {

const shape = RAPIER.ColliderDesc.heightfield( width, depth, heights, scale );

const bodyDesc = RAPIER.RigidBodyDesc.fixed();
bodyDesc.setTranslation( mesh.position.x, mesh.position.y, mesh.position.z );
bodyDesc.setRotation( mesh.quaternion );

const body = world.createRigidBody( bodyDesc );
world.createCollider( shape, body );

if ( ! mesh.userData.physics ) mesh.userData.physics = {};
mesh.userData.physics.body = body;

return body;

}
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/tsl/display/TRAANode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let _rendererState;
* - {@link https://alextardif.com/TAA.html}
* - {@link https://www.elopezr.com/temporal-aa-and-the-quest-for-the-holy-trail/}
*
* @augments PassNode
* @augments TempNode
* @three_import import { traa } from 'three/addons/tsl/display/TRAANode.js';
*/
class TRAANode extends TempNode {
Expand Down Expand Up @@ -456,6 +456,6 @@ const _JitterVectors = [
* @param {TextureNode} depthNode - A node that represents the scene's depth.
* @param {TextureNode} velocityNode - A node that represents the scene's velocity.
* @param {Camera} camera - The camera the scene is rendered with.
* @returns {TRAAPassNode}
* @returns {TRAANode}
*/
export const traa = ( beautyNode, depthNode, velocityNode, camera ) => nodeObject( new TRAANode( convertToTexture( beautyNode ), depthNode, velocityNode, camera ) );
2 changes: 1 addition & 1 deletion examples/webgl_renderer_pathtracer.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@

function updateProgressBar( fraction ) {

progressBarDiv.innerText = 'Loading... ' + Math.round( fraction * 100, 2 ) + '%';
progressBarDiv.innerText = 'Loading... ' + Math.round( fraction * 100 ) + '%';

}

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_xr_native_layers.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@
gui.add( parameters, 'thickness', 0, 1 ).onChange( onThicknessChange );
gui.domElement.style.visibility = 'hidden';

guiGroup = new InteractiveGroup( renderer, guiCamera );
guiGroup = new InteractiveGroup();
guiScene.add( guiGroup );

const mesh = new HTMLMesh( gui.domElement );
Expand Down
3 changes: 2 additions & 1 deletion src/loaders/FileLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class FileLoader extends Loader {
super( manager );

/**
* The expected mime type.
* The expected mime type. Valid values can be found
* [here]{@link hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype}
*
* @type {string}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/display/ViewportTextureNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ViewportTextureNode extends TextureNode {
/**
* The framebuffer texture for the current renderer context.
*
* @type {WeakMap}
* @type {WeakMap<RenderTarget, FramebufferTexture>}
* @private
*/
this._textures = new WeakMap();
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/functions/PhysicalLightingModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class PhysicalLightingModel extends LightingModel {
* @param {Object} lightData - The light data.
* @param {NodeBuilder} builder - The current node builder.
*/
direct( { lightDirection, lightColor, reflectedLight } ) {
direct( { lightDirection, lightColor, reflectedLight }, /* builder */ ) {

const dotNL = normalView.dot( lightDirection ).clamp();
const irradiance = dotNL.mul( lightColor );
Expand Down Expand Up @@ -608,7 +608,7 @@ class PhysicalLightingModel extends LightingModel {
* @param {Object} input - The input data.
* @param {NodeBuilder} builder - The current node builder.
*/
directRectArea( { lightColor, lightPosition, halfWidth, halfHeight, reflectedLight, ltc_1, ltc_2 } ) {
directRectArea( { lightColor, lightPosition, halfWidth, halfHeight, reflectedLight, ltc_1, ltc_2 }, /* builder */ ) {

const p0 = lightPosition.add( halfWidth ).sub( halfHeight ); // counterclockwise; light shines in local neg z direction
const p1 = lightPosition.sub( halfWidth ).sub( halfHeight );
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/common/Color4.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class Color4 extends Color {
* string argument to this method.
*
* @param {number|string|Color} r - The red value.
* @param {number} g - The green value.
* @param {number} b - The blue value.
* @param {number} [g] - The green value.
* @param {number} [b] - The blue value.
* @param {number} [a=1] - The alpha value.
* @return {Color4} A reference to this object.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,7 @@ class Renderer {
* @param {LightsNode} lightsNode - The current lights node.
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
* @param {ClippingContext} clippingContext - The clipping context.
* @param {?string} [passId=null] - An optional ID for identifying the pass.
* @param {string} [passId] - An optional ID for identifying the pass.
*/
_renderObjectDirect( object, material, scene, camera, lightsNode, group, clippingContext, passId ) {

Expand Down Expand Up @@ -3018,7 +3018,7 @@ class Renderer {
* @param {LightsNode} lightsNode - The current lights node.
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
* @param {ClippingContext} clippingContext - The clipping context.
* @param {?string} [passId=null] - An optional ID for identifying the pass.
* @param {string} [passId] - An optional ID for identifying the pass.
*/
_createObjectPipeline( object, material, scene, camera, lightsNode, group, clippingContext, passId ) {

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgl-fallback/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class WebGLBackend extends Backend {
* A unique collection of bindings.
*
* @private
* @type {WeakSet}
* @type {WeakSet<Array<BindGroup>>}
*/
this._knownBindings = new WeakSet();

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgpu/utils/WebGPUPipelineUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class WebGPUPipelineUtils {
*
* @private
* @param {Material} material - The material.
* @return {string} The GPU color write mask.
* @return {number} The GPU color write mask.
*/
_getColorWriteMask( material ) {

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webxr/WebXRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ class WebXRManager extends EventDispatcher {
/**
* Returns the amount of foveation used by the XR compositor for the projection layer.
*
* @return {number} The amount of foveation.
* @return {number|undefined} The amount of foveation.
*/
this.getFoveation = function () {

Expand Down
4 changes: 2 additions & 2 deletions src/textures/FramebufferTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class FramebufferTexture extends Texture {
/**
* Constructs a new framebuffer texture.
*
* @param {number} width - The width of the texture.
* @param {number} height - The height of the texture.
* @param {number} [width] - The width of the texture.
* @param {number} [height] - The height of the texture.
*/
constructor( width, height ) {

Expand Down