docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
<mask> this._onAfterRenderCallbacks = []; <mask> <mask> this.detachControl(); <mask> <mask> // Release sounds & sounds tracks <mask> this.mainSoundTrack.dispose(); <mask> <mask> for (var scIndex = 0; scIndex < this.soundTracks.length; scIndex++) { <mask> this.soundTracks[scIndex].dispose(); <mask> } <mask> <mask> // Detach cameras <mask> var canvas = this._engine.getRenderingCanvas(); <mask> var index; <mask> for (index = 0; index < this.cameras.length; index++) { <mask> this.cameras[index].detachControl(canvas); </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getSoundByName = function (name) { for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) { if (this.mainSoundTrack.soundCollection[index].name === name) { return this.mainSoundTrack.soundCollection[index]; } } for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) { for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) { if (this.soundTracks[sdIndex].soundCollection[index].name === name) { return this.soundTracks[sdIndex].soundCollection[index]; } } } return null; }; </s> add </s> remove // Sounds if (parsedData.sounds && scene.getEngine().getAudioEngine().canUseWebAudio) { for (index = 0; index < parsedData.sounds.length; index++) { var parsedSound = parsedData.sounds[index]; parseSound(parsedSound, scene, rootUrl); } } </s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) { </s> add for (var i = 0; i < this.soundTracks.length; i++) { </s> remove sound = this.soundTracks[i].soundCollection[j]; </s> add var sound = this.soundTracks[i].soundCollection[j]; </s> remove if (mesh.parent === this) { </s> add if (mesh.parent == this) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
Scene.prototype._getByTags = function (list, tagsQuery) {
<mask> } <mask> }; <mask> <mask> // Tags <mask> Scene.prototype._getByTags = function (list, tagsQuery, forEach) { <mask> if (tagsQuery === undefined) { <mask> // returns the complete list (could be done with BABYLON.Tags.MatchesQuery but no need to have a for-loop here) <mask> return list; <mask> } <mask> </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove BABYLON.Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); </s> add Tools.Error("Parameter must be a URL to the sound or an ArrayBuffer of the sound."); </s> remove Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { return this._getByTags(this.lights, tagsQuery, forEach); </s> add Scene.prototype.getLightsByTags = function (tagsQuery) { return this._getByTags(this.lights, tagsQuery); </s> remove Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { return this._getByTags(this.cameras, tagsQuery, forEach); </s> add Scene.prototype.getCamerasByTags = function (tagsQuery) { return this._getByTags(this.cameras, tagsQuery); </s> remove Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { return this._getByTags(this.meshes, tagsQuery, forEach); </s> add Scene.prototype.getMeshesByTags = function (tagsQuery) { return this._getByTags(this.meshes, tagsQuery); </s> remove Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); </s> add Scene.prototype.getMaterialByTags = function (tagsQuery) { return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery));
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
<mask> } <mask> <mask> var listByTags = []; <mask> <mask> forEach = forEach || (function (item) { <mask> return; <mask> }); <mask> <mask> for (var i in list) { <mask> var item = list[i]; <mask> if (BABYLON.Tags.MatchesQuery(item, tagsQuery)) { <mask> listByTags.push(item); <mask> forEach(item); </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove forEach(item); </s> add </s> remove var parseSound = function (parsedSound, scene, rootUrl) { var soundName = parsedSound.name; var soundUrl = rootUrl + soundName; var options = { autoplay: parsedSound.autoplay, loop: parsedSound.loop, volume: parsedSound.volume, spatialSound: parsedSound.spatialSound, maxDistance: parsedSound.maxDistance, rolloffFactor: parsedSound.rolloffFactor, refDistance: parsedSound.refDistance, distanceModel: parsedSound.distanceModel, panningModel: parsedSound.panningModel }; var newSound = new BABYLON.Sound(soundName, soundUrl, scene, function () { scene._removePendingData(newSound); }, options); scene._addPendingData(newSound); if (parsedSound.position) { var soundPosition = BABYLON.Vector3.FromArray(parsedSound.position); newSound.setPosition(soundPosition); } if (parsedSound.isDirectional) { newSound.setDirectionalCone(parsedSound.coneInnerAngle || 360, parsedSound.coneOuterAngle || 360, parsedSound.coneOuterGain || 0); if (parsedSound.localDirectionToMesh) { var localDirectionToMesh = BABYLON.Vector3.FromArray(parsedSound.localDirectionToMesh); newSound.setLocalDirectionToMesh(localDirectionToMesh); } } if (parsedSound.connectedMeshId) { var connectedMesh = scene.getMeshByID(parsedSound.connectedMeshId); if (connectedMesh) { newSound.attachToMesh(connectedMesh); } } }; </s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) { </s> add for (var i = 0; i < this.soundTracks.length; i++) { </s> remove sound = this.soundTracks[i].soundCollection[j]; </s> add var sound = this.soundTracks[i].soundCollection[j]; </s> remove var currentRenderList = this.renderList ? this.renderList : scene.getActiveMeshes().data; for (var meshIndex = 0; meshIndex < currentRenderList.length; meshIndex++) { var mesh = currentRenderList[meshIndex]; </s> add for (var meshIndex = 0; meshIndex < this.renderList.length; meshIndex++) { var mesh = this.renderList[meshIndex];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
<mask> for (var i in list) { <mask> var item = list[i]; <mask> if (BABYLON.Tags.MatchesQuery(item, tagsQuery)) { <mask> listByTags.push(item); <mask> forEach(item); <mask> } <mask> } <mask> <mask> return listByTags; <mask> }; </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove forEach = forEach || (function (item) { return; }); </s> add </s> remove // Release audio engine this._audioEngine.dispose(); </s> add </s> remove for (i = 0; i < this.soundTracks.length; i++) { </s> add for (var i = 0; i < this.soundTracks.length; i++) { </s> remove sound = this.soundTracks[i].soundCollection[j]; </s> add var sound = this.soundTracks[i].soundCollection[j]; </s> remove Scene.prototype.getSoundByName = function (name) { for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) { if (this.mainSoundTrack.soundCollection[index].name === name) { return this.mainSoundTrack.soundCollection[index]; } } for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) { for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) { if (this.soundTracks[sdIndex].soundCollection[index].name === name) { return this.soundTracks[sdIndex].soundCollection[index]; } } } return null; }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
Scene.prototype.getMeshesByTags = function (tagsQuery) { return this._getByTags(this.meshes, tagsQuery);
<mask> <mask> return listByTags; <mask> }; <mask> <mask> Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.meshes, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.cameras, tagsQuery, forEach); <mask> }; </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { return this._getByTags(this.cameras, tagsQuery, forEach); </s> add Scene.prototype.getCamerasByTags = function (tagsQuery) { return this._getByTags(this.cameras, tagsQuery); </s> remove Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { return this._getByTags(this.lights, tagsQuery, forEach); </s> add Scene.prototype.getLightsByTags = function (tagsQuery) { return this._getByTags(this.lights, tagsQuery); </s> remove Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); </s> add Scene.prototype.getMaterialByTags = function (tagsQuery) { return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery)); </s> remove Scene.prototype._getByTags = function (list, tagsQuery, forEach) { </s> add Scene.prototype._getByTags = function (list, tagsQuery) { </s> remove forEach(item); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
Scene.prototype.getCamerasByTags = function (tagsQuery) { return this._getByTags(this.cameras, tagsQuery);
<mask> Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.meshes, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.cameras, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.lights, tagsQuery, forEach); <mask> }; </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { return this._getByTags(this.lights, tagsQuery, forEach); </s> add Scene.prototype.getLightsByTags = function (tagsQuery) { return this._getByTags(this.lights, tagsQuery); </s> remove Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { return this._getByTags(this.meshes, tagsQuery, forEach); </s> add Scene.prototype.getMeshesByTags = function (tagsQuery) { return this._getByTags(this.meshes, tagsQuery); </s> remove Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); </s> add Scene.prototype.getMaterialByTags = function (tagsQuery) { return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery)); </s> remove Scene.prototype._getByTags = function (list, tagsQuery, forEach) { </s> add Scene.prototype._getByTags = function (list, tagsQuery) { </s> remove Scene.prototype.enableDepthRenderer = function () { if (this._depthRenderer) { return this._depthRenderer; } this._depthRenderer = new BABYLON.DepthRenderer(this); return this._depthRenderer; }; Scene.prototype.disableDepthRenderer = function () { if (!this._depthRenderer) { return; } this._depthRenderer.dispose(); this._depthRenderer = null; }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
Scene.prototype.getLightsByTags = function (tagsQuery) { return this._getByTags(this.lights, tagsQuery);
<mask> Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.cameras, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.lights, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); <mask> }; </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { return this._getByTags(this.cameras, tagsQuery, forEach); </s> add Scene.prototype.getCamerasByTags = function (tagsQuery) { return this._getByTags(this.cameras, tagsQuery); </s> remove Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); </s> add Scene.prototype.getMaterialByTags = function (tagsQuery) { return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery)); </s> remove Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { return this._getByTags(this.meshes, tagsQuery, forEach); </s> add Scene.prototype.getMeshesByTags = function (tagsQuery) { return this._getByTags(this.meshes, tagsQuery); </s> remove Scene.prototype._getByTags = function (list, tagsQuery, forEach) { </s> add Scene.prototype._getByTags = function (list, tagsQuery) { </s> remove Scene.prototype.enableDepthRenderer = function () { if (this._depthRenderer) { return this._depthRenderer; } this._depthRenderer = new BABYLON.DepthRenderer(this); return this._depthRenderer; }; Scene.prototype.disableDepthRenderer = function () { if (!this._depthRenderer) { return; } this._depthRenderer.dispose(); this._depthRenderer = null; }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
Scene.prototype.getMaterialByTags = function (tagsQuery) { return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery));
<mask> Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.lights, tagsQuery, forEach); <mask> }; <mask> <mask> Scene.prototype.getMaterialByTags = function (tagsQuery, forEach) { <mask> return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach)); <mask> }; <mask> Scene.FOGMODE_NONE = 0; <mask> Scene.FOGMODE_EXP = 1; <mask> Scene.FOGMODE_EXP2 = 2; <mask> Scene.FOGMODE_LINEAR = 3; </s> Fixing issues with sprites and shadows Former-commit-id: ace53742a99ecf6a77cbfd5ac53c4095f49558fb </s> remove Scene.prototype.getLightsByTags = function (tagsQuery, forEach) { return this._getByTags(this.lights, tagsQuery, forEach); </s> add Scene.prototype.getLightsByTags = function (tagsQuery) { return this._getByTags(this.lights, tagsQuery); </s> remove Scene.prototype.getCamerasByTags = function (tagsQuery, forEach) { return this._getByTags(this.cameras, tagsQuery, forEach); </s> add Scene.prototype.getCamerasByTags = function (tagsQuery) { return this._getByTags(this.cameras, tagsQuery); </s> remove Scene.prototype.getMeshesByTags = function (tagsQuery, forEach) { return this._getByTags(this.meshes, tagsQuery, forEach); </s> add Scene.prototype.getMeshesByTags = function (tagsQuery) { return this._getByTags(this.meshes, tagsQuery); </s> remove Scene.prototype._getByTags = function (list, tagsQuery, forEach) { </s> add Scene.prototype._getByTags = function (list, tagsQuery) { </s> remove Scene.prototype.getSoundByName = function (name) { for (var index = 0; index < this.mainSoundTrack.soundCollection.length; index++) { if (this.mainSoundTrack.soundCollection[index].name === name) { return this.mainSoundTrack.soundCollection[index]; } } for (var sdIndex = 0; sdIndex < this.soundTracks.length; sdIndex++) { for (index = 0; index < this.soundTracks[sdIndex].soundCollection.length; index++) { if (this.soundTracks[sdIndex].soundCollection[index].name === name) { return this.soundTracks[sdIndex].soundCollection[index]; } } } return null; }; </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/faea9971e5132c3fa04bdd8dbc50ae8e6bb40c90
Babylon/babylon.scene.js
/** * Returns true if the mesh can be rendered, otherwise false. * @param mesh The mesh to render * @param material The material used on the mesh * @returns true if it can be rendered otherwise false */ protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean { return material.needAlphaBlendingForMesh(mesh); }
<mask> } <mask> <mask> /** <mask> * Returns true if the mesh should render, otherwise false. <mask> * @param mesh The mesh to render <mask> * @returns true if it should render otherwise false </s> Add GlowLayer alpha support Former-commit-id: c7933906980608adf6216a0772b5c2e77150cb61 </s> remove if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } </s> add const opacityTexture = (material as any).opacityTexture; if (opacityTexture) { this._effectLayerMapGenerationEffect.setTexture("opacitySampler", opacityTexture); this._effectLayerMapGenerationEffect.setFloat("opacityIntensity", opacityTexture.level); const textureMatrix = opacityTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix", textureMatrix); </s> remove // Alpha test if (material && material.needAlphaTesting()) { var alphaTexture = material.getAlphaTestTexture(); if (alphaTexture) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); let textureMatrix = alphaTexture.getTextureMatrix(); </s> add const needAlphaTest = material.needAlphaTesting(); const diffuseTexture = material.getAlphaTestTexture(); const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture); if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", diffuseTexture); const textureMatrix = diffuseTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } } </s> remove if (material.needAlphaBlendingForMesh(mesh)) { </s> add if (this._canRenderMesh(mesh, material)) {
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9773456a3243f08acc3d7d5503e6af95d1b255
src/Layers/effectLayer.ts
if (this._canRenderMesh(mesh, material)) {
<mask> return; <mask> } <mask> <mask> // Do not block in blend mode. <mask> if (material.needAlphaBlendingForMesh(mesh)) { <mask> return; <mask> } <mask> <mask> // Culling <mask> engine.setState(material.backFaceCulling); </s> Add GlowLayer alpha support Former-commit-id: c7933906980608adf6216a0772b5c2e77150cb61 </s> remove if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } </s> add const opacityTexture = (material as any).opacityTexture; if (opacityTexture) { this._effectLayerMapGenerationEffect.setTexture("opacitySampler", opacityTexture); this._effectLayerMapGenerationEffect.setFloat("opacityIntensity", opacityTexture.level); const textureMatrix = opacityTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix", textureMatrix); </s> remove // Alpha test if (material && material.needAlphaTesting()) { var alphaTexture = material.getAlphaTestTexture(); if (alphaTexture) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); let textureMatrix = alphaTexture.getTextureMatrix(); </s> add const needAlphaTest = material.needAlphaTesting(); const diffuseTexture = material.getAlphaTestTexture(); const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture); if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", diffuseTexture); const textureMatrix = diffuseTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9773456a3243f08acc3d7d5503e6af95d1b255
src/Layers/effectLayer.ts
const needAlphaTest = material.needAlphaTesting(); const diffuseTexture = material.getAlphaTestTexture(); const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture); if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", diffuseTexture); const textureMatrix = diffuseTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } }
<mask> this._emissiveTextureAndColor.color.g, <mask> this._emissiveTextureAndColor.color.b, <mask> this._emissiveTextureAndColor.color.a); <mask> <mask> // Alpha test <mask> if (material && material.needAlphaTesting()) { <mask> var alphaTexture = material.getAlphaTestTexture(); <mask> if (alphaTexture) { <mask> this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); <mask> let textureMatrix = alphaTexture.getTextureMatrix(); <mask> <mask> if (textureMatrix) { <mask> this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); <mask> } <mask> } </s> Add GlowLayer alpha support Former-commit-id: c7933906980608adf6216a0772b5c2e77150cb61 </s> remove if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } </s> add const opacityTexture = (material as any).opacityTexture; if (opacityTexture) { this._effectLayerMapGenerationEffect.setTexture("opacitySampler", opacityTexture); this._effectLayerMapGenerationEffect.setFloat("opacityIntensity", opacityTexture.level); const textureMatrix = opacityTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix", textureMatrix); </s> remove if (material.needAlphaBlendingForMesh(mesh)) { </s> add if (this._canRenderMesh(mesh, material)) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9773456a3243f08acc3d7d5503e6af95d1b255
src/Layers/effectLayer.ts
const opacityTexture = (material as any).opacityTexture; if (opacityTexture) { this._effectLayerMapGenerationEffect.setTexture("opacitySampler", opacityTexture); this._effectLayerMapGenerationEffect.setFloat("opacityIntensity", opacityTexture.level); const textureMatrix = opacityTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix", textureMatrix);
<mask> if (alphaTexture) { <mask> this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); <mask> let textureMatrix = alphaTexture.getTextureMatrix(); <mask> <mask> if (textureMatrix) { <mask> this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); <mask> } <mask> } <mask> } <mask> <mask> // Glow emissive only <mask> if (this._emissiveTextureAndColor.texture) { </s> Add GlowLayer alpha support Former-commit-id: c7933906980608adf6216a0772b5c2e77150cb61 </s> remove // Alpha test if (material && material.needAlphaTesting()) { var alphaTexture = material.getAlphaTestTexture(); if (alphaTexture) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); let textureMatrix = alphaTexture.getTextureMatrix(); </s> add const needAlphaTest = material.needAlphaTesting(); const diffuseTexture = material.getAlphaTestTexture(); const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture); if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", diffuseTexture); const textureMatrix = diffuseTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } } </s> remove if (material.needAlphaBlendingForMesh(mesh)) { </s> add if (this._canRenderMesh(mesh, material)) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9773456a3243f08acc3d7d5503e6af95d1b255
src/Layers/effectLayer.ts
/** * Returns true if the mesh can be rendered, otherwise false. * @param mesh The mesh to render * @param material The material used on the mesh * @returns true if it can be rendered otherwise false */ protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean { return true; }
<mask> } <mask> <mask> /** <mask> * Implementation specific of rendering the generating effect on the main canvas. <mask> * @param effect The effect used to render through <mask> */ <mask> protected _internalRender(effect: Effect): void { <mask> // Texture </s> Add GlowLayer alpha support Former-commit-id: c7933906980608adf6216a0772b5c2e77150cb61 </s> remove if (material.needAlphaBlendingForMesh(mesh)) { </s> add if (this._canRenderMesh(mesh, material)) { </s> remove if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } </s> add const opacityTexture = (material as any).opacityTexture; if (opacityTexture) { this._effectLayerMapGenerationEffect.setTexture("opacitySampler", opacityTexture); this._effectLayerMapGenerationEffect.setFloat("opacityIntensity", opacityTexture.level); const textureMatrix = opacityTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("opacityMatrix", textureMatrix); </s> remove // Alpha test if (material && material.needAlphaTesting()) { var alphaTexture = material.getAlphaTestTexture(); if (alphaTexture) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", alphaTexture); let textureMatrix = alphaTexture.getTextureMatrix(); </s> add const needAlphaTest = material.needAlphaTesting(); const diffuseTexture = material.getAlphaTestTexture(); const needAlphaBlendFromDiffuse = diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture); if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) { this._effectLayerMapGenerationEffect.setTexture("diffuseSampler", diffuseTexture); const textureMatrix = diffuseTexture.getTextureMatrix(); if (textureMatrix) { this._effectLayerMapGenerationEffect.setMatrix("diffuseMatrix", textureMatrix); } }
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9773456a3243f08acc3d7d5503e6af95d1b255
src/Layers/glowLayer.ts
<mask> <mask> // Default emitter type <mask> this.particleEmitterType = new BoxParticleEmitter(); <mask> <mask> // Default update function <mask> this.updateFunction = (particles: Particle[]): void => { <mask> for (var index = 0; index < particles.length; index++) { <mask> var particle = particles[index]; <mask> particle.age += this._scaledUpdateSpeed; <mask> </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> add let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> remove this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; </s> add if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; } </s> remove particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); </s> add particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection); </s> remove this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); </s> add this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection);
<mask> } <mask> } <mask> particle.angle += particle.angularSpeed * this._scaledUpdateSpeed; <mask> <mask> particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); <mask> particle.position.addInPlace(this._scaledDirection); <mask> <mask> this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); <mask> particle.direction.addInPlace(this._scaledGravity); <mask> </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); </s> add this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity); </s> remove // Default update function </s> add </s> remove this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; </s> add if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; } </s> remove particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> add let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity);
<mask> <mask> particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); <mask> particle.position.addInPlace(this._scaledDirection); <mask> <mask> this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); <mask> particle.direction.addInPlace(this._scaledGravity); <mask> <mask> // Gradient <mask> if (this._sizeGradients && this._sizeGradients.length > 0) { <mask> Tools.GetCurrentGradient(ratio, this._sizeGradients, (currentGradient, nextGradient, scale) => { </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); </s> add particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection); </s> remove particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> add let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> remove this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; </s> add if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; } </s> remove // Default update function </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; }
<mask> this._vertexData[offset++] = particle.cellIndex; <mask> } <mask> <mask> if (!this._isBillboardBased) { <mask> this._vertexData[offset++] = particle.direction.x; <mask> this._vertexData[offset++] = particle.direction.y; <mask> this._vertexData[offset++] = particle.direction.z; <mask> } <mask> <mask> if (!this._useInstancing) { <mask> if (this._isAnimationSheetEnabled) { <mask> if (offsetX === 0) </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> add let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> remove // Default update function </s> add </s> remove this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); </s> add this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity); </s> remove particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); </s> add particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower);
<mask> <mask> this._particles.push(particle); <mask> <mask> // Emitter <mask> particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); <mask> <mask> if (this.startPositionFunction) { <mask> this.startPositionFunction(worldMatrix, particle.position, particle); <mask> } <mask> else { </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; </s> add if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; } </s> remove // Default update function </s> add </s> remove this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); </s> add this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity); </s> remove particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); </s> add particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
if (emitPower === 0) { if (!particle._initialDirection) { particle._initialDirection = particle.direction.clone(); } else { particle._initialDirection.copyFrom(particle.direction); } } else { particle._initialDirection = null; } particle.direction.scaleInPlace(emitPower);
<mask> } <mask> <mask> // Life time <mask> if (this.targetStopDuration && this._lifeTimeGradients && this._lifeTimeGradients.length > 0) { <mask> let ratio = Scalar.Clamp(this._actualFrame / this.targetStopDuration); <mask> Tools.GetCurrentGradient(ratio, this._lifeTimeGradients, (currentGradient, nextGradient, scale) => { </s> Revert to previous model Former-commit-id: 62b9dd12a634cebc5f39a6adc2e0e43f6bada624 </s> remove this.gravity.scaleToRef(this._scaledUpdateSpeed / particle._emitPower, this._scaledGravity); </s> add this.gravity.scaleToRef(this._scaledUpdateSpeed, this._scaledGravity); </s> remove particle._emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> add let emitPower = Scalar.RandomRange(this.minEmitPower, this.maxEmitPower); </s> remove this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; </s> add if (particle._initialDirection) { this._vertexData[offset++] = particle._initialDirection.x; this._vertexData[offset++] = particle._initialDirection.y; this._vertexData[offset++] = particle._initialDirection.z; } else { this._vertexData[offset++] = particle.direction.x; this._vertexData[offset++] = particle.direction.y; this._vertexData[offset++] = particle.direction.z; } </s> remove // Default update function </s> add </s> remove particle.direction.scaleToRef(this._scaledUpdateSpeed * particle._emitPower, this._scaledDirection); </s> add particle.direction.scaleToRef(this._scaledUpdateSpeed, this._scaledDirection);
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fb9ed6a644451af8923fff84e1bb4a25d86f75b8
src/Particles/babylon.particleSystem.ts
<mask> set superSampleFactor(value: number) { <mask> } <mask> } <mask> <mask> export enum TextAlign { <mask> Left = 1, <mask> Top, <mask> Right, <mask> Bottom, <mask> Center <mask> } <mask> <mask> @className("Text2D", "BABYLON") <mask> /** <mask> * Primitive that render text using a specific font <mask> */ <mask> export class Text2D extends RenderablePrim2D { </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove * - textAlignH: TextAlign horizontal enum (left, center, right) * - textAlignV: TextAlign vertical enum (top, center, bottom) </s> add * - textAlignH: align text horizontally (Text2D.AlignLeft, Text2D.AlignCenter, Text2D.AlignRight) * - textAlignV: align text vertically (Text2D.AlignTop, Text2D.AlignCenter, Text2D.AlignBottom) </s> remove if(settings.textAlignH != null){ this.textAlignH = settings.textAlignH; } if(settings.textAlignV != null){ this.textAlignV = settings.textAlignV; } if(settings.wordWrap){ this._wordWrap = true; } </s> add </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
* - textAlignH: align text horizontally (Text2D.AlignLeft, Text2D.AlignCenter, Text2D.AlignRight) * - textAlignV: align text vertically (Text2D.AlignTop, Text2D.AlignCenter, Text2D.AlignBottom)
<mask> * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString) <mask> * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString) <mask> * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString) <mask> * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString) <mask> * - textAlignH: TextAlign horizontal enum (left, center, right) <mask> * - textAlignV: TextAlign vertical enum (top, center, bottom) <mask> * - wordWrap: if true the text will wrap inside content area <mask> */ <mask> constructor(text: string, settings?: { <mask> <mask> parent ?: Prim2DBase, </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove export enum TextAlign { Left = 1, Top, Right, Bottom, Center } </s> add </s> remove if(settings.textAlignH != null){ this.textAlignH = settings.textAlignH; } if(settings.textAlignV != null){ this.textAlignV = settings.textAlignV; } if(settings.wordWrap){ this._wordWrap = true; } </s> add </s> remove textAlignH ?: TextAlign, textAlignV ?: TextAlign, </s> add textAlignH ?: number, textAlignV ?: number, </s> remove if (alignV == TextAlign.Bottom) { </s> add if (alignV == Text2D.AlignBottom) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
textAlignH ?: number, textAlignV ?: number,
<mask> paddingLeft ?: number | string, <mask> paddingRight ?: number | string, <mask> paddingBottom ?: number | string, <mask> padding ?: string, <mask> textAlignH ?: TextAlign, <mask> textAlignV ?: TextAlign, <mask> wordWrap ?: boolean <mask> }) { <mask> <mask> if (!settings) { <mask> settings = {}; </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove * - textAlignH: TextAlign horizontal enum (left, center, right) * - textAlignV: TextAlign vertical enum (top, center, bottom) </s> add * - textAlignH: align text horizontally (Text2D.AlignLeft, Text2D.AlignCenter, Text2D.AlignRight) * - textAlignV: align text vertically (Text2D.AlignTop, Text2D.AlignCenter, Text2D.AlignBottom) </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
this.textAlignH = (settings.textAlignH==null) ? Text2D.AlignLeft : settings.textAlignH; this.textAlignV = (settings.textAlignV==null) ? Text2D.AlignTop : settings.textAlignV; this._wordWrap = (settings.wordWrap==null) ? false : true;
<mask> this._tabulationSize = (settings.tabulationSize == null) ? 4 : settings.tabulationSize; <mask> this._textSize = null; <mask> this.text = text; <mask> this.size = (settings.size==null) ? null : settings.size; <mask> <mask> this._updateRenderMode(); <mask> } <mask> </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove if(settings.textAlignH != null){ this.textAlignH = settings.textAlignH; } if(settings.textAlignV != null){ this.textAlignV = settings.textAlignV; } if(settings.wordWrap){ this._wordWrap = true; } </s> add </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
<mask> this._textSize = null; <mask> this.text = text; <mask> this.size = (settings.size==null) ? null : settings.size; <mask> <mask> if(settings.textAlignH != null){ <mask> this.textAlignH = settings.textAlignH; <mask> } <mask> <mask> if(settings.textAlignV != null){ <mask> this.textAlignV = settings.textAlignV; <mask> } <mask> <mask> if(settings.wordWrap){ <mask> this._wordWrap = true; <mask> } <mask> <mask> this._updateRenderMode(); <mask> } <mask> <mask> protected levelIntersect(intersectInfo: IntersectInfo2D): boolean { <mask> // For now I can't do something better that boundingInfo is a hit, detecting an intersection on a particular letter would be possible, but do we really need it? Not for now... </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove export enum TextAlign { Left = 1, Top, Right, Bottom, Center } </s> add </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) {
<mask> let alignV = this.textAlignV; <mask> <mask> offset.x = 0; <mask> <mask> if (alignH == TextAlign.Right || alignH == TextAlign.Center) { <mask> for (let i = 0; i < lineLengths.length; i++) { <mask> if (lineLengths[i] > maxLineLen) { <mask> maxLineLen = lineLengths[i]; <mask> } <mask> } </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
if (alignH == Text2D.AlignRight) {
<mask> <mask> let textHeight = lineLengths.length * lh; <mask> let offsetX = this.padding.leftPixels; <mask> <mask> if (alignH == TextAlign.Right) { <mask> offsetX += contentAreaWidth - maxLineLen; <mask> } else if (alignH == TextAlign.Center) { <mask> offsetX += (contentAreaWidth - maxLineLen) * .5; <mask> } <mask> </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignV == TextAlign.Bottom) { </s> add if (alignV == Text2D.AlignBottom) { </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
} else if (alignH == Text2D.AlignCenter) {
<mask> let offsetX = this.padding.leftPixels; <mask> <mask> if (alignH == TextAlign.Right) { <mask> offsetX += contentAreaWidth - maxLineLen; <mask> } else if (alignH == TextAlign.Center) { <mask> offsetX += (contentAreaWidth - maxLineLen) * .5; <mask> } <mask> <mask> offset.x += offsetX; <mask> </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
if (alignV == Text2D.AlignBottom) {
<mask> <mask> offset.y += contentAreaHeight + textHeight - lh; <mask> offset.y += this.padding.bottomPixels; <mask> <mask> if (alignV == TextAlign.Bottom) { <mask> offset.y -= contentAreaHeight; <mask> }else if (alignV == TextAlign.Center) { <mask> offset.y -= (contentAreaHeight - textHeight) * .5 + lineLengths.length * lh; <mask> }else { <mask> offset.y -= lineLengths.length * lh; </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
}else if (alignV == Text2D.AlignCenter) {
<mask> offset.y += this.padding.bottomPixels; <mask> <mask> if (alignV == TextAlign.Bottom) { <mask> offset.y -= contentAreaHeight; <mask> }else if (alignV == TextAlign.Center) { <mask> offset.y -= (contentAreaHeight - textHeight) * .5 + lineLengths.length * lh; <mask> }else { <mask> offset.y -= lineLengths.length * lh; <mask> } <mask> </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove if (alignV == TextAlign.Bottom) { </s> add if (alignV == Text2D.AlignBottom) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
if (alignH == Text2D.AlignRight) {
<mask> for (let i = 0; i < lineLengths.length; i++) { <mask> let numChars = charsPerLine[i]; <mask> let lineLength = lineLengths[i]; <mask> <mask> if (alignH == TextAlign.Right) { <mask> offset.x += maxLineLen - lineLength; <mask> }else if (alignH == TextAlign.Center) { <mask> offset.x += (maxLineLen - lineLength) * .5; <mask> } <mask> </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove }else if (alignH == TextAlign.Center) { </s> add }else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
}else if (alignH == Text2D.AlignCenter) {
<mask> let lineLength = lineLengths[i]; <mask> <mask> if (alignH == TextAlign.Right) { <mask> offset.x += maxLineLen - lineLength; <mask> }else if (alignH == TextAlign.Center) { <mask> offset.x += (maxLineLen - lineLength) * .5; <mask> } <mask> <mask> for (let j = 0; j < numChars; j++) { <mask> let char = text[charNum]; </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove if (alignH == TextAlign.Right || alignH == TextAlign.Center) { </s> add if (alignH == Text2D.AlignRight || alignH == Text2D.AlignCenter) { </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) { </s> remove }else if (alignV == TextAlign.Center) { </s> add }else if (alignV == Text2D.AlignCenter) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
public textAlignH: number; public textAlignV: number;
<mask> private _text: string; <mask> private _textSize: Size; <mask> private _wordWrap: boolean; <mask> <mask> public textAlignH: TextAlign; <mask> public textAlignV: TextAlign; <mask> <mask> } <mask> } </s> replaced TextAlign enum with Text2D static readonly numbers and made initilization of new properties consistent the other properties Former-commit-id: 3fda5a11c5e43e548693c25955411d1dc803e076 </s> remove * - textAlignH: TextAlign horizontal enum (left, center, right) * - textAlignV: TextAlign vertical enum (top, center, bottom) </s> add * - textAlignH: align text horizontally (Text2D.AlignLeft, Text2D.AlignCenter, Text2D.AlignRight) * - textAlignV: align text vertically (Text2D.AlignTop, Text2D.AlignCenter, Text2D.AlignBottom) </s> remove export enum TextAlign { Left = 1, Top, Right, Bottom, Center } </s> add </s> remove } else if (alignH == TextAlign.Center) { </s> add } else if (alignH == Text2D.AlignCenter) { </s> remove if(settings.textAlignH != null){ this.textAlignH = settings.textAlignH; } if(settings.textAlignV != null){ this.textAlignV = settings.textAlignV; } if(settings.wordWrap){ this._wordWrap = true; } </s> add </s> remove if (alignH == TextAlign.Right) { </s> add if (alignH == Text2D.AlignRight) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fbe57698d413e8bbf0b1a00dc3c5b0b926b4c1b6
canvas2D/src/Engine/babylon.text2d.ts
//const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null;
<mask> // New clip length is greater than current clip length: add a key frame at the new clip length location with the same value as the previous frame <mask> this.props.context.clipLength = newClipLength; <mask> <mask> this.props.context.onMoveToFrameRequired.notifyObservers(newClipLength); <mask> const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; <mask> if (!keyAlreadyExists) { <mask> this.props.context.onNewKeyPointRequired.notifyObservers(); <mask> } <mask> <mask> this.setState({ clipLength: newClipLength.toFixed(0) }); </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation); </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); </s> add onInterpolationModeSet = new Observable<{ keyId: number; value: AnimationKeyInterpolation }>();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.tsx
const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null;
<mask> // New clip length is smaller than current clip length: move the playing range to the new clip length <mask> this.props.context.clipLength = newClipLength; <mask> <mask> this.props.context.onMoveToFrameRequired.notifyObservers(newClipLength); <mask> const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; <mask> if (!keyAlreadyExists) { <mask> this.props.context.onNewKeyPointRequired.notifyObservers(); <mask> } <mask> <mask> this.props.context.toKey = Math.min(this.props.context.toKey, this.props.context.clipLength); </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add //const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation); </s> remove onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); </s> add onInterpolationModeSet = new Observable<{ keyId: number; value: AnimationKeyInterpolation }>(); </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.tsx
/*private _getKeyAtFrame(frameNumber : number) {
<mask> } <mask> this.setState({ clipLength: newClipLength.toFixed(0) }); <mask> } <mask> <mask> private _getKeyAtFrame(frameNumber: number) { <mask> const keys = this.props.context.activeAnimations[0].getKeys(); <mask> for (let key of keys) { <mask> if (Math.floor(frameNumber - key.frame) === 0) { <mask> return key; <mask> } </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation); </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add //const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove } </s> add }*/ </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.tsx
}*/
<mask> return key; <mask> } <mask> } <mask> return null; <mask> } <mask> <mask> componentWillUnmount() { <mask> if (this._onAnimationsLoadedObserver) { <mask> this.props.context.onAnimationsLoaded.remove(this._onAnimationsLoadedObserver); <mask> } </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove } </s> add </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/bottomBar/bottomBarComponent.tsx
activeChannels: { [key: number]: string } = {};
<mask> scene: Scene; <mask> target: Nullable<IAnimatable>; <mask> rootAnimationGroup: Nullable<AnimationGroup>; <mask> activeAnimations: Animation[] = []; <mask> activeChannels: {[key: number]: string} = {}; <mask> activeKeyPoints: Nullable<KeyPointComponent[]>; <mask> mainKeyPoint: Nullable<KeyPointComponent>; <mask> snippetId: string; <mask> useTargetAnimations: boolean; <mask> </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); </s> add onInterpolationModeSet = new Observable<{ keyId: number; value: AnimationKeyInterpolation }>(); </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add //const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
onInterpolationModeSet = new Observable<{ keyId: number; value: AnimationKeyInterpolation }>();
<mask> <mask> onClipLengthIncreased = new Observable<number>(); <mask> onClipLengthDecreased = new Observable<number>(); <mask> <mask> onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); <mask> <mask> onSelectToActivated = new Observable<{from:number, to:number}>(); <mask> <mask> public prepare() { <mask> this.isPlaying = false; </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add //const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove activeChannels: {[key: number]: string} = {}; </s> add activeChannels: { [key: number]: string } = {};
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
onSelectToActivated = new Observable<{ from: number; to: number }>();
<mask> onClipLengthDecreased = new Observable<number>(); <mask> <mask> onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); <mask> <mask> onSelectToActivated = new Observable<{from:number, to:number}>(); <mask> <mask> public prepare() { <mask> this.isPlaying = false; <mask> if (!this.animations || !this.animations.length) { <mask> return; </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove onInterpolationModeSet = new Observable<{keyId: number, value: AnimationKeyInterpolation}>(); </s> add onInterpolationModeSet = new Observable<{ keyId: number; value: AnimationKeyInterpolation }>(); </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
<mask> } <mask> } <mask> <mask> for (var animationEntry of this.animations) { <mask> const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; <mask> if (!animation.hasRunningRuntimeAnimations) { <mask> return; <mask> } <mask> <mask> for (var runtimeAnimation of animation.runtimeAnimations) { </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; </s> add //const keyAlreadyExists = this._getKeyAtFrame(newClipLength) !== null; const keyAlreadyExists = this.props.context.getKeyAtFrame(newClipLength) !== null; </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove } </s> add }*/ </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
public getPrevKey(): Nullable<number> {
<mask> <mask> return -1; <mask> } <mask> <mask> public getPrevKey() : Nullable<number> { <mask> if (!this.animations || !this.animations.length || this.activeAnimations.length === 0) { <mask> return null; <mask> } <mask> <mask> let prevKey = -Number.MAX_VALUE; </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove } </s> add }*/ </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
public getNextKey(): Nullable<number> {
<mask> <mask> return prevKey; <mask> } <mask> <mask> public getNextKey() : Nullable<number> { <mask> if (!this.animations || !this.animations.length) { <mask> return null; <mask> } <mask> <mask> let nextKey = Number.MAX_VALUE; </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove onSelectToActivated = new Observable<{from:number, to:number}>(); </s> add onSelectToActivated = new Observable<{ from: number; to: number }>(); </s> remove } </s> add }*/ </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
<mask> } <mask> <mask> return nextKey; <mask> } <mask> } </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove } </s> add }*/ </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation);
[ "keep", "keep", "keep", "keep", "replace" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/context.ts
id="new-key" globalState={this.props.globalState} context={this.props.context} icon={newKeyIcon} onClick={() => this._onNewKeyButton()}/> <ActionButtonComponent
<mask> /> <mask> <ActionButtonComponent <mask> className={hasActiveAnimations ? "" : "disabled"} <mask> tooltip="New key" <mask> id="new-key" <mask> globalState={this.props.globalState} <mask> context={this.props.context} <mask> icon={newKeyIcon} <mask> onClick={() => this.props.context.onNewKeyPointRequired.notifyObservers()} <mask> /> <mask> <ActionButtonComponent <mask> tooltip="Frame canvas" <mask> id="frame-canvas" <mask> globalState={this.props.globalState} <mask> context={this.props.context} <mask> icon={frameIcon} </s> * If new key button is pressed but key already exists on that frame, update the existing frame. Former-commit-id: 5b70aab0df7efc3a28379aee4ed9fc29864cea14 </s> remove const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : animationEntry as Animation; </s> add const animation = this.useTargetAnimations ? (animationEntry as TargetedAnimation).animation : (animationEntry as Animation); </s> remove public getNextKey() : Nullable<number> { </s> add public getNextKey(): Nullable<number> { </s> remove public getPrevKey() : Nullable<number> { </s> add public getPrevKey(): Nullable<number> { </s> remove private _getKeyAtFrame(frameNumber: number) { </s> add /*private _getKeyAtFrame(frameNumber : number) { </s> remove } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fc16252157e9cde5bdedc2b407b407653864f949
inspector/src/components/actionTabs/tabs/propertyGrids/animations/curveEditor/topBarComponent.tsx
<mask> <mask> // Samplers <mask> varying vec2 vUV; <mask> uniform sampler2D textureSampler; <mask> uniform sampler2D rightSampler; <mask> uniform sampler2D leftSampler; <mask> <mask> void main(void) <mask> { <mask> vec4 leftFrag = texture2D(leftSampler, vUV); </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove vec4 rightFrag = texture2D(rightSampler, vUV); </s> add vec4 rightFrag = texture2D(textureSampler, vUV); </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) { </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]); </s> remove // Clear if (mustClearDepth) { this._engine.clear(this.clearColor, false, true); } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/Shaders/anaglyph.fragment.fx
vec4 rightFrag = texture2D(textureSampler, vUV);
<mask> { <mask> vec4 leftFrag = texture2D(leftSampler, vUV); <mask> leftFrag = vec4(1.0, leftFrag.g, leftFrag.b, 1.0); <mask> <mask> vec4 rightFrag = texture2D(rightSampler, vUV); <mask> rightFrag = vec4(rightFrag.r, 1.0, 1.0, 1.0); <mask> <mask> gl_FragColor = vec4(rightFrag.rgb * leftFrag.rgb, 1.0); <mask> } </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove uniform sampler2D rightSampler; </s> add </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) { </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]); </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove // Clear if (mustClearDepth) { this._engine.clear(this.clearColor, false, true); } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/Shaders/anaglyph.fragment.fx
BABYLON.Scene.prototype._renderForCamera = function (camera) {
<mask> } <mask> this._particlesDuration += new Date() - beforeParticlesDate; <mask> }; <mask> <mask> BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { <mask> var engine = this._engine; <mask> <mask> this.activeCamera = camera; <mask> <mask> if (!this.activeCamera) </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove this.postProcessManager._finalizeFrame(); </s> add this.postProcessManager._finalizeFrame(camera.isIntermediate); </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]); </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove vec4 rightFrag = texture2D(rightSampler, vUV); </s> add vec4 rightFrag = texture2D(textureSampler, vUV); </s> remove uniform sampler2D rightSampler; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/babylon.scene.js
<mask> <mask> // Viewport <mask> engine.setViewport(this.activeCamera.viewport); <mask> <mask> // Clear <mask> if (mustClearDepth) { <mask> this._engine.clear(this.clearColor, false, true); <mask> } <mask> <mask> // Camera <mask> this._renderId++; <mask> this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix()); <mask> <mask> // Meshes </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove this.postProcessManager._finalizeFrame(); </s> add this.postProcessManager._finalizeFrame(camera.isIntermediate); </s> remove uniform sampler2D rightSampler; </s> add </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]); </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/babylon.scene.js
this.postProcessManager._finalizeFrame(camera.isIntermediate);
<mask> <mask> this._renderDuration += new Date() - beforeRenderDate; <mask> <mask> // Finalize frame <mask> this.postProcessManager._finalizeFrame(); <mask> <mask> // Update camera <mask> this.activeCamera._updateFromScene(); <mask> <mask> // Reset some special arrays </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) { </s> remove // Clear if (mustClearDepth) { this._engine.clear(this.clearColor, false, true); } </s> add </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove uniform sampler2D rightSampler; </s> add </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/babylon.scene.js
this._processSubCameras(this.activeCameras[cameraIndex]);
<mask> if (this.activeCameras.length > 0) { <mask> var currentRenderId = this._renderId; <mask> for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) { <mask> this._renderId = currentRenderId; <mask> this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); <mask> } <mask> } else { <mask> this._renderForCamera(this.activeCamera); <mask> } <mask> </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove this._renderForCamera(this.activeCamera); </s> add this._processSubCameras(this.activeCamera); </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) { </s> remove vec4 rightFrag = texture2D(rightSampler, vUV); </s> add vec4 rightFrag = texture2D(textureSampler, vUV); </s> remove // Clear if (mustClearDepth) { this._engine.clear(this.clearColor, false, true); } </s> add </s> remove uniform sampler2D rightSampler; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/babylon.scene.js
this._processSubCameras(this.activeCamera);
<mask> this._renderId = currentRenderId; <mask> this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); <mask> } <mask> } else { <mask> this._renderForCamera(this.activeCamera); <mask> } <mask> <mask> // After render <mask> if (this.afterRender) { <mask> this.afterRender(); </s> Adding to AnaglyphFreeCamera Cameras now can have subCameras Optimizing AnaglyphArcRotateCamera Former-commit-id: 0e223ffb8e0c7a1ce7394659f673265f4dee7cc1 </s> remove this._renderForCamera(this.activeCameras[cameraIndex], cameraIndex != 0); </s> add this._processSubCameras(this.activeCameras[cameraIndex]); </s> remove // Clear if (mustClearDepth) { this._engine.clear(this.clearColor, false, true); } </s> add </s> remove BABYLON.Scene.prototype._renderForCamera = function (camera, mustClearDepth) { </s> add BABYLON.Scene.prototype._renderForCamera = function (camera) { </s> remove vec4 rightFrag = texture2D(rightSampler, vUV); </s> add vec4 rightFrag = texture2D(textureSampler, vUV); </s> remove uniform sampler2D rightSampler; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fcdb0ff63bfd7e7b9b4945798970212fc29dead5
Babylon/babylon.scene.js
this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });
<mask> this._attachedToElement = false; <mask> } <mask> } <mask> <mask> this._targetDragStart(virtualMeshesInfo.dragMesh.position, virtualMeshesInfo.dragMesh.rotationQuaternion!, pointerId); <mask> this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.dragMesh.position }); <mask> } <mask> } else if (pointerInfo.type == PointerEventTypes.POINTERUP || pointerInfo.type == PointerEventTypes.POINTERDOUBLETAP) { <mask> const registeredPointerIndex = this.currentDraggingPointerIds.indexOf(pointerId); <mask> <mask> // Update state </s> fixed delta position in sixdofdragbehavior Former-commit-id: 781c5f909ef2d426ca3778d4bbda8b937ed58502 </s> remove if (controllerData.pick && !this._farInteractionFeature?.attached) { </s> add if (controllerData.pick) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fd2c621c4c09597507e995838e2304b5dc905e97
src/Behaviors/Meshes/baseSixDofDragBehavior.ts
if (controllerData.pick) {
<mask> controllerData.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(() => { <mask> if (!this._options.enableNearInteractionOnAllControllers && xrController.uniqueId !== this._attachedController) { <mask> return; <mask> } <mask> if (controllerData.pick && !this._farInteractionFeature?.attached) { <mask> controllerData.pick.ray = controllerData.grabRay; <mask> this._scene.simulatePointerMove(controllerData.pick, pointerEventInit); <mask> } <mask> <mask> // Near pick pointer event </s> fixed delta position in sixdofdragbehavior Former-commit-id: 781c5f909ef2d426ca3778d4bbda8b937ed58502 </s> remove this._targetDragStart(virtualMeshesInfo.dragMesh.position, virtualMeshesInfo.dragMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.dragMesh.position }); </s> add this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fd2c621c4c09597507e995838e2304b5dc905e97
src/XR/features/WebXRNearInteraction.ts
} if (controllerData.pick && !this._farInteractionFeature?.attached) {
<mask> if (controllerData.pick) { <mask> controllerData.pick.ray = controllerData.grabRay; <mask> this._scene.simulatePointerMove(controllerData.pick, pointerEventInit); <mask> } <mask> <mask> // Near pick pointer event <mask> if (controllerData.nearInteraction && controllerData.pick && controllerData.pick.hit) { </s> fixed delta position in sixdofdragbehavior Former-commit-id: 781c5f909ef2d426ca3778d4bbda8b937ed58502 </s> remove if (controllerData.pick && !this._farInteractionFeature?.attached) { </s> add if (controllerData.pick) { </s> remove this._targetDragStart(virtualMeshesInfo.dragMesh.position, virtualMeshesInfo.dragMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.dragMesh.position }); </s> add this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fd2c621c4c09597507e995838e2304b5dc905e97
src/XR/features/WebXRNearInteraction.ts
if (controllerData.pick) { controllerData.pick.ray = controllerData.grabRay; }
<mask> const grabCheck = (pressed: boolean) => { <mask> if (this._options.enableNearInteractionOnAllControllers || (xrController.uniqueId === this._attachedController && !this._farInteractionFeature?.attached)) { <mask> if (pressed && controllerData.pick && controllerData.meshUnderPointer && this._nearGrabPredicate(controllerData.meshUnderPointer)) { <mask> controllerData.grabInteraction = true; <mask> this._scene.simulatePointerDown(controllerData.pick, pointerEventInit); <mask> } else if (!pressed && controllerData.pick && controllerData.grabInteraction) { </s> fixed delta position in sixdofdragbehavior Former-commit-id: 781c5f909ef2d426ca3778d4bbda8b937ed58502 </s> remove if (controllerData.pick && !this._farInteractionFeature?.attached) { </s> add if (controllerData.pick) { </s> remove this._targetDragStart(virtualMeshesInfo.dragMesh.position, virtualMeshesInfo.dragMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.dragMesh.position }); </s> add this._targetDragStart(virtualMeshesInfo.pivotMesh.position, virtualMeshesInfo.pivotMesh.rotationQuaternion!, pointerId); this.onDragStartObservable.notifyObservers({ position: virtualMeshesInfo.pivotMesh.position });
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fd2c621c4c09597507e995838e2304b5dc905e97
src/XR/features/WebXRNearInteraction.ts
@serialize("coordinatesMode") private _coordinatesMode = Texture.EXPLICIT_MODE;
<mask> <mask> @serialize() <mask> public coordinatesIndex = 0; <mask> <mask> /** <mask> * How a texture is mapped. <mask> * <mask> * | Value | Type | Description | <mask> * | ----- | ----------------------------------- | ----------- | <mask> * | 0 | EXPLICIT_MODE | | </s> update doc part applying Deltakosh instructions :) Former-commit-id: 0133eee3639c3eb604b2aa2f472a3674fb383d40 </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */ </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */ </s> remove @serialize("coordinatesMode") private _coordinatesMode = Texture.EXPLICIT_MODE; </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fdf66e173016c34335fa26b431fb5309d09d3573
src/Materials/Textures/babylon.baseTexture.ts
<mask> * | 7 | EQUIRECTANGULAR_MODE | | <mask> * | 8 | FIXED_EQUIRECTANGULAR_MODE | | <mask> * | 9 | FIXED_EQUIRECTANGULAR_MIRRORED_MODE | | <mask> */ <mask> @serialize("coordinatesMode") <mask> private _coordinatesMode = Texture.EXPLICIT_MODE; <mask> public set coordinatesMode(value: number) { <mask> if (this._coordinatesMode === value) { <mask> return; <mask> } <mask> this._coordinatesMode = value; </s> update doc part applying Deltakosh instructions :) Former-commit-id: 0133eee3639c3eb604b2aa2f472a3674fb383d40 </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */ </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fdf66e173016c34335fa26b431fb5309d09d3573
src/Materials/Textures/babylon.baseTexture.ts
/** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */
<mask> * | 2 | MIRROR_ADDRESSMODE | | <mask> */ <mask> @serialize() <mask> public wrapU = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() <mask> public wrapV = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() <mask> public wrapR = Texture.WRAP_ADDRESSMODE; </s> update doc part applying Deltakosh instructions :) Former-commit-id: 0133eee3639c3eb604b2aa2f472a3674fb383d40 </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */ </s> remove @serialize("coordinatesMode") private _coordinatesMode = Texture.EXPLICIT_MODE; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fdf66e173016c34335fa26b431fb5309d09d3573
src/Materials/Textures/babylon.baseTexture.ts
/** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */
<mask> public wrapU = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() <mask> public wrapV = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() <mask> public wrapR = Texture.WRAP_ADDRESSMODE; <mask> <mask> @serialize() <mask> public anisotropicFilteringLevel = BaseTexture.DEFAULT_ANISOTROPIC_FILTERING_LEVEL; </s> update doc part applying Deltakosh instructions :) Former-commit-id: 0133eee3639c3eb604b2aa2f472a3674fb383d40 </s> remove </s> add /** * | Value | Type | Description | * | ----- | ------------------ | ----------- | * | 0 | CLAMP_ADDRESSMODE | | * | 1 | WRAP_ADDRESSMODE | | * | 2 | MIRROR_ADDRESSMODE | | */ </s> remove @serialize("coordinatesMode") private _coordinatesMode = Texture.EXPLICIT_MODE; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fdf66e173016c34335fa26b431fb5309d09d3573
src/Materials/Textures/babylon.baseTexture.ts
import { Observable, Observer } from '../../Misc/observable';
<mask> <mask> import "../../Shaders/shadowMap.fragment"; <mask> import "../../Shaders/shadowMap.vertex"; <mask> import "../../Shaders/depthBoxBlur.fragment"; <mask> import { Observable } from '../../Misc/observable'; <mask> import { _DevTools } from '../../Misc/devTools'; <mask> import { EffectFallbacks } from '../../Materials/effectFallbacks'; <mask> import { IShadowGenerator } from './shadowGenerator'; <mask> import { DirectionalLight } from '../directionalLight'; <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove r.push(1); </s> add </s> remove let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius); </s> add let minx = -bs.radius, miny = -bs.radius, minz = 0; let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius; // Try to tighten minZ and maxZ based on the bounding box of the shadow casters const boundingInfo = this._shadowCastersBoundingInfo; boundingInfo.update(this._viewMatrix[mapIndex]); maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z); if (!this.depthClamp) { // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z); } else { // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map) minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z); } this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz); this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz); let OrthoMatrix; if (this._scene.useRightHandedSystem) { OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz); } else { OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz); } </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> add if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
import { BoundingInfo } from '../../Culling/boundingInfo';
<mask> import { IShadowGenerator } from './shadowGenerator'; <mask> import { DirectionalLight } from '../directionalLight'; <mask> <mask> import { BoundingSphere } from "../../Culling/boundingSphere"; <mask> <mask> /** <mask> * A CSM implementation allowing casting shadows on large scenes. <mask> * Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove import { Observable } from '../../Misc/observable'; </s> add import { Observable, Observer } from '../../Misc/observable'; </s> remove r.push(1); </s> add </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
public lightSizeCorrection: boolean = true; public depthCorrection: boolean = true; public penumbraDarkness: number = 1.0;
<mask> this._contactHardeningLightSizeUVRatio = contactHardeningLightSizeUVRatio; <mask> } <mask> <mask> private _darkness = 0; <mask> <mask> /** Gets or sets the actual darkness of a shadow */ <mask> public get darkness() { <mask> return this._darkness; <mask> } </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove private _frustumLength: number; </s> add private _shadowMaxZ: number; </s> remove public splitBlendPercentage: number = 0.1; </s> add public cascadeBlendPercentage: number = 0.1;
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
private _lightMinExtents: Array<Vector3>; private _lightMaxExtents: Array<Vector3>;
<mask> private _effect: Effect; <mask> <mask> private _viewMatrix: Array<Matrix>; <mask> private _cachedPosition: Vector3 = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); <mask> private _cachedDirection: Vector3 = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); <mask> private _cachedDefines: string; <mask> private _currentRenderID: Array<number>; <mask> private _mapSize: number; </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _frustumLength: number; </s> add private _shadowMaxZ: number; </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove public splitBlendPercentage: number = 0.1; </s> add public cascadeBlendPercentage: number = 0.1; </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
private _shadowMaxZ: number;
<mask> private _viewSpaceBoundingSpheres: Array<BoundingSphere>; <mask> private _transformMatrices: Array<Matrix>; <mask> private _transformMatricesAsArray: Float32Array; <mask> <mask> private _frustumLength: number; <mask> /** <mask> * Gets the csmFrustumLength value: furthest range of the frustum for the CSM mode. <mask> */ <mask> public get frustumLength(): number { <mask> if (!this._scene || !this._scene.activeCamera) { </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
public get shadowMaxZ(): number {
<mask> private _frustumLength: number; <mask> /** <mask> * Gets the csmFrustumLength value: furthest range of the frustum for the CSM mode. <mask> */ <mask> public get frustumLength(): number { <mask> if (!this._scene || !this._scene.activeCamera) { <mask> return 0; <mask> } <mask> return this._frustumLength; <mask> } </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _frustumLength: number; </s> add private _shadowMaxZ: number; </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
return this._shadowMaxZ;
<mask> public get frustumLength(): number { <mask> if (!this._scene || !this._scene.activeCamera) { <mask> return 0; <mask> } <mask> return this._frustumLength; <mask> } <mask> /** <mask> * Sets the csmFrustumLength: furthest range of the frustum for the CSM mode. <mask> */ <mask> public set frustumLength(value: number) { </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove private _frustumLength: number; </s> add private _shadowMaxZ: number;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
public set shadowMaxZ(value: number) {
<mask> } <mask> /** <mask> * Sets the csmFrustumLength: furthest range of the frustum for the CSM mode. <mask> */ <mask> public set frustumLength(value: number) { <mask> if (!this._scene || !this._scene.activeCamera) { <mask> this._frustumLength = value; <mask> return; <mask> } <mask> if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> add if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._shadowMaxZ = value;
<mask> * Sets the csmFrustumLength: furthest range of the frustum for the CSM mode. <mask> */ <mask> public set frustumLength(value: number) { <mask> if (!this._scene || !this._scene.activeCamera) { <mask> this._frustumLength = value; <mask> return; <mask> } <mask> if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { <mask> return; <mask> } </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> add if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) {
<mask> if (!this._scene || !this._scene.activeCamera) { <mask> this._frustumLength = value; <mask> return; <mask> } <mask> if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { <mask> return; <mask> } <mask> this._frustumLength = value; <mask> this._initCascades(); <mask> } </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove if (!this._frustumLength) { this._frustumLength = camera.maxZ; </s> add if (!this._shadowMaxZ) { this._shadowMaxZ = camera.maxZ; </s> remove return this._frustumLength; </s> add return this._shadowMaxZ;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._shadowMaxZ = value;
<mask> } <mask> if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { <mask> return; <mask> } <mask> this._frustumLength = value; <mask> this._initCascades(); <mask> } <mask> <mask> protected _debug = false; <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> add if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) { </s> remove if (!this._frustumLength) { this._frustumLength = camera.maxZ; </s> add if (!this._shadowMaxZ) { this._shadowMaxZ = camera.maxZ;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
public cascadeBlendPercentage: number = 0.1;
<mask> } <mask> <mask> public depthClamp: boolean = false; <mask> <mask> public splitBlendPercentage: number = 0.1; <mask> <mask> private _lambda = 0.5; <mask> <mask> /** <mask> * Gets csmLambda: parameter used for calculating the frustum in CSM. </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove private _frustumLength: number; </s> add private _shadowMaxZ: number; </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
if (!this._shadowMaxZ) { this._shadowMaxZ = camera.maxZ;
<mask> if (!camera) { <mask> return; <mask> } <mask> <mask> if (!this._frustumLength) { <mask> this._frustumLength = camera.maxZ; <mask> } <mask> <mask> this._currentRenderID = new Array(this._cascades); <mask> <mask> // inits and sets all static params related to CSM </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value; </s> remove if (this._frustumLength === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> add if (this._shadowMaxZ === value || value < this._scene.activeCamera.minZ || value > this._scene.activeCamera.maxZ) { </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius); </s> add let minx = -bs.radius, miny = -bs.radius, minz = 0; let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius; // Try to tighten minZ and maxZ based on the bounding box of the shadow casters const boundingInfo = this._shadowCastersBoundingInfo; boundingInfo.update(this._viewMatrix[mapIndex]); maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z); if (!this.depthClamp) { // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z); } else { // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map) minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z); } this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz); this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz); let OrthoMatrix; if (this._scene.useRightHandedSystem) { OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz); } else { OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz); } </s> remove this._frustumLength = value; </s> add this._shadowMaxZ = value;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
let breaks = this._frustumSplit();
<mask> let farx = 0; <mask> let fary = 0; <mask> <mask> // get all internal camera cascaded frustum points <mask> let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); <mask> if (camera.fovMode === 0) { <mask> nearx = camera.minZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> neary = camera.minZ * Math.tan(camera.fov / 2); <mask> farx = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> fary = this._frustumLength * Math.tan(camera.fov / 2); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._frustumLength * Math.tan(camera.fov / 2); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._shadowMaxZ * Math.tan(camera.fov / 2); </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2); fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius); </s> add let minx = -bs.radius, miny = -bs.radius, minz = 0; let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius; // Try to tighten minZ and maxZ based on the bounding box of the shadow casters const boundingInfo = this._shadowCastersBoundingInfo; boundingInfo.update(this._viewMatrix[mapIndex]); maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z); if (!this.depthClamp) { // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z); } else { // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map) minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z); } this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz); this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz); let OrthoMatrix; if (this._scene.useRightHandedSystem) { OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz); } else { OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz); } </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
farx = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._shadowMaxZ * Math.tan(camera.fov / 2);
<mask> let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); <mask> if (camera.fovMode === 0) { <mask> nearx = camera.minZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> neary = camera.minZ * Math.tan(camera.fov / 2); <mask> farx = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> fary = this._frustumLength * Math.tan(camera.fov / 2); <mask> } else if (camera.fovMode === 1) { <mask> nearx = camera.minZ * Math.tan(camera.fov / 2); <mask> neary = camera.minZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> farx = this._frustumLength * Math.tan(camera.fov / 2); <mask> fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); </s> add let breaks = this._frustumSplit(); </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2); fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove r.push(1); return r; } </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera);
<mask> fary = this._frustumLength * Math.tan(camera.fov / 2); <mask> } else if (camera.fovMode === 1) { <mask> nearx = camera.minZ * Math.tan(camera.fov / 2); <mask> neary = camera.minZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> farx = this._frustumLength * Math.tan(camera.fov / 2); <mask> fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); <mask> } <mask> <mask> // populate the viewSpaceFrustums array <mask> for (let i = 0; i < this.cascades + 1; i++) { <mask> this._viewSpaceFrustums[i] = []; </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._frustumLength * Math.tan(camera.fov / 2); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._shadowMaxZ * Math.tan(camera.fov / 2); </s> remove let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); </s> add let breaks = this._frustumSplit(); </s> remove r.push(1); return r; } </s> add </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, neary, camera.minZ), new Vector3(farx, fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, -neary, camera.minZ), new Vector3(farx, -fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, -neary, camera.minZ), new Vector3(-farx, -fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, neary, camera.minZ), new Vector3(-farx, fary, this._shadowMaxZ), breaks[i]));
<mask> <mask> // populate the viewSpaceFrustums array <mask> for (let i = 0; i < this.cascades + 1; i++) { <mask> this._viewSpaceFrustums[i] = []; <mask> this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, neary, camera.minZ), new Vector3(farx, fary, this._frustumLength), breaks[i])); <mask> this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, -neary, camera.minZ), new Vector3(farx, -fary, this._frustumLength), breaks[i])); <mask> this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, -neary, camera.minZ), new Vector3(-farx, -fary, this._frustumLength), breaks[i])); <mask> this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, neary, camera.minZ), new Vector3(-farx, fary, this._frustumLength), breaks[i])); <mask> } <mask> <mask> // populate the viewSpaceBoundingSpheres array <mask> var minX = Number.MAX_VALUE; <mask> var minY = Number.MAX_VALUE; </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2); fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000; </s> add this._shadowMaxZ = this._scene.activeCamera?.maxZ ?? 10000; this._shadowCastersBoundingInfo = new BoundingInfo(new Vector3(0, 0, 0), new Vector3(0, 0, 0)); this.freezeShadowCastersBoundingInfo = false;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._lightMinExtents = []; this._lightMaxExtents = [];
<mask> <mask> // initialize the CSM transformMatrices <mask> this._viewMatrix = []; <mask> this._transformMatrices = []; <mask> for (let index = 0; index < this.cascades; index++) { <mask> this._viewMatrix[index] = Matrix.Zero(); <mask> this._transformMatrices[index] = Matrix.Zero(); <mask> this._lightMinExtents[index] = new Vector3(); <mask> this._lightMaxExtents[index] = new Vector3(); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, neary, camera.minZ), new Vector3(farx, fary, this._frustumLength), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, -neary, camera.minZ), new Vector3(farx, -fary, this._frustumLength), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, -neary, camera.minZ), new Vector3(-farx, -fary, this._frustumLength), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, neary, camera.minZ), new Vector3(-farx, fary, this._frustumLength), breaks[i])); </s> add this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, neary, camera.minZ), new Vector3(farx, fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(nearx, -neary, camera.minZ), new Vector3(farx, -fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, -neary, camera.minZ), new Vector3(-farx, -fary, this._shadowMaxZ), breaks[i])); this._viewSpaceFrustums[i].push(Vector3.Lerp(new Vector3(-nearx, neary, camera.minZ), new Vector3(-farx, fary, this._shadowMaxZ), breaks[i])); </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove if (!this._frustumLength) { this._frustumLength = camera.maxZ; </s> add if (!this._shadowMaxZ) { this._shadowMaxZ = camera.maxZ; </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2); fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera);
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._lightMinExtents[index] = new Vector3(); this._lightMaxExtents[index] = new Vector3();
<mask> this._transformMatrices = []; <mask> for (let index = 0; index < this.cascades; index++) { <mask> this._viewMatrix[index] = Matrix.Zero(); <mask> this._transformMatrices[index] = Matrix.Zero(); <mask> } <mask> this._transformMatricesAsArray = new Float32Array(this.cascades * 16); <mask> } <mask> <mask> private _frustumSplit(): Array<number> { <mask> let camera = this._scene.activeCamera; </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove r.push(1); return r; } </s> add </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return [];
<mask> } <mask> this._transformMatricesAsArray = new Float32Array(this.cascades * 16); <mask> } <mask> <mask> private _uniformSplit(amount: number, near: number, far: number): Array<number> { <mask> let r = []; <mask> for (let i = 1; i < amount; i++) { <mask> r.push(i / amount); <mask> } <mask> r.push(1); <mask> return r; <mask> } <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove r.push(1); return r; } </s> add </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
<mask> let r = []; <mask> for (let i = 1; i < amount; i++) { <mask> r.push(i / amount); <mask> } <mask> r.push(1); <mask> return r; <mask> } <mask> <mask> private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { <mask> let r = []; <mask> for (let i = 1; i < amount; i++) { <mask> r.push((near * (far / near) ** (i / amount) - near) / (far - near)); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove r.push(1); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ;
<mask> r.push(1); <mask> return r; <mask> } <mask> <mask> private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { <mask> let r = []; <mask> for (let i = 1; i < amount; i++) { <mask> r.push((near * (far / near) ** (i / amount) - near) / (far - near)); <mask> } <mask> r.push(1); <mask> return r; <mask> } <mask> <mask> private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { <mask> let log = this._logarithmicSplit(amount, near, far); <mask> let uni = this._uniformSplit(amount, near, far); <mask> let r = []; </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove r.push(1); return r; } </s> add </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove r.push(1); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
<mask> r.push(1); <mask> return r; <mask> } <mask> <mask> private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { <mask> let log = this._logarithmicSplit(amount, near, far); <mask> let uni = this._uniformSplit(amount, near, far); <mask> let r = []; <mask> r.push(0); <mask> for (let i = 1; i < amount; i++) { <mask> r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); <mask> } </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(1); return r; } </s> add </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove r.push(1); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
<mask> private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { <mask> let log = this._logarithmicSplit(amount, near, far); <mask> let uni = this._uniformSplit(amount, near, far); <mask> let r = []; <mask> r.push(0); <mask> for (let i = 1; i < amount; i++) { <mask> r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); <mask> } <mask> r.push(1); <mask> return r; <mask> } <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(1); return r; } </s> add </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return []; </s> remove r.push(1); </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
<mask> r.push(0); <mask> for (let i = 1; i < amount; i++) { <mask> r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); <mask> } <mask> r.push(1); <mask> return r; <mask> } <mask> <mask> /** <mask> * Gets the CSM transformation matrix used to project the meshes into the map from the light point of view. </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove r.push(1); return r; } </s> add </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove private _uniformSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push(i / amount); </s> add private _frustumSplit(): Array<number> { let camera = this._scene.activeCamera; if (!camera) { return [];
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
let minx = -bs.radius, miny = -bs.radius, minz = 0; let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius; // Try to tighten minZ and maxZ based on the bounding box of the shadow casters const boundingInfo = this._shadowCastersBoundingInfo; boundingInfo.update(this._viewMatrix[mapIndex]); maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z); if (!this.depthClamp) { // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z); } else { // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map) minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z); } this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz); this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz); let OrthoMatrix; if (this._scene.useRightHandedSystem) { OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz); } else { OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz); }
<mask> // get view matrix <mask> let shadowCamPos = bs.centerWorld.subtract(this._lightDirection.scale(bs.radius)); <mask> Matrix.LookAtLHToRef(shadowCamPos, bs.centerWorld, Vector3.Up(), this._viewMatrix[mapIndex]); <mask> // get ortho matrix <mask> let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius); <mask> // get projection matrix <mask> this._viewMatrix[mapIndex].multiplyToRef(OrthoMatrix, this._transformMatrices[mapIndex]); <mask> <mask> // rounding the transform matrix to prevent shimmering artifacts from camera movement <mask> let shadowOrigin = Vector3.TransformCoordinates(Vector3.Zero(), this._transformMatrices[mapIndex]); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); </s> add let breaks = this._frustumSplit(); </s> remove r.push(1); </s> add </s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset); float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse; </s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset); vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.); </s> remove this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000; </s> add this._shadowMaxZ = this._scene.activeCamera?.maxZ ?? 10000; this._shadowCastersBoundingInfo = new BoundingInfo(new Vector3(0, 0, 0), new Vector3(0, 0, 0)); this.freezeShadowCastersBoundingInfo = false; </s> remove shadow = mix(shadow, 1., depthMetric - avgBlockerDepth); </s> add shadow = mix(shadow, 1., min((depthMetric - avgBlockerDepth) * depthCorrection * penumbraDarkness, 1.));
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
this._shadowMaxZ = this._scene.activeCamera?.maxZ ?? 10000; this._shadowCastersBoundingInfo = new BoundingInfo(new Vector3(0, 0, 0), new Vector3(0, 0, 0)); this.freezeShadowCastersBoundingInfo = false;
<mask> <mask> this._light = light; <mask> this._mapSize = mapSize; <mask> light._shadowGenerator = this; <mask> this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000; <mask> <mask> CascadedShadowGenerator._SceneComponentInitialization(this._scene); <mask> <mask> // Texture type fallback from float to int if not supported. <mask> var caps = this._scene.getEngine().getCaps(); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset); float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse; </s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset); vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.); </s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1; </s> add int index{X} = -1; </s> remove if (!this._frustumLength) { this._frustumLength = camera.maxZ; </s> add if (!this._shadowMaxZ) { this._shadowMaxZ = camera.maxZ; </s> remove let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius); </s> add let minx = -bs.radius, miny = -bs.radius, minz = 0; let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius; // Try to tighten minZ and maxZ based on the bounding box of the shadow casters const boundingInfo = this._shadowCastersBoundingInfo; boundingInfo.update(this._viewMatrix[mapIndex]); maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z); if (!this.depthClamp) { // If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z); } else { // If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map) minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z); } this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz); this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz); let OrthoMatrix; if (this._scene.useRightHandedSystem) { OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz); } else { OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz); } </s> remove let breaks = this._frustumSplit(this.cascades, camera.minZ, this._frustumLength, this._lambda); </s> add let breaks = this._frustumSplit();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
const lightSizeUVCorrection: Array<number> = [], depthCorrection: Array<number> = []; for (let i = 0; i < this._cascades; ++i) { lightSizeUVCorrection.push(i === 0 || !this.lightSizeCorrection ? 1 : (this._lightMaxExtents[0].x - this._lightMinExtents[0].x) / (this._lightMaxExtents[i].x - this._lightMinExtents[i].x)); // x correction lightSizeUVCorrection.push(i === 0 || !this.lightSizeCorrection ? 1 : (this._lightMaxExtents[0].y - this._lightMinExtents[0].y) / (this._lightMaxExtents[i].y - this._lightMinExtents[i].y)); // y correction depthCorrection.push(i === 0 || !this.depthCorrection ? 1 : (this._lightMaxExtents[i].z - this._lightMinExtents[i].z) / (this._lightMaxExtents[0].z - this._lightMinExtents[0].z)); }
<mask> const width = shadowMap.getSize().width; <mask> <mask> effect.setMatrices("lightMatrix" + lightIndex, this._transformMatricesAsArray); <mask> effect.setArray("viewFrustumZ" + lightIndex, this._viewSpaceFrustumsZ); <mask> effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage); <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove effect.setFloat("splitBlendFactor" + lightIndex, this.splitBlendPercentage === 0 ? 10000 : 1 / this.splitBlendPercentage); </s> add effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage); </s> remove "splitBlendFactor" + lightIndex, </s> add "cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex, </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage);
<mask> const width = shadowMap.getSize().width; <mask> <mask> effect.setMatrices("lightMatrix" + lightIndex, this._transformMatricesAsArray); <mask> effect.setArray("viewFrustumZ" + lightIndex, this._viewSpaceFrustumsZ); <mask> effect.setFloat("splitBlendFactor" + lightIndex, this.splitBlendPercentage === 0 ? 10000 : 1 / this.splitBlendPercentage); <mask> <mask> // Only PCF uses depth stencil texture. <mask> if (this._filter === CascadedShadowGenerator.FILTER_PCF) { <mask> effect.setDepthStencilTexture("shadowSampler" + lightIndex, shadowMap); <mask> light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove "splitBlendFactor" + lightIndex, </s> add "cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex, </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
effect.setArray2("lightSizeUVCorrection" + lightIndex, lightSizeUVCorrection); effect.setArray("depthCorrection" + lightIndex, depthCorrection); effect.setFloat("penumbraDarkness" + lightIndex, this.penumbraDarkness);
<mask> light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), width, 1 / width, this.frustumEdgeFalloff, lightIndex); <mask> } else if (this._filter === CascadedShadowGenerator.FILTER_PCSS) { <mask> effect.setDepthStencilTexture("shadowSampler" + lightIndex, shadowMap); <mask> effect.setTexture("depthSampler" + lightIndex, shadowMap); <mask> light._uniformBuffer.updateFloat4("shadowsInfo", this.getDarkness(), 1 / width, this._contactHardeningLightSizeUVRatio * width, this.frustumEdgeFalloff, lightIndex); <mask> } <mask> else { <mask> effect.setTexture("shadowSampler" + lightIndex, shadowMap); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove effect.setFloat("splitBlendFactor" + lightIndex, this.splitBlendPercentage === 0 ? 10000 : 1 / this.splitBlendPercentage); </s> add effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage); </s> remove "splitBlendFactor" + lightIndex, </s> add "cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex, </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2); fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2); fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); </s> remove farx = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._frustumLength * Math.tan(camera.fov / 2); </s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera); fary = this._shadowMaxZ * Math.tan(camera.fov / 2);
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
if (this._freezeShadowCastersBoundingInfoObservable) { this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable); this._freezeShadowCastersBoundingInfoObservable = null; }
<mask> this.onBeforeShadowMapRenderMeshObservable.clear(); <mask> this.onBeforeShadowMapRenderObservable.clear(); <mask> this.onAfterShadowMapRenderMeshObservable.clear(); <mask> this.onAfterShadowMapRenderObservable.clear(); <mask> } <mask> <mask> /** <mask> * Serializes the shadow generator setup to a json object. <mask> * @returns The serialized JSON object <mask> */ </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove r.push(1); </s> add </s> remove return this._frustumLength; </s> add return this._shadowMaxZ; </s> remove public get frustumLength(): number { </s> add public get shadowMaxZ(): number { </s> remove public set frustumLength(value: number) { </s> add public set shadowMaxZ(value: number) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Lights/Shadows/cascadedShadowGenerator.ts
"cascadeBlendFactor" + lightIndex, "lightSizeUVCorrection" + lightIndex, "depthCorrection" + lightIndex, "penumbraDarkness" + lightIndex,
<mask> samplersList.push("depthSampler" + lightIndex); <mask> <mask> uniformsList.push( <mask> "viewFrustumZ" + lightIndex, <mask> "splitBlendFactor" + lightIndex, <mask> ); <mask> <mask> if (projectedLightTexture) { <mask> samplersList.push("projectionLightSampler" + lightIndex); <mask> uniformsList.push( </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove effect.setFloat("splitBlendFactor" + lightIndex, this.splitBlendPercentage === 0 ? 10000 : 1 / this.splitBlendPercentage); </s> add effect.setFloat("cascadeBlendFactor" + lightIndex, this.cascadeBlendPercentage === 0 ? 10000 : 1 / this.cascadeBlendPercentage); </s> remove r.push(0); for (let i = 1; i < amount; i++) { r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]); </s> add r.push(minDistance); for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) { const p = (cascadeIndex + 1) / this._cascades, log = minZ * (ratio ** p), uniform = minZ + range * p; const d = this._lambda * (log - uniform) + uniform; r.push((d - near) / cameraRange); </s> remove blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r; </s> add blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Materials/materialHelper.ts
int index{X} = -1;
<mask> ); <mask> vec3 shadowDebug{X}; <mask> #endif <mask> <mask> int index{X} = SHADOWCSMNUM_CASCADES{X} - 1; <mask> <mask> float diff{X} = 0.; <mask> float frustrumLength{X} = 0.; <mask> float previousFrustrumMax{X} = 0.; <mask> for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) { </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) { </s> add for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) { </s> remove if (diff{X} >= 0.){ </s> add if (diff{X} >= 0.) { </s> remove nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r; </s> add blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r; </s> remove r.push(1); return r; } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) {
<mask> <mask> float diff{X} = 0.; <mask> float frustrumLength{X} = 0.; <mask> float previousFrustrumMax{X} = 0.; <mask> for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) { <mask> diff{X} = viewFrustumZ{X}[i] - vPositionFromCamera{X}.z; <mask> frustrumLength{X} = viewFrustumZ{X}[i] - previousFrustrumMax{X}; <mask> previousFrustrumMax{X} = viewFrustumZ{X}[i]; <mask> <mask> if (diff{X} >= 0.){ </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove if (diff{X} >= 0.){ </s> add if (diff{X} >= 0.) { </s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1; </s> add int index{X} = -1; </s> remove blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r; </s> add blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r; </s> remove r.push(1); return r; } </s> add </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
if (diff{X} >= 0.) {
<mask> diff{X} = viewFrustumZ{X}[i] - vPositionFromCamera{X}.z; <mask> frustrumLength{X} = viewFrustumZ{X}[i] - previousFrustrumMax{X}; <mask> previousFrustrumMax{X} = viewFrustumZ{X}[i]; <mask> <mask> if (diff{X} >= 0.){ <mask> index{X} = i; <mask> break; <mask> } <mask> } <mask> </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) { </s> add for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) { </s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1; </s> add int index{X} = -1; </s> remove private _logarithmicSplit(amount: number, near: number, far: number): Array<number> { let r = []; for (let i = 1; i < amount; i++) { r.push((near * (far / near) ** (i / amount) - near) / (far - near)); } r.push(1); return r; } </s> add const near = camera.minZ, far = camera.maxZ, cameraRange = far - near, minDistance = 0, maxDistance = this._shadowMaxZ < far && this._shadowMaxZ >= near ? (this._shadowMaxZ - near) / (far - near) : 1; const minZ = near + minDistance * cameraRange, maxZ = near + maxDistance * cameraRange; const range = maxZ - minZ, ratio = maxZ / minZ; </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove private _frustumSplit(amount: number, near: number, far: number, lambda: number): Array<number> { let log = this._logarithmicSplit(amount, near, far); let uni = this._uniformSplit(amount, near, far); </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
if (index{X} >= 0) {
<mask> break; <mask> } <mask> } <mask> <mask> #if defined(SHADOWPCF{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #elif defined(SHADOWPCSS{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #else <mask> shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> <mask> #ifdef SHADOWCSMDEBUG{X} <mask> shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; <mask> #endif <mask> <mask> float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; <mask> if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) <mask> { <mask> index{X} += 1; <mask> float nextShadow = 0.; <mask> #if defined(SHADOWPCF{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> index{X} += 1; <mask> float nextShadow = 0.; <mask> #if defined(SHADOWPCF{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #if defined(SHADOWPCF{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #elif defined(SHADOWPCSS{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #elif defined(SHADOWPCSS{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove nextShadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
<mask> nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #elif defined(SHADOWPCSS{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx
shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
<mask> #elif defined(SHADOWPCSS{X}) <mask> #if defined(SHADOWLOWQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #elif defined(SHADOWMEDIUMQUALITY{X}) <mask> nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #else <mask> nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); <mask> #endif <mask> #else <mask> nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> More updates (notably PCSS support) Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X}); </s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> remove #if defined(SHADOWPCF{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #elif defined(SHADOWPCSS{X}) #if defined(SHADOWLOWQUALITY{X}) shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #elif defined(SHADOWMEDIUMQUALITY{X}) shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #else shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #else shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); #endif #ifdef SHADOWCSMDEBUG{X} shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}]; #endif float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X}; if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.) { index{X} += 1; float nextShadow = 0.; </s> add if (index{X} >= 0) { </s> remove nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w); </s> add shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c
src/Shaders/ShadersInclude/lightFragment.fx