@babylonjs/core 7.33.0 → 7.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cameras/arcRotateCamera.d.ts +14 -0
- package/Cameras/arcRotateCamera.js +39 -19
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +2 -0
- package/Decorators/nodeDecorator.js +1 -0
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +63 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +150 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +3 -47
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +2 -129
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.d.ts +40 -0
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js +98 -0
- package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -3
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +3 -2
- package/FrameGraph/Node/Blocks/index.js +3 -2
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Passes/renderPass.js +1 -1
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +21 -0
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +110 -0
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +6 -0
- package/FrameGraph/frameGraph.js +15 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -2
- package/FrameGraph/frameGraphRenderContext.js +9 -4
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.js +5 -1
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +8 -0
- package/FrameGraph/frameGraphTextureManager.js +51 -7
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +2 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +3 -2
- package/FrameGraph/index.js +3 -2
- package/FrameGraph/index.js.map +1 -1
- package/Layers/layer.d.ts +4 -0
- package/Layers/layer.js +13 -2
- package/Layers/layer.js.map +1 -1
- package/Loading/sceneLoader.d.ts +11 -8
- package/Loading/sceneLoader.js +64 -35
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +12 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js +6 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +9 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/index.d.ts +2 -0
- package/Materials/Node/Blocks/GaussianSplatting/index.js +3 -0
- package/Materials/Node/Blocks/GaussianSplatting/index.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +10 -3
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +7 -2
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/abstractMesh.hotSpot.js +2 -0
- package/Meshes/abstractMesh.hotSpot.js.map +1 -1
- package/Meshes/csg2.js +0 -3
- package/Meshes/csg2.js.map +1 -1
- package/Misc/webRequest.fetch.d.ts +16 -0
- package/Misc/webRequest.fetch.js +33 -0
- package/Misc/webRequest.fetch.js.map +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/index.d.ts +2 -0
- package/PostProcesses/RenderPipeline/Pipelines/index.js +2 -0
- package/PostProcesses/RenderPipeline/Pipelines/index.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.d.ts +6 -8
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +32 -49
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
- package/PostProcesses/thinTAAPostProcess.d.ts +72 -0
- package/PostProcesses/thinTAAPostProcess.js +149 -0
- package/PostProcesses/thinTAAPostProcess.js.map +1 -0
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +3 -3
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +7 -7
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +70 -69
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +102 -112
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +8 -6
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/geometry.vertex.js +1 -1
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/layer.fragment.js +3 -1
- package/Shaders/layer.fragment.js.map +1 -1
- package/Shaders/volumetricLightScattering.fragment.js +1 -1
- package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +47 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.d.ts +7 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +20 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.d.ts +7 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.js +13 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.js +10 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.fragment.d.ts +10 -0
- package/ShadersWGSL/gaussianSplatting.fragment.js +23 -0
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.vertex.d.ts +14 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js +31 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -0
- package/ShadersWGSL/geometry.vertex.js +1 -1
- package/ShadersWGSL/geometry.vertex.js.map +1 -1
- package/ShadersWGSL/layer.fragment.js +4 -2
- package/ShadersWGSL/layer.fragment.js.map +1 -1
- package/ShadersWGSL/taa.fragment.d.ts +5 -0
- package/ShadersWGSL/taa.fragment.js +11 -0
- package/ShadersWGSL/taa.fragment.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplatting.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplatting.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"gaussianSplatting\";\nconst shader = `fn getDataUV(index: f32,dataTextureSize: vec2f)->vec2<f32> {let y: f32=floor(index/dataTextureSize.x);let x: f32=index-y*dataTextureSize.x;return vec2f((x+0.5),(y+0.5));}\nstruct Splat {center: vec4f,\ncolor: vec4f,\ncovA: vec4f,\ncovB: vec4f,};fn readSplat(splatIndex: f32,dataTextureSize: vec2f)->Splat {var splat: Splat;let splatUV=getDataUV(splatIndex,dataTextureSize);let splatUVi32=vec2<i32>(i32(splatUV.x),i32(splatUV.y));splat.center=textureLoad(centersTexture,splatUVi32,0);splat.color=textureLoad(colorsTexture,splatUVi32,0);splat.covA=textureLoad(covariancesATexture,splatUVi32,0)*splat.center.w;splat.covB=textureLoad(covariancesBTexture,splatUVi32,0)*splat.center.w;return splat;}\nfn gaussianSplatting(\nmeshPos: vec2<f32>,\nworldPos: vec3<f32>,\nscale: vec2<f32>,\ncovA: vec3<f32>,\ncovB: vec3<f32>,\nworldMatrix: mat4x4<f32>,\nviewMatrix: mat4x4<f32>,\nprojectionMatrix: mat4x4<f32>,\nfocal: vec2f,\ninvViewport: vec2f\n)->vec4f {let modelView=viewMatrix*worldMatrix;let camspace=viewMatrix*vec4f(worldPos,1.0);let pos2d=projectionMatrix*camspace;let bounds=1.2*pos2d.w;if (pos2d.z<0. || pos2d.x<-bounds || pos2d.x>bounds || pos2d.y<-bounds || pos2d.y>bounds) {return vec4f(0.0,0.0,2.0,1.0);}\nlet Vrk=mat3x3<f32>(\ncovA.x,covA.y,covA.z,\ncovA.y,covB.x,covB.y,\ncovA.z,covB.y,covB.z\n);let J=mat3x3<f32>(\nfocal.x/camspace.z,0.0,-(focal.x*camspace.x)/(camspace.z*camspace.z),\n0.0,focal.y/camspace.z,-(focal.y*camspace.y)/(camspace.z*camspace.z),\n0.0,0.0,0.0\n);let invy=mat3x3<f32>(\n1.0,0.0,0.0,\n0.0,-1.0,0.0,\n0.0,0.0,1.0\n);let T=invy*transpose(mat3x3<f32>(\nmodelView[0].xyz,\nmodelView[1].xyz,\nmodelView[2].xyz))*J;let cov2d=transpose(T)*Vrk*T;let mid=(cov2d[0][0]+cov2d[1][1])/2.0;let radius=length(vec2<f32>((cov2d[0][0]-cov2d[1][1])/2.0,cov2d[0][1]));let lambda1=mid+radius;let lambda2=mid-radius;if (lambda2<0.0) {return vec4f(0.0,0.0,2.0,1.0);}\nlet diagonalVector=normalize(vec2<f32>(cov2d[0][1],lambda1-cov2d[0][0]));let majorAxis=min(sqrt(2.0*lambda1),1024.0)*diagonalVector;let minorAxis=min(sqrt(2.0*lambda2),1024.0)*vec2<f32>(diagonalVector.y,-diagonalVector.x);let vCenter=vec2<f32>(pos2d.x,pos2d.y);return vec4f(\nvCenter+((meshPos.x*majorAxis+meshPos.y*minorAxis)*invViewport*pos2d.w)*scale,\npos2d.z,\npos2d.w\n);}\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
import "./logDepthFragment.js";
|
|
4
|
+
import "./fogFragment.js";
|
|
5
|
+
const name = "gaussianSplattingFragmentDeclaration";
|
|
6
|
+
const shader = `fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f
|
|
7
|
+
{var A : f32=-dot(inPosition,inPosition);if (A>-4.0)
|
|
8
|
+
{var B: f32=exp(A)*inColor.a;
|
|
9
|
+
#include<logDepthFragment>
|
|
10
|
+
var color: vec3f=inColor.rgb;
|
|
11
|
+
#ifdef FOG
|
|
12
|
+
#include<fogFragment>
|
|
13
|
+
#endif
|
|
14
|
+
return vec4f(color,B);} else {return vec4f(0.0);}}
|
|
15
|
+
`;
|
|
16
|
+
// Sideeffect
|
|
17
|
+
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const gaussianSplattingFragmentDeclarationWGSL = { name, shader };
|
|
20
|
+
//# sourceMappingURL=gaussianSplattingFragmentDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplattingFragmentDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,eAAe,CAAC;AAEvB,MAAM,IAAI,GAAG,sCAAsC,CAAC;AACpD,MAAM,MAAM,GAAG;;;;;;;;;CASd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wCAAwC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./logDepthFragment\";\nimport \"./fogFragment\";\n\nconst name = \"gaussianSplattingFragmentDeclaration\";\nconst shader = `fn gaussianColor(inColor: vec4f,inPosition: vec2f)->vec4f\n{var A : f32=-dot(inPosition,inPosition);if (A>-4.0)\n{var B: f32=exp(A)*inColor.a;\n#include<logDepthFragment>\nvar color: vec3f=inColor.rgb;\n#ifdef FOG\n#include<fogFragment>\n#endif\nreturn vec4f(color,B);} else {return vec4f(0.0);}}\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingFragmentDeclarationWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
import "./sceneUboDeclaration.js";
|
|
4
|
+
import "./meshUboDeclaration.js";
|
|
5
|
+
const name = "gaussianSplattingUboDeclaration";
|
|
6
|
+
const shader = `#include<sceneUboDeclaration>
|
|
7
|
+
#include<meshUboDeclaration>
|
|
8
|
+
attribute position: vec2f;`;
|
|
9
|
+
// Sideeffect
|
|
10
|
+
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const gaussianSplattingUboDeclarationWGSL = { name, shader };
|
|
13
|
+
//# sourceMappingURL=gaussianSplattingUboDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplattingUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplattingUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAE9B,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;2BAEY,CAAC;AAC5B,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneUboDeclaration\";\nimport \"./meshUboDeclaration\";\n\nconst name = \"gaussianSplattingUboDeclaration\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\nattribute position: vec2f;`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingUboDeclarationWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
const name = "gaussianSplattingVertexDeclaration";
|
|
4
|
+
const shader = `attribute position: vec2f;
|
|
5
|
+
`;
|
|
6
|
+
// Sideeffect
|
|
7
|
+
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const gaussianSplattingVertexDeclarationWGSL = { name, shader };
|
|
10
|
+
//# sourceMappingURL=gaussianSplattingVertexDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplattingVertexDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/gaussianSplattingVertexDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAClD,MAAM,MAAM,GAAG;CACd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"gaussianSplattingVertexDeclaration\";\nconst shader = `attribute position: vec2f;\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexDeclarationWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./ShadersInclude/clipPlaneFragmentDeclaration";
|
|
2
|
+
import "./ShadersInclude/logDepthDeclaration";
|
|
3
|
+
import "./ShadersInclude/fogFragmentDeclaration";
|
|
4
|
+
import "./ShadersInclude/gaussianSplattingFragmentDeclaration";
|
|
5
|
+
import "./ShadersInclude/clipPlaneFragment";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare const gaussianSplattingPixelShaderWGSL: {
|
|
8
|
+
name: string;
|
|
9
|
+
shader: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
|
+
import "./ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
4
|
+
import "./ShadersInclude/logDepthDeclaration.js";
|
|
5
|
+
import "./ShadersInclude/fogFragmentDeclaration.js";
|
|
6
|
+
import "./ShadersInclude/gaussianSplattingFragmentDeclaration.js";
|
|
7
|
+
import "./ShadersInclude/clipPlaneFragment.js";
|
|
8
|
+
const name = "gaussianSplattingPixelShader";
|
|
9
|
+
const shader = `#include<clipPlaneFragmentDeclaration>
|
|
10
|
+
#include<logDepthDeclaration>
|
|
11
|
+
#include<fogFragmentDeclaration>
|
|
12
|
+
varying vColor: vec4f;varying vPosition: vec2f;
|
|
13
|
+
#include<gaussianSplattingFragmentDeclaration>
|
|
14
|
+
@fragment
|
|
15
|
+
fn main(input: FragmentInputs)->FragmentOutputs {
|
|
16
|
+
#include<clipPlaneFragment>
|
|
17
|
+
fragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}
|
|
18
|
+
`;
|
|
19
|
+
// Sideeffect
|
|
20
|
+
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const gaussianSplattingPixelShaderWGSL = { name, shader };
|
|
23
|
+
//# sourceMappingURL=gaussianSplatting.fragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplatting.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,uDAAuD,CAAC;AAC/D,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;CASd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/gaussianSplattingFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\n\nconst name = \"gaussianSplattingPixelShader\";\nconst shader = `#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvarying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplattingFragmentDeclaration>\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#include<clipPlaneFragment>\nfragmentOutputs.color=gaussianColor(input.vColor,input.vPosition);}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./ShadersInclude/sceneUboDeclaration";
|
|
2
|
+
import "./ShadersInclude/meshUboDeclaration";
|
|
3
|
+
import "./ShadersInclude/clipPlaneVertexDeclaration";
|
|
4
|
+
import "./ShadersInclude/fogVertexDeclaration";
|
|
5
|
+
import "./ShadersInclude/logDepthDeclaration";
|
|
6
|
+
import "./ShadersInclude/gaussianSplatting";
|
|
7
|
+
import "./ShadersInclude/clipPlaneVertex";
|
|
8
|
+
import "./ShadersInclude/fogVertex";
|
|
9
|
+
import "./ShadersInclude/logDepthVertex";
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const gaussianSplattingVertexShaderWGSL: {
|
|
12
|
+
name: string;
|
|
13
|
+
shader: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
|
+
import "./ShadersInclude/sceneUboDeclaration.js";
|
|
4
|
+
import "./ShadersInclude/meshUboDeclaration.js";
|
|
5
|
+
import "./ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
6
|
+
import "./ShadersInclude/fogVertexDeclaration.js";
|
|
7
|
+
import "./ShadersInclude/logDepthDeclaration.js";
|
|
8
|
+
import "./ShadersInclude/gaussianSplatting.js";
|
|
9
|
+
import "./ShadersInclude/clipPlaneVertex.js";
|
|
10
|
+
import "./ShadersInclude/fogVertex.js";
|
|
11
|
+
import "./ShadersInclude/logDepthVertex.js";
|
|
12
|
+
const name = "gaussianSplattingVertexShader";
|
|
13
|
+
const shader = `#include<sceneUboDeclaration>
|
|
14
|
+
#include<meshUboDeclaration>
|
|
15
|
+
#include<clipPlaneVertexDeclaration>
|
|
16
|
+
#include<fogVertexDeclaration>
|
|
17
|
+
#include<logDepthDeclaration>
|
|
18
|
+
attribute splatIndex: f32;attribute position: vec2f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;varying vColor: vec4f;varying vPosition: vec2f;
|
|
19
|
+
#include<gaussianSplatting>
|
|
20
|
+
@vertex
|
|
21
|
+
fn main(input : VertexInputs)->FragmentInputs {var splat: Splat=readSplat(input.splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vColor=splat.color;vertexOutputs.vPosition=input.position;vertexOutputs.position=gaussianSplatting(input.position,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport);
|
|
22
|
+
#include<clipPlaneVertex>
|
|
23
|
+
#include<fogVertex>
|
|
24
|
+
#include<logDepthVertex>
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
// Sideeffect
|
|
28
|
+
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const gaussianSplattingVertexShaderWGSL = { name, shader };
|
|
31
|
+
//# sourceMappingURL=gaussianSplatting.vertex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AAEzC,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;CAad,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/meshUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/fogVertexDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/gaussianSplatting\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/fogVertex\";\nimport \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex: f32;attribute position: vec2f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;var covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;varying vColor: vec4f;varying vPosition: vec2f;\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var splat: Splat=readSplat(input.splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);let worldPos: vec4f=mesh.world*vec4f(splat.center.xyz,1.0);vertexOutputs.vColor=splat.color;vertexOutputs.vPosition=input.position;vertexOutputs.position=gaussianSplatting(input.position,worldPos.xyz,vec2f(1.0,1.0),covA,covB,mesh.world,scene.view,scene.projection,uniforms.focal,uniforms.invViewport);\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
|
|
@@ -72,7 +72,7 @@ vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPre
|
|
|
72
72
|
#include<bakedVertexAnimation>
|
|
73
73
|
var worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));
|
|
74
74
|
#ifdef BUMP
|
|
75
|
-
let vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];vertexOutputs.vNormalW=normalUpdated;
|
|
75
|
+
let vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
|
|
76
76
|
#else
|
|
77
77
|
#ifdef NORMAL_WORLDSPACE
|
|
78
78
|
vertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/geometry.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,kDAAkD,CAAC;AAC1D,OAAO,sDAAsD,CAAC;AAC9D,OAAO,gDAAgD,CAAC;AACxD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,6CAA6C,CAAC;AACrD,OAAO,2CAA2C,CAAC;AACnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,8BAA8B,CAAC;AACtC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6BAA6B,CAAC;AAErC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/bonesDeclaration\";\nimport \"./ShadersInclude/bakedVertexAnimationDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobalDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexDeclaration\";\nimport \"./ShadersInclude/instancesDeclaration\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobal\";\nimport \"./ShadersInclude/morphTargetsVertex\";\nimport \"./ShadersInclude/instancesVertex\";\nimport \"./ShadersInclude/bonesVertex\";\nimport \"./ShadersInclude/bakedVertexAnimation\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/bumpVertex\";\n\nconst name = \"geometryVertexShader\";\nconst shader = `#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#include<clipPlaneVertexDeclaration>\nattribute position: vec3f;attribute normal: vec3f;\n#ifdef NEED_UV\nvarying vUV: vec2f;\n#ifdef ALPHATEST\nuniform diffuseMatrix: mat4x4f;\n#endif\n#ifdef BUMP\nuniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f;\n#endif\n#ifdef REFLECTIVITY\nuniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#ifdef BUMP\nvarying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;\n#endif\n#ifdef BUMP\nvarying vNormalW: vec3f;\n#else\nvarying vNormalV: vec3f;\n#endif\nvarying vViewPos: vec4f;\n#if defined(POSITION) || defined(BUMP)\nvarying vPositionW: vec3f;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nuniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));\n#ifdef BUMP\nlet vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];vertexOutputs.vNormalW=normalUpdated;\n#else\n#ifdef NORMAL_WORLDSPACE\nvertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);\n#else\nvertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz);\n#endif\n#endif\nvertexOutputs.vViewPos=scene.view*worldPos;\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvertexOutputs.vPositionW=worldPos.xyz/worldPos.w;\n#endif\nvertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#include<clipPlaneVertex>\n#ifdef NEED_UV\n#ifdef UV1\n#if defined(ALPHATEST) && defined(ALPHATEST_UV1)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=input.uv;\n#endif\n#ifdef BUMP_UV1\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV1\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV1\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef UV2\n#if defined(ALPHATEST) && defined(ALPHATEST_UV2)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=input.uv2;\n#endif\n#ifdef BUMP_UV2\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV2\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV2\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const geometryVertexShaderWGSL = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"geometry.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/geometry.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,kDAAkD,CAAC;AAC1D,OAAO,sDAAsD,CAAC;AAC9D,OAAO,gDAAgD,CAAC;AACxD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,6CAA6C,CAAC;AACrD,OAAO,2CAA2C,CAAC;AACnD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,8BAA8B,CAAC;AACtC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,6BAA6B,CAAC;AAErC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/bonesDeclaration\";\nimport \"./ShadersInclude/bakedVertexAnimationDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobalDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexDeclaration\";\nimport \"./ShadersInclude/instancesDeclaration\";\nimport \"./ShadersInclude/sceneUboDeclaration\";\nimport \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport \"./ShadersInclude/morphTargetsVertexGlobal\";\nimport \"./ShadersInclude/morphTargetsVertex\";\nimport \"./ShadersInclude/instancesVertex\";\nimport \"./ShadersInclude/bonesVertex\";\nimport \"./ShadersInclude/bakedVertexAnimation\";\nimport \"./ShadersInclude/clipPlaneVertex\";\nimport \"./ShadersInclude/bumpVertex\";\n\nconst name = \"geometryVertexShader\";\nconst shader = `#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\n#include<sceneUboDeclaration>\n#include<clipPlaneVertexDeclaration>\nattribute position: vec3f;attribute normal: vec3f;\n#ifdef NEED_UV\nvarying vUV: vec2f;\n#ifdef ALPHATEST\nuniform diffuseMatrix: mat4x4f;\n#endif\n#ifdef BUMP\nuniform bumpMatrix: mat4x4f;varying vBumpUV: vec2f;\n#endif\n#ifdef REFLECTIVITY\nuniform reflectivityMatrix: mat4x4f;uniform albedoMatrix: mat4x4f;varying vReflectivityUV: vec2f;varying vAlbedoUV: vec2f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#ifdef UV2\nattribute uv2: vec2f;\n#endif\n#endif\n#ifdef BUMP\nvarying vWorldView0: vec4f;varying vWorldView1: vec4f;varying vWorldView2: vec4f;varying vWorldView3: vec4f;\n#endif\n#ifdef BUMP\nvarying vNormalW: vec3f;\n#else\nvarying vNormalV: vec3f;\n#endif\nvarying vViewPos: vec4f;\n#if defined(POSITION) || defined(BUMP)\nvarying vPositionW: vec3f;\n#endif\n#if defined(VELOCITY) || defined(VELOCITY_LINEAR)\nuniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;var normalUpdated: vec3f=input.normal;\n#ifdef UV1\nvar uvUpdated: vec2f=input.uv;\n#endif\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f= vec4f(finalWorld* vec4f(positionUpdated,1.0));\n#ifdef BUMP\nlet vWorldView=scene.view*finalWorld;vertexOutputs.vWorldView0=vWorldView[0];vertexOutputs.vWorldView1=vWorldView[1];vertexOutputs.vWorldView2=vWorldView[2];vertexOutputs.vWorldView3=vWorldView[3];let normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#else\n#ifdef NORMAL_WORLDSPACE\nvertexOutputs.vNormalV=normalize((finalWorld* vec4f(normalUpdated,0.0)).xyz);\n#else\nvertexOutputs.vNormalV=normalize(((scene.view*finalWorld)* vec4f(normalUpdated,0.0)).xyz);\n#endif\n#endif\nvertexOutputs.vViewPos=scene.view*worldPos;\n#if (defined(VELOCITY) || defined(VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvertexOutputs.vPositionW=worldPos.xyz/worldPos.w;\n#endif\nvertexOutputs.position=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);\n#include<clipPlaneVertex>\n#ifdef NEED_UV\n#ifdef UV1\n#if defined(ALPHATEST) && defined(ALPHATEST_UV1)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=input.uv;\n#endif\n#ifdef BUMP_UV1\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV1\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV1\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(uvUpdated,1.0,0.0)).xy;\n#endif\n#endif\n#ifdef UV2\n#if defined(ALPHATEST) && defined(ALPHATEST_UV2)\nvertexOutputs.vUV=(uniforms.diffuseMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#else\nvertexOutputs.vUV=input.uv2;\n#endif\n#ifdef BUMP_UV2\nvertexOutputs.vBumpUV=(uniforms.bumpMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#ifdef REFLECTIVITY_UV2\nvertexOutputs.vReflectivityUV=(uniforms.reflectivityMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#ifdef ALBEDO_UV2\nvertexOutputs.vAlbedoUV=(uniforms.albedoMatrix* vec4f(input.uv2,1.0,0.0)).xy;\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const geometryVertexShaderWGSL = { name, shader };\n"]}
|
|
@@ -9,8 +9,10 @@ const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textur
|
|
|
9
9
|
fn main(input: FragmentInputs)->FragmentOutputs {
|
|
10
10
|
#define CUSTOM_FRAGMENT_MAIN_BEGIN
|
|
11
11
|
var baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);
|
|
12
|
-
#
|
|
13
|
-
baseColor=
|
|
12
|
+
#if defined(CONVERT_TO_GAMMA)
|
|
13
|
+
baseColor=toGammaSpace(baseColor);
|
|
14
|
+
#elif defined(CONVERT_TO_LINEAR)
|
|
15
|
+
baseColor=toLinearSpaceVec4(baseColor);
|
|
14
16
|
#endif
|
|
15
17
|
#ifdef ALPHATEST
|
|
16
18
|
if (baseColor.a<0.4)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/layer.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"layer.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/layer.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAE1C,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;EAkBb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/helperFunctions\";\n\nconst name = \"layerPixelShader\";\nconst shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f;\n#include<helperFunctions>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\nvar baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV);\n#if defined(CONVERT_TO_GAMMA)\nbaseColor=toGammaSpace(baseColor);\n#elif defined(CONVERT_TO_LINEAR)\nbaseColor=toLinearSpaceVec4(baseColor);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nfragmentOutputs.color=baseColor*uniforms.color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const layerPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
|
+
const name = "taaPixelShader";
|
|
4
|
+
const shader = `var textureSampler: texture_2d<f32>;var historySampler: texture_2d<f32>;uniform factor: f32;@fragment
|
|
5
|
+
fn main(input: FragmentInputs)->FragmentOutputs {let c=textureLoad(textureSampler,vec2<i32>(fragmentInputs.position.xy),0);let h=textureLoad(historySampler,vec2<i32>(fragmentInputs.position.xy),0);fragmentOutputs.color= mix(h,c,uniforms.factor);}
|
|
6
|
+
`;
|
|
7
|
+
// Sideeffect
|
|
8
|
+
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const taaPixelShaderWGSL = { name, shader };
|
|
11
|
+
//# sourceMappingURL=taa.fragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taa.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/taa.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAC9B,MAAM,MAAM,GAAG;;CAEd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"taaPixelShader\";\nconst shader = `var textureSampler: texture_2d<f32>;var historySampler: texture_2d<f32>;uniform factor: f32;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {let c=textureLoad(textureSampler,vec2<i32>(fragmentInputs.position.xy),0);let h=textureLoad(historySampler,vec2<i32>(fragmentInputs.position.xy),0);fragmentOutputs.color= mix(h,c,uniforms.factor);}\n`;\n// Sideeffect\nShaderStore.ShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const taaPixelShaderWGSL = { name, shader };\n"]}
|