@babylonjs/core 5.53.0 → 5.53.1
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/Animations/animationGroup.js +8 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +3 -0
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +74 -19
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -5
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGL/webGLHardwareTexture.d.ts +3 -1
- package/Engines/WebGL/webGLHardwareTexture.js +19 -7
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +14 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +76 -6
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +20 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +22 -7
- package/Engines/WebGPU/webgpuConstants.js +24 -8
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +0 -3
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +20 -53
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +3 -2
- package/Engines/WebGPU/webgpuTextureHelper.js +33 -14
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.d.ts +3 -2
- package/Engines/WebGPU/webgpuTintWASM.js +10 -8
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/constants.d.ts +12 -0
- package/Engines/constants.js +12 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +128 -72
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +16 -5
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +28 -4
- package/Engines/renderTargetWrapper.js +107 -10
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -6
- package/Engines/thinEngine.js +28 -20
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +25 -8
- package/Engines/webgpuEngine.js +112 -48
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +0 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +4 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +40 -0
- package/Materials/Textures/multiRenderTarget.js +143 -4
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +4 -0
- package/Materials/Textures/renderTargetTexture.js +10 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -2
- package/Materials/Textures/texture.js +1 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +4 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Misc/interfaces/screenshotSize.d.ts +17 -3
- package/Misc/interfaces/screenshotSize.js.map +1 -1
- package/Misc/screenshotTools.d.ts +2 -2
- package/Misc/screenshotTools.js +49 -9
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.d.ts +1 -1
- package/Misc/textureTools.js +4 -2
- package/Misc/textureTools.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.d.ts +5 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js +7 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipelineManager.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -23
- package/PostProcesses/depthOfFieldMergePostProcess.js +0 -5
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -0
- package/PostProcesses/postProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +1 -0
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +3 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +2 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +2 -0
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Shaders/default.fragment.js +1 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js +10 -5
- package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
- package/Shaders/fluidRenderingRender.fragment.js +3 -3
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -1
- package/Shaders/motionBlur.fragment.js +8 -2
- package/Shaders/motionBlur.fragment.js.map +1 -1
- package/Shaders/screenSpaceReflection2.fragment.js +11 -4
- package/Shaders/screenSpaceReflection2.fragment.js.map +1 -1
- package/Shaders/screenSpaceReflection2Blur.fragment.js +6 -1
- package/Shaders/screenSpaceReflection2Blur.fragment.js.map +1 -1
- package/Shaders/ssao2.fragment.js +1 -0
- package/Shaders/ssao2.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js +9 -9
- package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bonesVertex.js +16 -16
- package/ShadersWGSL/ShadersInclude/bonesVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js +6 -6
- package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js +6 -6
- package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/instancesVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/instancesVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +8 -8
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/default.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,6CAA6C,CAAC;AACrD,OAAO,wCAAwC,CAAC;AAChD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,2CAA2C,CAAC;AACnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,2CAA2C,CAAC;AACnD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,0CAA0C,CAAC;AAClD,OAAO,2CAA2C,CAAC;AACnD,OAAO,6CAA6C,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,wCAAwC,CAAC;AAChD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,+BAA+B,CAAC;AACvC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AACvC,OAAO,gCAAgC,CAAC;AACxC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAEtC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Vd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/defaultFragmentDeclaration\";\nimport \"./ShadersInclude/defaultUboDeclaration\";\nimport \"./ShadersInclude/prePassDeclaration\";\nimport \"./ShadersInclude/oitDeclaration\";\nimport \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/lightFragmentDeclaration\";\nimport \"./ShadersInclude/lightUboDeclaration\";\nimport \"./ShadersInclude/lightsFragmentFunctions\";\nimport \"./ShadersInclude/shadowsFragmentFunctions\";\nimport \"./ShadersInclude/samplerFragmentDeclaration\";\nimport \"./ShadersInclude/fresnelFunction\";\nimport \"./ShadersInclude/reflectionFunction\";\nimport \"./ShadersInclude/imageProcessingDeclaration\";\nimport \"./ShadersInclude/imageProcessingFunctions\";\nimport \"./ShadersInclude/bumpFragmentMainFunctions\";\nimport \"./ShadersInclude/bumpFragmentFunctions\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\nimport \"./ShadersInclude/bumpFragment\";\nimport \"./ShadersInclude/decalFragment\";\nimport \"./ShadersInclude/depthPrePass\";\nimport \"./ShadersInclude/lightFragment\";\nimport \"./ShadersInclude/logDepthFragment\";\nimport \"./ShadersInclude/fogFragment\";\nimport \"./ShadersInclude/oitFragment\";\n\nconst name = \"defaultPixelShader\";\nconst shader = `#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#define RECIPROCAL_PI2 0.15915494\nvarying vec3 vPositionW;\r#ifdef NORMAL\nvarying vec3 vNormalW;\r#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\r#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\r#else\nuniform sampler2D refraction2DSampler;\r#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\r#else\nuniform sampler2D reflection2DSampler;\r#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\r#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\r#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\r#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\rvec4 baseColor=vec4(1.,1.,1.,1.);\rvec3 diffuseColor=vDiffuseColor.rgb;\rfloat alpha=vDiffuseColor.a;\r#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\r#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\r#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\r#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\r#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\rdiscard;\r#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\r#endif\n#ifdef DECAL\nvec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);\r#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\r#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvec3 baseAmbientColor=vec3(1.,1.,1.);\r#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\r#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\rvec3 specularColor=vSpecularColor.rgb;\r#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\rspecularColor=specularMapColor.rgb;\r#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\r#endif\n#endif\n#else\nfloat glossiness=0.;\r#endif\nvec3 diffuseBase=vec3(0.,0.,0.);\rlightingInfo info;\r#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\r#endif\nfloat shadow=1.;\r#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\r#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\r#endif\nlightmapColor.rgb*=vLightmapInfos.y;\r#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec4 refractionColor=vec4(0.,0.,0.,1.);\r#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\r#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);\r#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\rif (dot(refractionVector,viewDirectionW)<1.0) {\rrefractionColor=textureCube(refractionCubeSampler,refractionVector);\r}\r#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\rvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\rrefractionCoords.y=1.0-refractionCoords.y;\rrefractionColor=texture2D(refraction2DSampler,refractionCoords);\r#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\r#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\r#endif\nrefractionColor.rgb*=vRefractionInfos.x;\r#endif\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\r#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\r#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW.z*=-1.0;\r#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\r#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\r#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\r#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\r#endif\n#else\nvec2 coords=vReflectionUVW.xy;\r#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\r#endif\ncoords.y=1.0-coords.y;\rreflectionColor=texture2D(reflection2DSampler,coords);\r#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\r#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\r#endif\nreflectionColor.rgb*=vReflectionInfos.x;\r#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\r#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\rrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\r#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\r#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\ralpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\r#else\nalpha*=opacityMap.a*vOpacityInfos.y;\r#endif\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\r#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\ralpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\r#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\rdiscard;\r#endif\n#ifndef ALPHABLEND\nalpha=1.0;\r#endif\n#endif\nvec3 emissiveColor=vEmissiveColor;\r#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\r#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\remissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\r#endif\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\rdiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\r#endif\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\r#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\r#endif\n#else\nvec3 finalSpecular=vec3(0.0);\r#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\r#endif\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\r#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\r#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\r#else\ncolor.rgb+=lightmapColor.rgb;\r#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\r#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\r#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\rcolor=applyImageProcessing(color);\r#endif\n#endif\ncolor.a*=visibility;\r#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\r#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nfloat writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;\rgl_FragData[0]=color; \r#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);\r#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\rvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\rvec2 velocity=abs(a-b);\rvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\rgl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\r#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_DEPTH\ngl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_NORMAL\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); \r#endif\n#ifdef PREPASS_ALBEDO_SQRT\ngl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULARTERM)\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; \r#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo;\r#endif\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0)*writeGeometryInfo;\r#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\r#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {\rfrontColor.rgb+=color.rgb*color.a*alphaMultiplier;\rfrontColor.a=1.0-alphaMultiplier*(1.0-color.a);\r} else {\rbackColor+=color;\r}\r#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const defaultPixelShader = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"default.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/default.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,6CAA6C,CAAC;AACrD,OAAO,wCAAwC,CAAC;AAChD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,2CAA2C,CAAC;AACnD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,2CAA2C,CAAC;AACnD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,0CAA0C,CAAC;AAClD,OAAO,2CAA2C,CAAC;AACnD,OAAO,6CAA6C,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,6CAA6C,CAAC;AACrD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,wCAAwC,CAAC;AAChD,OAAO,+CAA+C,CAAC;AACvD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,yCAAyC,CAAC;AACjD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,+BAA+B,CAAC;AACvC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AACvC,OAAO,gCAAgC,CAAC;AACxC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAEtC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgWd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/defaultFragmentDeclaration\";\nimport \"./ShadersInclude/defaultUboDeclaration\";\nimport \"./ShadersInclude/prePassDeclaration\";\nimport \"./ShadersInclude/oitDeclaration\";\nimport \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/lightFragmentDeclaration\";\nimport \"./ShadersInclude/lightUboDeclaration\";\nimport \"./ShadersInclude/lightsFragmentFunctions\";\nimport \"./ShadersInclude/shadowsFragmentFunctions\";\nimport \"./ShadersInclude/samplerFragmentDeclaration\";\nimport \"./ShadersInclude/fresnelFunction\";\nimport \"./ShadersInclude/reflectionFunction\";\nimport \"./ShadersInclude/imageProcessingDeclaration\";\nimport \"./ShadersInclude/imageProcessingFunctions\";\nimport \"./ShadersInclude/bumpFragmentMainFunctions\";\nimport \"./ShadersInclude/bumpFragmentFunctions\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport \"./ShadersInclude/logDepthDeclaration\";\nimport \"./ShadersInclude/fogFragmentDeclaration\";\nimport \"./ShadersInclude/clipPlaneFragment\";\nimport \"./ShadersInclude/bumpFragment\";\nimport \"./ShadersInclude/decalFragment\";\nimport \"./ShadersInclude/depthPrePass\";\nimport \"./ShadersInclude/lightFragment\";\nimport \"./ShadersInclude/logDepthFragment\";\nimport \"./ShadersInclude/fogFragment\";\nimport \"./ShadersInclude/oitFragment\";\n\nconst name = \"defaultPixelShader\";\nconst shader = `#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#define RECIPROCAL_PI2 0.15915494\nvarying vec3 vPositionW;\r#ifdef NORMAL\nvarying vec3 vNormalW;\r#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\r#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\r#else\nuniform sampler2D refraction2DSampler;\r#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\r#else\nuniform sampler2D reflection2DSampler;\r#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\r#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\r#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\r#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\rvec4 baseColor=vec4(1.,1.,1.,1.);\rvec3 diffuseColor=vDiffuseColor.rgb;\rfloat alpha=vDiffuseColor.a;\r#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\r#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\r#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\r#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\r#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\rdiscard;\r#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\r#endif\n#ifdef DECAL\nvec4 decalColor=texture2D(decalSampler,vDecalUV+uvOffset);\r#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\r#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvec3 baseAmbientColor=vec3(1.,1.,1.);\r#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\r#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\rvec3 specularColor=vSpecularColor.rgb;\r#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\rspecularColor=specularMapColor.rgb;\r#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\r#endif\n#endif\n#else\nfloat glossiness=0.;\r#endif\nvec3 diffuseBase=vec3(0.,0.,0.);\rlightingInfo info;\r#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\r#endif\nfloat shadow=1.;\r#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\r#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\r#endif\nlightmapColor.rgb*=vLightmapInfos.y;\r#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec4 refractionColor=vec4(0.,0.,0.,1.);\r#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\r#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,vRefractionSize,vRefractionPosition);\r#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\rvec4 refractionLookup=textureCube(refractionCubeSampler,refractionVector);\rif (dot(refractionVector,viewDirectionW)<1.0) {\rrefractionColor=refractionLookup;\r}\r#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\rvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\rrefractionCoords.y=1.0-refractionCoords.y;\rrefractionColor=texture2D(refraction2DSampler,refractionCoords);\r#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\r#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\r#endif\nrefractionColor.rgb*=vRefractionInfos.x;\r#endif\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\r#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\r#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW.z*=-1.0;\r#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\r#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\r#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\r#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\r#endif\n#else\nvec2 coords=vReflectionUVW.xy;\r#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\r#endif\ncoords.y=1.0-coords.y;\rreflectionColor=texture2D(reflection2DSampler,coords);\r#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\r#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\r#endif\nreflectionColor.rgb*=vReflectionInfos.x;\r#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\r#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\r#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\rrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\r#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\r#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\ralpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\r#else\nalpha*=opacityMap.a*vOpacityInfos.y;\r#endif\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\r#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\ralpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\r#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\rdiscard;\r#endif\n#ifndef ALPHABLEND\nalpha=1.0;\r#endif\n#endif\nvec3 emissiveColor=vEmissiveColor;\r#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\r#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\remissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\r#endif\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\rdiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\r#endif\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\r#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\r#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\r#endif\n#else\nvec3 finalSpecular=vec3(0.0);\r#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\r#endif\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\r#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\r#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\r#else\ncolor.rgb+=lightmapColor.rgb;\r#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\r#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\r#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\rcolor=applyImageProcessing(color);\r#endif\n#endif\ncolor.a*=visibility;\r#ifdef PREMULTIPLYALPHA\ncolor.rgb*=color.a;\r#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nfloat writeGeometryInfo=color.a>0.4 ? 1.0 : 0.0;\rgl_FragData[0]=color; \r#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);\r#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\rvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\rvec2 velocity=abs(a-b);\rvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\rgl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\r#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_DEPTH\ngl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_NORMAL\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo); \r#endif\n#ifdef PREPASS_ALBEDO_SQRT\ngl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(0.0,0.0,0.0,writeGeometryInfo); \r#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULARTERM)\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularMapColor))*writeGeometryInfo; \r#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(toLinearSpace(specularColor),1.0)*writeGeometryInfo;\r#endif\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0)*writeGeometryInfo;\r#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\r#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {\rfrontColor.rgb+=color.rgb*color.a*alphaMultiplier;\rfrontColor.a=1.0-alphaMultiplier*(1.0-color.a);\r} else {\rbackColor+=color;\r}\r#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const defaultPixelShader = { name, shader };\n"]}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
3
|
const name = "depthOfFieldMergePixelShader";
|
|
4
|
-
const shader =
|
|
4
|
+
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
5
|
+
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
|
|
6
|
+
#else
|
|
7
|
+
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
|
|
8
|
+
#endif
|
|
9
|
+
uniform sampler2D textureSampler;
|
|
5
10
|
uniform sampler2D blurStep1;
|
|
6
11
|
#if BLUR_LEVEL>1
|
|
7
12
|
uniform sampler2D blurStep2;
|
|
8
13
|
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
9
|
-
void main(void)
|
|
10
|
-
vec4 original=
|
|
14
|
+
void main(void)
|
|
15
|
+
vec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);
|
|
11
16
|
#if BLUR_LEVEL==1
|
|
12
|
-
if(coc<0.5){
|
|
17
|
+
if(coc<0.5){
|
|
13
18
|
#if BLUR_LEVEL==2
|
|
14
|
-
if(coc<0.33){
|
|
19
|
+
if(coc<0.33){
|
|
15
20
|
}
|
|
16
21
|
// Sideeffect
|
|
17
22
|
ShaderStore.ShadersStore[name] = shader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldMerge.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/depthOfFieldMerge.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"depthOfFieldMerge.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/depthOfFieldMerge.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"depthOfFieldMergePixelShader\";\nconst shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#endif\nuniform sampler2D textureSampler;\rvarying vec2 vUV;\runiform sampler2D circleOfConfusionSampler;\runiform sampler2D blurStep0;\r#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\r#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\r#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\r{\rfloat coc=TEXTUREFUNC(circleOfConfusionSampler,vUV,0.0).r;\r#if BLUR_LEVEL==0\nvec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);\rvec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);\rgl_FragColor=mix(original,blurred0,coc);\r#endif\n#if BLUR_LEVEL==1\nif(coc<0.5){\rvec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);\rvec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);\rgl_FragColor=mix(original,blurred1,coc/0.5);\r}else{\rvec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);\rvec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);\rgl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\r}\r#endif\n#if BLUR_LEVEL==2\nif(coc<0.33){\rvec4 original=TEXTUREFUNC(textureSampler,vUV,0.0);\rvec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);\rgl_FragColor=mix(original,blurred2,coc/0.33);\r}else if(coc<0.66){\rvec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);\rvec4 blurred2=TEXTUREFUNC(blurStep2,vUV,0.0);\rgl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\r}else{\rvec4 blurred0=TEXTUREFUNC(blurStep0,vUV,0.0);\rvec4 blurred1=TEXTUREFUNC(blurStep1,vUV,0.0);\rgl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\r}\r#endif\n}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const depthOfFieldMergePixelShader = { name, shader };\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
3
|
const name = "fluidRenderingRenderPixelShader";
|
|
4
|
-
const shader =
|
|
4
|
+
const shader = `/* disable_uniformity_analysis */
|
|
5
5
|
#define ETA 1.0/IOR
|
|
6
6
|
#define F0 0.02
|
|
7
7
|
uniform sampler2D textureSampler;
|
|
@@ -35,10 +35,10 @@ if(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || i
|
|
|
35
35
|
#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)
|
|
36
36
|
glFragColor=vec4(normal*0.5+0.5,1.0);
|
|
37
37
|
vec3 rayDir=normalize(viewPos);
|
|
38
|
-
vec3 diffuseColor=
|
|
38
|
+
vec3 diffuseColor=textureLod(diffuseSampler,texCoord,0.0).rgb;
|
|
39
39
|
vec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));
|
|
40
40
|
float diffuse =max(0.0,dot(lightDir,normal))*1.0;
|
|
41
|
-
vec3 refractionDir=refract(rayDir,normal,ETA);
|
|
41
|
+
vec3 refractionDir=refract(rayDir,normal,ETA);
|
|
42
42
|
vec3 reflectionDir=reflect(rayDir,normal);
|
|
43
43
|
vec3 finalColor=refractionColor+specular;
|
|
44
44
|
#ifdef FLUIDRENDERING_VELOCITY
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRenderingRender.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/fluidRenderingRender.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"fluidRenderingRender.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/fluidRenderingRender.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Id,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"fluidRenderingRenderPixelShader\";\nconst shader = `/* disable_uniformity_analysis */\r#define IOR 1.333\n#define ETA 1.0/IOR\n#define F0 0.02\nuniform sampler2D textureSampler;\runiform sampler2D depthSampler;\r#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nuniform sampler2D diffuseSampler;\r#else\nuniform vec3 diffuseColor;\r#endif\n#ifdef FLUIDRENDERING_FIXED_THICKNESS\nuniform float thickness;\runiform sampler2D bgDepthSampler;\r#else\nuniform float minimumThickness;\runiform sampler2D thicknessSampler;\r#endif\n#ifdef FLUIDRENDERING_ENVIRONMENT\nuniform samplerCube reflectionSampler;\r#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nuniform sampler2D debugSampler;\r#endif\nuniform mat4 viewMatrix;\runiform mat4 projectionMatrix;\runiform mat4 invProjectionMatrix;\runiform vec2 texelSize;\runiform vec3 dirLight;\runiform float cameraFar;\runiform float density;\runiform float refractionStrength;\runiform float fresnelClamp;\runiform float specularPower;\rvarying vec2 vUV;\rvec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {\rvec4 ndc;\rndc.xy=texCoord*2.0-1.0;\r#ifdef FLUIDRENDERING_RHS\nndc.z=-projectionMatrix[2].z+projectionMatrix[3].z/depth;\r#else\nndc.z=projectionMatrix[2].z+projectionMatrix[3].z/depth;\r#endif\nndc.w=1.0;\rvec4 eyePos=invProjectionMatrix*ndc;\reyePos.xyz/=eyePos.w;\rreturn eyePos.xyz;\r}\rvec3 getViewPosFromTexCoord(vec2 texCoord) {\rfloat depth=textureLod(depthSampler,texCoord,0.).x;\rreturn computeViewPosFromUVDepth(texCoord,depth);\r}\rvoid main(void) {\rvec2 texCoord=vUV;\r#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_TEXTURE)\nvec4 color=texture2D(debugSampler,texCoord);\r#ifdef FLUIDRENDERING_DEBUG_DEPTH\nglFragColor=vec4(color.rgb/vec3(2.0),1.);\rif (color.r>0.999 && color.g>0.999) {\rglFragColor=texture2D(textureSampler,texCoord);\r}\r#else\nglFragColor=vec4(color.rgb,1.);\rif (color.r<0.001 && color.g<0.001 && color.b<0.001) {\rglFragColor=texture2D(textureSampler,texCoord);\r}\r#endif\nreturn;\r#endif\nvec2 depthVel=textureLod(depthSampler,texCoord,0.).rg;\rfloat depth=depthVel.r;\r#ifndef FLUIDRENDERING_FIXED_THICKNESS\nfloat thickness=texture2D(thicknessSampler,texCoord).x;\r#else\nfloat bgDepth=texture2D(bgDepthSampler,texCoord).x;\rfloat depthNonLinear=projectionMatrix[2].z+projectionMatrix[3].z/depth;\rdepthNonLinear=depthNonLinear*0.5+0.5;\r#endif\nvec3 backColor=texture2D(textureSampler,texCoord).rgb;\r#ifndef FLUIDRENDERING_FIXED_THICKNESS\nif (depth>=cameraFar || depth<=0. || thickness<=minimumThickness) {\r#else\nif (depth>=cameraFar || depth<=0. || bgDepth<=depthNonLinear) {\r#endif\nglFragColor=vec4(backColor,1.);\rreturn;\r}\rvec3 viewPos=computeViewPosFromUVDepth(texCoord,depth);\rvec3 ddx=getViewPosFromTexCoord(texCoord+vec2(texelSize.x,0.))-viewPos;\rvec3 ddy=getViewPosFromTexCoord(texCoord+vec2(0.,texelSize.y))-viewPos;\rvec3 ddx2=viewPos-getViewPosFromTexCoord(texCoord+vec2(-texelSize.x,0.));\rif (abs(ddx.z)>abs(ddx2.z)) {\rddx=ddx2;\r}\rvec3 ddy2=viewPos-getViewPosFromTexCoord(texCoord+vec2(0.,-texelSize.y));\rif (abs(ddy.z)>abs(ddy2.z)) {\rddy=ddy2;\r}\rvec3 normal=normalize(cross(ddy,ddx));\r#ifdef FLUIDRENDERING_RHS\nnormal=-normal;\r#endif\n#ifndef WEBGPU\nif(isnan(normal.x) || isnan(normal.y) || isnan(normal.z) || isinf(normal.x) || isinf(normal.y) || isinf(normal.z)) {\rnormal=vec3(0.,0.,-1.);\r}\r#endif\n#if defined(FLUIDRENDERING_DEBUG) && defined(FLUIDRENDERING_DEBUG_SHOWNORMAL)\nglFragColor=vec4(normal*0.5+0.5,1.0);\rreturn;\r#endif\nvec3 rayDir=normalize(viewPos); \r#ifdef FLUIDRENDERING_DIFFUSETEXTURE\nvec3 diffuseColor=textureLod(diffuseSampler,texCoord,0.0).rgb;\r#endif\nvec3 lightDir=normalize(vec3(viewMatrix*vec4(-dirLight,0.)));\rvec3 H =normalize(lightDir-rayDir);\rfloat specular=pow(max(0.0,dot(H,normal)),specularPower);\r#ifdef FLUIDRENDERING_DEBUG_DIFFUSERENDERING\nfloat diffuse =max(0.0,dot(lightDir,normal))*1.0;\rglFragColor=vec4(vec3(0.1) /*ambient*/+vec3(0.42,0.50,1.00)*diffuse+vec3(0,0,0.2)+specular,1.);\rreturn;\r#endif\nvec3 refractionDir=refract(rayDir,normal,ETA);\rvec3 transmitted=(textureLod(textureSampler,vec2(texCoord+refractionDir.xy*thickness*refractionStrength),0.0).rgb);\rvec3 transmittance=exp(-density*thickness*(1.0-diffuseColor)); \rvec3 refractionColor=transmitted*transmittance;\r#ifdef FLUIDRENDERING_ENVIRONMENT\nvec3 reflectionDir=reflect(rayDir,normal);\rvec3 reflectionColor=(textureCube(reflectionSampler,reflectionDir).rgb);\rfloat fresnel=clamp(F0+(1.0-F0)*pow(1.0-dot(normal,-rayDir),5.0),0.,fresnelClamp);\rvec3 finalColor=mix(refractionColor,reflectionColor,fresnel)+specular;\r#else\nvec3 finalColor=refractionColor+specular;\r#endif\n#ifdef FLUIDRENDERING_VELOCITY\nfloat velocity=depthVel.g;\rfinalColor=mix(finalColor,vec3(1.0),smoothstep(0.3,1.0,velocity/6.0));\r#endif\nglFragColor=vec4(finalColor,1.);\r}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const fluidRenderingRenderPixelShader = { name, shader };\n"]}
|
|
@@ -7,8 +7,14 @@ uniform sampler2D depthSampler;
|
|
|
7
7
|
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
8
8
|
void main(void)
|
|
9
9
|
#ifdef OBJECT_BASED
|
|
10
|
-
vec2 texelSize=1.0/screenSize;
|
|
11
|
-
|
|
10
|
+
vec2 texelSize=1.0/screenSize;
|
|
11
|
+
result+=texture2DLodEXT(textureSampler,offset,0.0);
|
|
12
|
+
result+=texture2D(textureSampler,offset);
|
|
13
|
+
}
|
|
14
|
+
vec2 texelSize=1.0/screenSize;
|
|
15
|
+
result+=texture2DLodEXT(textureSampler,offset1,0.0);
|
|
16
|
+
result+=texture2D(textureSampler,offset1);
|
|
17
|
+
}
|
|
12
18
|
#else
|
|
13
19
|
gl_FragColor=texture2D(textureSampler,vUV);
|
|
14
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionBlur.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/motionBlur.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"motionBlur.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/motionBlur.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,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 = \"motionBlurPixelShader\";\nconst shader = `varying vec2 vUV;\runiform sampler2D textureSampler;\runiform float motionStrength;\runiform float motionScale;\runiform vec2 screenSize;\r#ifdef OBJECT_BASED\nuniform sampler2D velocitySampler;\r#else\nuniform sampler2D depthSampler;\runiform mat4 inverseViewProjection;\runiform mat4 prevViewProjection;\runiform mat4 projection;\r#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\r{\r#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvec2 texelSize=1.0/screenSize;\rvec4 velocityColor=texture2D(velocitySampler,vUV);\rvelocityColor.rg=velocityColor.rg*2.0-vec2(1.0);\rvec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0))*velocityColor.a;\rvelocity*=motionScale*motionStrength;\rfloat speed=length(velocity/texelSize);\rint samplesCount=int(clamp(speed,1.0,SAMPLES));\rvelocity=normalize(velocity)*texelSize;\rfloat hlim=float(-samplesCount)*0.5+0.5;\rvec4 result=texture2D(textureSampler,vUV);\rfor (int i=1; i<int(SAMPLES); ++i)\r{\rif (i>=samplesCount)\rbreak;\rvec2 offset=vUV+velocity*(hlim+float(i));\r#if defined(WEBGPU)\nresult+=texture2DLodEXT(textureSampler,offset,0.0);\r#else\nresult+=texture2D(textureSampler,offset);\r#endif\n}\rgl_FragColor=result/float(samplesCount);\rgl_FragColor.a=1.0;\r#else\nvec2 texelSize=1.0/screenSize;\rfloat depth=texture2D(depthSampler,vUV).r;\rdepth=projection[2].z+projection[3].z/depth; \rvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\rcpos=inverseViewProjection*cpos;\rcpos/=cpos.w;\rvec4 ppos=prevViewProjection*cpos;\rppos/=ppos.w;\rppos.xy=ppos.xy*0.5+0.5;\rvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\rfloat speed=length(velocity/texelSize);\rint nSamples=int(clamp(speed,1.0,SAMPLES));\rvec4 result=texture2D(textureSampler,vUV);\rfor (int i=1; i<int(SAMPLES); ++i) {\rif (i>=nSamples)\rbreak;\rvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\r#if defined(WEBGPU)\nresult+=texture2DLodEXT(textureSampler,offset1,0.0);\r#else\nresult+=texture2D(textureSampler,offset1);\r#endif\n}\rgl_FragColor=result/float(nSamples);\r#endif\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\r#endif\n}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const motionBlurPixelShader = { name, shader };\n"]}
|
|
@@ -3,7 +3,14 @@ import { ShaderStore } from "../Engines/shaderStore.js";
|
|
|
3
3
|
import "./ShadersInclude/helperFunctions.js";
|
|
4
4
|
import "./ShadersInclude/screenSpaceRayTrace.js";
|
|
5
5
|
const name = "screenSpaceReflection2PixelShader";
|
|
6
|
-
const shader =
|
|
6
|
+
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
7
|
+
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
|
|
8
|
+
#define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod)
|
|
9
|
+
#else
|
|
10
|
+
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
|
|
11
|
+
#define TEXTURECUBEFUNC(s,c,bias) textureCube(s,c,bias)
|
|
12
|
+
#endif
|
|
13
|
+
uniform sampler2D textureSampler;
|
|
7
14
|
uniform sampler2D reflectivitySampler;
|
|
8
15
|
uniform sampler2D backDepthSampler;
|
|
9
16
|
#ifdef SSR_USE_ENVIRONMENT_CUBE
|
|
@@ -25,7 +32,7 @@ attenuation*=1.0-(numIterations/maxSteps);
|
|
|
25
32
|
vec3 reflectionNormal=texelFetch(normalSampler,hitPixel,0).xyz;
|
|
26
33
|
return attenuation;
|
|
27
34
|
void main()
|
|
28
|
-
vec4 colorFull=
|
|
35
|
+
vec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);
|
|
29
36
|
gl_FragColor=vec4(0.);
|
|
30
37
|
gl_FragColor=colorFull;
|
|
31
38
|
return;
|
|
@@ -37,7 +44,7 @@ vec4 worldPos=invView*vec4(csPosition,1.0);
|
|
|
37
44
|
wReflectedVector.y*=-1.0;
|
|
38
45
|
#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE
|
|
39
46
|
wReflectedVector.z*=-1.0;
|
|
40
|
-
vec3 envColor=
|
|
47
|
+
vec3 envColor=TEXTURECUBEFUNC(envCubeSampler,wReflectedVector,0.0).xyz;
|
|
41
48
|
envColor=toLinearSpace(envColor);
|
|
42
49
|
#else
|
|
43
50
|
vec3 envColor=color;
|
|
@@ -62,7 +69,7 @@ vec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpe
|
|
|
62
69
|
finalColor=toGammaSpace(finalColor);
|
|
63
70
|
gl_FragColor=vec4(finalColor,colorFull.a);
|
|
64
71
|
#else
|
|
65
|
-
gl_FragColor=
|
|
72
|
+
gl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0);
|
|
66
73
|
}
|
|
67
74
|
// Sideeffect
|
|
68
75
|
ShaderStore.ShadersStore[name] = shader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSpaceReflection2.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/screenSpaceReflection2.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,sCAAsC,CAAC;AAE9C,MAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"screenSpaceReflection2.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/screenSpaceReflection2.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,sCAAsC,CAAC;AAE9C,MAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyNd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport \"./ShadersInclude/helperFunctions\";\nimport \"./ShadersInclude/screenSpaceRayTrace\";\n\nconst name = \"screenSpaceReflection2PixelShader\";\nconst shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#define TEXTURECUBEFUNC(s,c,lod) textureLod(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#define TEXTURECUBEFUNC(s,c,bias) textureCube(s,c,bias)\n#endif\nuniform sampler2D textureSampler;\rvarying vec2 vUV;\r#ifdef SSR_SUPPORTED\nuniform sampler2D reflectivitySampler;\runiform sampler2D normalSampler;\runiform sampler2D depthSampler;\r#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nuniform sampler2D backDepthSampler;\runiform float backSizeFactor;\r#endif\n#ifdef SSR_USE_ENVIRONMENT_CUBE\nuniform samplerCube envCubeSampler;\r#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nuniform vec3 vReflectionPosition;\runiform vec3 vReflectionSize;\r#endif\n#endif\nuniform mat4 view;\runiform mat4 invView;\runiform mat4 projection;\runiform mat4 invProjectionMatrix;\runiform mat4 projectionPixel;\runiform float nearPlaneZ;\runiform float stepSize;\runiform float maxSteps;\runiform float strength;\runiform float thickness;\runiform float roughnessFactor;\runiform float reflectionSpecularFalloffExponent;\runiform float maxDistance;\runiform float selfCollisionNumSkip;\runiform float reflectivityThreshold;\r#include<helperFunctions>\n#include<screenSpaceRayTrace>\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\r{\rreturn F0+(1.0-F0)*pow(1.0-cosTheta,5.0);\r}\rvec3 hash(vec3 a)\r{\ra=fract(a*0.8);\ra+=dot(a,a.yxz+19.19);\rreturn fract((a.xxy+a.yxx)*a.zyx);\r}\rvec3 computeViewPosFromUVDepth(vec2 texCoord,float depth) {\rvec4 ndc;\rndc.xy=texCoord*2.0-1.0;\r#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nndc.z=-projection[2].z-projection[3].z/depth;\r#else\nndc.z=projection[2].z+projection[3].z/depth;\r#endif\nndc.w=1.0;\rvec4 eyePos=invProjectionMatrix*ndc;\reyePos.xyz/=eyePos.w;\rreturn eyePos.xyz;\r}\rfloat computeAttenuationForIntersection(ivec2 hitPixel,vec2 hitUV,vec3 vsRayOrigin,vec3 vsHitPoint,vec3 reflectionVector,float maxRayDistance,float numIterations) {\rfloat attenuation=1.0;\r#ifdef SSR_ATTENUATE_SCREEN_BORDERS\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-hitUV.xy));\rattenuation*=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\r#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_DISTANCE\nattenuation*=1.0-clamp(distance(vsRayOrigin,vsHitPoint)/maxRayDistance,0.0,1.0);\r#endif\n#ifdef SSR_ATTENUATE_INTERSECTION_NUMITERATIONS\nattenuation*=1.0-(numIterations/maxSteps);\r#endif\n#ifdef SSR_ATTENUATE_BACKFACE_REFLECTION\nvec3 reflectionNormal=texelFetch(normalSampler,hitPixel,0).xyz;\rfloat directionBasedAttenuation=smoothstep(-0.17,0.0,dot(reflectionNormal,-reflectionVector));\rattenuation*=directionBasedAttenuation;\r#endif\nreturn attenuation;\r}\r#endif\nvoid main()\r{\r#ifdef SSR_SUPPORTED\nvec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);\rvec3 color=colorFull.rgb;\rvec4 reflectivity=TEXTUREFUNC(reflectivitySampler,vUV,0.0);\rif (max(reflectivity.r,max(reflectivity.g,reflectivity.b))<=reflectivityThreshold) {\r#ifdef SSR_USE_BLUR\ngl_FragColor=vec4(0.);\r#else\ngl_FragColor=colorFull;\r#endif\nreturn;\r}\r#ifdef SSR_INPUT_IS_GAMMA_SPACE\ncolor=toLinearSpace(color);\r#endif\nvec2 texSize=vec2(textureSize(depthSampler,0));\rvec3 csNormal=texelFetch(normalSampler,ivec2(vUV*texSize),0).xyz; \rfloat depth=texelFetch(depthSampler,ivec2(vUV*texSize),0).r;\rvec3 csPosition=computeViewPosFromUVDepth(vUV,depth);\rvec3 csViewDirection=normalize(csPosition);\rvec3 csReflectedVector=reflect(csViewDirection,csNormal);\r#ifdef SSR_USE_ENVIRONMENT_CUBE\nvec3 wReflectedVector=vec3(invView*vec4(csReflectedVector,0.0));\r#ifdef SSR_USE_LOCAL_REFLECTIONMAP_CUBIC\nvec4 worldPos=invView*vec4(csPosition,1.0);\rwReflectedVector=parallaxCorrectNormal(worldPos.xyz,normalize(wReflectedVector),vReflectionSize,vReflectionPosition);\r#endif\n#ifdef SSR_INVERTCUBICMAP\nwReflectedVector.y*=-1.0;\r#endif\n#ifdef SSRAYTRACE_RIGHT_HANDED_SCENE\nwReflectedVector.z*=-1.0;\r#endif\nvec3 envColor=TEXTURECUBEFUNC(envCubeSampler,wReflectedVector,0.0).xyz;\r#ifdef SSR_ENVIRONMENT_CUBE_IS_GAMMASPACE\nenvColor=toLinearSpace(envColor);\r#endif\n#else\nvec3 envColor=color;\r#endif\nfloat reflectionAttenuation=1.0;\rbool rayHasHit=false;\rvec2 startPixel;\rvec2 hitPixel;\rvec3 hitPoint;\rfloat numIterations;\r#ifdef SSRAYTRACE_DEBUG\nvec3 debugColor;\r#endif\n#ifdef SSR_ATTENUATE_FACING_CAMERA\nreflectionAttenuation*=1.0-smoothstep(0.25,0.5,dot(-csViewDirection,csReflectedVector));\r#endif\nif (reflectionAttenuation>0.0) {\r#ifdef SSR_USE_BLUR\nvec3 jitt=vec3(0.);\r#else\nfloat roughness=1.0-reflectivity.a;\rvec3 jitt=mix(vec3(0.0),hash(csPosition),roughness)*roughnessFactor; \r#endif\nvec2 uv2=vUV*texSize;\rfloat c=(uv2.x+uv2.y)*0.25;\rfloat jitter=mod(c,1.0); \rrayHasHit=traceScreenSpaceRay1(\rcsPosition,\rnormalize(csReflectedVector+jitt),\rprojectionPixel,\rdepthSampler,\rtexSize,\r#ifdef SSRAYTRACE_USE_BACK_DEPTHBUFFER\nbackDepthSampler,\rbackSizeFactor,\r#endif\nthickness,\rnearPlaneZ,\rstepSize,\rjitter,\rmaxSteps,\rmaxDistance,\rselfCollisionNumSkip,\rstartPixel,\rhitPixel,\rhitPoint,\rnumIterations\r#ifdef SSRAYTRACE_DEBUG\n,debugColor\r#endif\n);\r}\r#ifdef SSRAYTRACE_DEBUG\ngl_FragColor=vec4(debugColor,1.);\rreturn;\r#endif\nvec3 F0=reflectivity.rgb;\rvec3 fresnel=fresnelSchlick(max(dot(csNormal,-csViewDirection),0.0),F0);\rvec3 SSR=envColor;\rif (rayHasHit) {\rvec3 reflectedColor=texelFetch(textureSampler,ivec2(hitPixel),0).rgb;\r#ifdef SSR_INPUT_IS_GAMMA_SPACE\nreflectedColor=toLinearSpace(reflectedColor);\r#endif\nreflectionAttenuation*=computeAttenuationForIntersection(ivec2(hitPixel),hitPixel/texSize,csPosition,hitPoint,csReflectedVector,maxDistance,numIterations);\rSSR=reflectedColor*reflectionAttenuation+(1.0-reflectionAttenuation)*envColor;\r}\rSSR*=fresnel;\r#ifdef SSR_USE_BLUR\nfloat blur_radius=0.0;\rfloat roughness=1.0-reflectivity.a*(1.0-roughnessFactor);\rif (roughness>0.001) {\rfloat cone_angle=min(roughness,0.999)*3.14159265*0.5;\rfloat cone_len=distance(startPixel,hitPixel);\rfloat op_len=2.0*tan(cone_angle)*cone_len; \rfloat a=op_len;\rfloat h=cone_len;\rfloat a2=a*a;\rfloat fh2=4.0f*h*h;\rblur_radius=(a*(sqrt(a2+fh2)-a))/(4.0f*h);\r}\rgl_FragColor=vec4(SSR,blur_radius/255.0); \r#else\nvec3 reflectionMultiplier=clamp(pow(reflectivity.rgb*strength,vec3(reflectionSpecularFalloffExponent)),0.0,1.0);\rvec3 colorMultiplier=1.0-reflectionMultiplier;\rvec3 finalColor=(color*colorMultiplier)+(SSR*reflectionMultiplier);\r#ifdef SSR_OUTPUT_IS_GAMMA_SPACE\nfinalColor=toGammaSpace(finalColor);\r#endif\ngl_FragColor=vec4(finalColor,colorFull.a);\r#endif\n#else\ngl_FragColor=TEXTUREFUNC(textureSampler,vUV,0.0);\r#endif\n}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const screenSpaceReflection2PixelShader = { name, shader };\n"]}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
3
|
const name = "screenSpaceReflection2BlurPixelShader";
|
|
4
|
-
const shader =
|
|
4
|
+
const shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
5
|
+
#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)
|
|
6
|
+
#else
|
|
7
|
+
#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)
|
|
8
|
+
#endif
|
|
9
|
+
uniform sampler2D textureSampler;
|
|
5
10
|
// Sideeffect
|
|
6
11
|
ShaderStore.ShadersStore[name] = shader;
|
|
7
12
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSpaceReflection2Blur.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/screenSpaceReflection2Blur.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"screenSpaceReflection2Blur.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/screenSpaceReflection2Blur.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,uCAAuC,CAAC;AACrD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,qCAAqC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"screenSpaceReflection2BlurPixelShader\";\nconst shader = `#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)\n#define TEXTUREFUNC(s,c,lod) texture2DLodEXT(s,c,lod)\n#else\n#define TEXTUREFUNC(s,c,bias) texture2D(s,c,bias)\n#endif\nuniform sampler2D textureSampler;\rvarying vec2 vUV;\runiform vec2 texelOffsetScale;\rconst float weights[8]=float[8] (0.071303,0.131514,0.189879,0.321392,0.452906, 0.584419,0.715932,0.847445);\rvoid processSample(vec2 uv,float i,vec2 stepSize,inout vec4 accumulator,inout float denominator)\r{\rvec2 offsetUV=stepSize*i+uv;\rfloat coefficient=weights[int(2.0-abs(i))];\raccumulator+=TEXTUREFUNC(textureSampler,offsetUV,0.0)*coefficient;\rdenominator+=coefficient;\r}\rvoid main()\r{\rvec4 colorFull=TEXTUREFUNC(textureSampler,vUV,0.0);\rif (dot(colorFull,vec4(1.0))==0.0) {\rgl_FragColor=colorFull;\rreturn;\r}\rfloat blurRadius=colorFull.a*255.0; \rvec2 stepSize=texelOffsetScale.xy*blurRadius;\rvec4 accumulator=TEXTUREFUNC(textureSampler,vUV,0.0)*0.214607;\rfloat denominator=0.214607;\rprocessSample(vUV,1.0,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*0.2,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*0.4,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*0.6,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*0.8,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*1.2,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*1.4,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*1.6,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*1.8,stepSize,accumulator,denominator);\rprocessSample(vUV,1.0*2.0,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*0.2,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*0.4,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*0.6,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*0.8,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*1.2,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*1.4,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*1.6,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*1.8,stepSize,accumulator,denominator);\rprocessSample(vUV,-1.0*2.0,stepSize,accumulator,denominator);\rgl_FragColor=vec4(accumulator.rgb/denominator,colorFull.a);\r}\r`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const screenSpaceReflection2BlurPixelShader = { name, shader };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssao2.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/ssao2.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"ssao2.fragment.js","sourceRoot":"","sources":["../../../../lts/core/generated/Shaders/ssao2.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkKd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"ssao2PixelShader\";\nconst shader = `precision highp float;\runiform sampler2D textureSampler;\rvarying vec2 vUV;\r#ifdef SSAO\nfloat scales[16]=float[16](\r0.1,\r0.11406250000000001,\r0.131640625,\r0.15625,\r0.187890625,\r0.2265625,\r0.272265625,\r0.325,\r0.384765625,\r0.4515625,\r0.525390625,\r0.60625,\r0.694140625,\r0.7890625,\r0.891015625,\r1.0\r);\runiform float near;\runiform float radius;\runiform sampler2D depthSampler;\runiform sampler2D randomSampler;\runiform sampler2D normalSampler;\runiform float randTextureTiles;\runiform float samplesFactor;\runiform vec3 sampleSphere[SAMPLES];\runiform float totalStrength;\runiform float base;\runiform float xViewport;\runiform float yViewport;\runiform mat3 depthProjection;\runiform float maxZ;\runiform float minZAspect;\runiform vec2 texelSize;\runiform mat4 projection;\rvoid main()\r{\rvec3 random=textureLod(randomSampler,vUV*randTextureTiles,0.0).rgb;\rfloat depth=textureLod(depthSampler,vUV,0.0).r;\rfloat depthSign=depth/abs(depth);\rdepth=depth*depthSign;\rvec3 normal=textureLod(normalSampler,vUV,0.0).rgb;\rfloat occlusion=0.0;\rfloat correctedRadius=min(radius,minZAspect*depth/near);\rvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\rvec3 vDepthFactor=depthProjection*vec3(1.0,1.0,depth);\rvec3 origin=vViewRay*vDepthFactor;\rvec3 rvec=random*2.0-1.0;\rrvec.z=0.0;\rfloat dotProduct=dot(rvec,normal);\rrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\rvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\rvec3 bitangent=cross(normal,tangent);\rmat3 tbn=mat3(tangent,bitangent,normal);\rfloat difference;\rfor (int i=0; i<SAMPLES; ++i) {\rvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\rsamplePosition=samplePosition*correctedRadius+origin;\rvec4 offset=vec4(samplePosition,1.0);\roffset=projection*offset;\roffset.xyz/=offset.w;\roffset.xy=offset.xy*0.5+0.5;\rif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\rcontinue;\r}\rfloat sampleDepth=abs(textureLod(depthSampler,offset.xy,0.0).r);\rdifference=depthSign*samplePosition.z-sampleDepth;\rfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\rocclusion+=step(EPSILON,difference)*rangeCheck;\r}\rocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\rfloat ao=1.0-totalStrength*occlusion*samplesFactor;\rfloat result=clamp(ao+base,0.0,1.0);\rgl_FragColor=vec4(vec3(result),1.0);\r}\r#endif\n#ifdef BLUR\nuniform float outSize;\runiform float soften;\runiform float tolerance;\runiform int samples;\r#ifndef BLUR_BYPASS\nuniform sampler2D depthSampler;\r#ifdef BLUR_LEGACY\n#define inline\nfloat blur13Bilateral(sampler2D image,vec2 uv,vec2 step) {\rfloat result=0.0;\rvec2 off1=vec2(1.411764705882353)*step;\rvec2 off2=vec2(3.2941176470588234)*step;\rvec2 off3=vec2(5.176470588235294)*step;\rfloat compareDepth=abs(textureLod(depthSampler,uv,0.0).r);\rfloat sampleDepth;\rfloat weight;\rfloat weightSum=30.0;\rresult+=textureLod(image,uv,0.0).r*30.0;\rsampleDepth=abs(textureLod(depthSampler,uv+off1,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+= weight;\rresult+=textureLod(image,uv+off1,0.0).r*weight;\rsampleDepth=abs(textureLod(depthSampler,uv-off1,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+= weight;\rresult+=textureLod(image,uv-off1,0.0).r*weight;\rsampleDepth=abs(textureLod(depthSampler,uv+off2,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+=weight;\rresult+=textureLod(image,uv+off2,0.0).r*weight;\rsampleDepth=abs(textureLod(depthSampler,uv-off2,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+=weight;\rresult+=textureLod(image,uv-off2,0.0).r*weight;\rsampleDepth=abs(textureLod(depthSampler,uv+off3,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+=weight;\rresult+=textureLod(image,uv+off3,0.0).r*weight;\rsampleDepth=abs(textureLod(depthSampler,uv-off3,0.0).r);\rweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\rweightSum+=weight;\rresult+=textureLod(image,uv-off3,0.0).r*weight;\rreturn result/weightSum;\r}\r#endif\n#endif\nvoid main()\r{\rfloat result=0.0;\r#ifdef BLUR_BYPASS\nresult=textureLod(textureSampler,vUV,0.0).r;\r#else\n#ifdef BLUR_H\nvec2 step=vec2(1.0/outSize,0.0);\r#else\nvec2 step=vec2(0.0,1.0/outSize);\r#endif\n#ifdef BLUR_LEGACY\nresult=blur13Bilateral(textureSampler,vUV,step);\r#else\nfloat compareDepth=abs(textureLod(depthSampler,vUV,0.0).r);\rfloat weightSum=0.0;\rfor (int i=-samples; i<samples; i+=2)\r{\rvec2 samplePos=vUV+step*(float(i)+0.5);\rfloat sampleDepth=abs(textureLod(depthSampler,samplePos,0.0).r);\rfloat falloff=smoothstep(0.0,\rfloat(samples),\rfloat(samples)-abs(float(i))*soften);\rfloat minDivider=tolerance*0.5+0.003;\rfloat weight=falloff/( minDivider+abs(compareDepth-sampleDepth));\rresult+=textureLod(textureSampler,samplePos,0.0).r*weight;\rweightSum+=weight;\r}\rresult/=weightSum;\r#endif\n#endif\ngl_FragColor.rgb=vec3(result);\rgl_FragColor.a=1.0;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const ssao2PixelShader = { name, shader };\n"]}
|
|
@@ -3,22 +3,22 @@ import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
|
3
3
|
const name = "bakedVertexAnimation";
|
|
4
4
|
const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
5
5
|
{
|
|
6
|
-
let VATStartFrame: f32=bakedVertexAnimationSettingsInstanced.x;
|
|
6
|
+
let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;
|
|
7
7
|
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;
|
|
8
|
-
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;
|
|
9
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];
|
|
8
|
+
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;
|
|
9
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];
|
|
10
10
|
#if NUM_BONE_INFLUENCERS>2
|
|
11
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];
|
|
11
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];
|
|
12
12
|
#if NUM_BONE_INFLUENCERS>3
|
|
13
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];
|
|
13
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];
|
|
14
14
|
#if NUM_BONE_INFLUENCERS>4
|
|
15
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];
|
|
15
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];
|
|
16
16
|
#if NUM_BONE_INFLUENCERS>5
|
|
17
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];
|
|
17
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];
|
|
18
18
|
#if NUM_BONE_INFLUENCERS>6
|
|
19
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];
|
|
19
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];
|
|
20
20
|
#if NUM_BONE_INFLUENCERS>7
|
|
21
|
-
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];
|
|
21
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];
|
|
22
22
|
finalWorld=finalWorld*VATInfluence;
|
|
23
23
|
`;
|
|
24
24
|
// Sideeffect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bakedVertexAnimation.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/bakedVertexAnimation.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Cd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimation\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\r#ifdef INSTANCES\nlet VATStartFrame: f32=bakedVertexAnimationSettingsInstanced.x;\rlet VATEndFrame: f32=bakedVertexAnimationSettingsInstanced.y;\rlet VATOffsetFrame: f32=bakedVertexAnimationSettingsInstanced.z;\rlet VATSpeed: f32=bakedVertexAnimationSettingsInstanced.w;\r#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;\rlet VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;\rlet VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;\rlet VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\r#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;\rlet time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;\rlet frameCorrection: f32=select(1.0,0.0,time<1.0);\rlet numOfFrames: f32=totalFrames-frameCorrection;\rvar VATFrameNum: f32=fract(time)*numOfFrames;\rVATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;\rVATFrameNum=floor(VATFrameNum);\rVATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;\rvar VATInfluence : mat4x4<f32>;\rVATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[0],VATFrameNum)*matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[1],VATFrameNum)*matricesWeights[1];\r#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[2],VATFrameNum)*matricesWeights[2];\r#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndices[3],VATFrameNum)*matricesWeights[3];\r#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[0],VATFrameNum)*matricesWeightsExtra[0];\r#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[1],VATFrameNum)*matricesWeightsExtra[1];\r#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[2],VATFrameNum)*matricesWeightsExtra[2];\r#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,matricesIndicesExtra[3],VATFrameNum)*matricesWeightsExtra[3];\r#endif\nfinalWorld=finalWorld*VATInfluence;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimation = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"bakedVertexAnimation.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/bakedVertexAnimation.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Cd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimation\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\r#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;\rlet VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;\rlet VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;\rlet VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\r#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;\rlet VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;\rlet VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;\rlet VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\r#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;\rlet time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;\rlet frameCorrection: f32=select(1.0,0.0,time<1.0);\rlet numOfFrames: f32=totalFrames-frameCorrection;\rvar VATFrameNum: f32=fract(time)*numOfFrames;\rVATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;\rVATFrameNum=floor(VATFrameNum);\rVATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;\rvar VATInfluence : mat4x4<f32>;\rVATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\r#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\r#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\r#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\r#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\r#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\r#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\r#endif\nfinalWorld=finalWorld*VATInfluence;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimation = { name, shader };\n"]}
|
|
@@ -4,35 +4,35 @@ const name = "bonesVertex";
|
|
|
4
4
|
const shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
5
5
|
#if NUM_BONE_INFLUENCERS>0
|
|
6
6
|
var influence : mat4x4<f32>;
|
|
7
|
-
influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
|
|
8
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
|
|
7
|
+
influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];
|
|
8
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];
|
|
9
9
|
#if NUM_BONE_INFLUENCERS>2
|
|
10
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
|
|
10
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];
|
|
11
11
|
#if NUM_BONE_INFLUENCERS>3
|
|
12
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
|
|
12
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];
|
|
13
13
|
#if NUM_BONE_INFLUENCERS>4
|
|
14
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
|
|
14
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];
|
|
15
15
|
#if NUM_BONE_INFLUENCERS>5
|
|
16
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
|
|
16
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];
|
|
17
17
|
#if NUM_BONE_INFLUENCERS>6
|
|
18
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
|
|
18
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];
|
|
19
19
|
#if NUM_BONE_INFLUENCERS>7
|
|
20
|
-
influence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
|
|
20
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];
|
|
21
21
|
#else
|
|
22
|
-
influence=uniforms.mBones[int(matricesIndices[0])]*matricesWeights[0];
|
|
23
|
-
influence=influence+uniforms.mBones[int(matricesIndices[1])]*matricesWeights[1];
|
|
22
|
+
influence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
|
|
23
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
|
|
24
24
|
#if NUM_BONE_INFLUENCERS>2
|
|
25
|
-
influence=influence+uniforms.mBones[int(matricesIndices[2])]*matricesWeights[2];
|
|
25
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
|
|
26
26
|
#if NUM_BONE_INFLUENCERS>3
|
|
27
|
-
influence=influence+uniforms.mBones[int(matricesIndices[3])]*matricesWeights[3];
|
|
27
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
|
|
28
28
|
#if NUM_BONE_INFLUENCERS>4
|
|
29
|
-
influence=influence+uniforms.mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
|
|
29
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
|
|
30
30
|
#if NUM_BONE_INFLUENCERS>5
|
|
31
|
-
influence=influence+uniforms.mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
|
|
31
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
|
|
32
32
|
#if NUM_BONE_INFLUENCERS>6
|
|
33
|
-
influence=influence+uniforms.mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
|
|
33
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
|
|
34
34
|
#if NUM_BONE_INFLUENCERS>7
|
|
35
|
-
influence=influence+uniforms.mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
|
|
35
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
|
|
36
36
|
#endif
|
|
37
37
|
finalWorld=finalWorld*influence;
|
|
38
38
|
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bonesVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/bonesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesVertex\";\nconst shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\r#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\r#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\r#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\r#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\r#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\r#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\r#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\r#endif \n#else \ninfluence=uniforms.mBones[int(matricesIndices[0])]*matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(matricesIndices[1])]*matricesWeights[1];\r#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(matricesIndices[2])]*matricesWeights[2];\r#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(matricesIndices[3])]*matricesWeights[3];\r#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\r#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\r#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\r#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\r#endif \n#endif\nfinalWorld=finalWorld*influence;\r#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesVertex = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"bonesVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/bonesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesVertex\";\nconst shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\r#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\r#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\r#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\r#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\r#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\r#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\r#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\r#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\r#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\r#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\r#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\r#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\r#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\r#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\r#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\r#endif \n#endif\nfinalWorld=finalWorld*influence;\r#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesVertex = { name, shader };\n"]}
|
|
@@ -4,17 +4,17 @@ const name = "clipPlaneFragment";
|
|
|
4
4
|
const shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
|
|
5
5
|
if (false) {}
|
|
6
6
|
#ifdef CLIPPLANE
|
|
7
|
-
else if (fClipDistance>0.0)
|
|
7
|
+
else if (fragmentInputs.fClipDistance>0.0)
|
|
8
8
|
#ifdef CLIPPLANE2
|
|
9
|
-
else if (fClipDistance2>0.0)
|
|
9
|
+
else if (fragmentInputs.fClipDistance2>0.0)
|
|
10
10
|
#ifdef CLIPPLANE3
|
|
11
|
-
else if (fClipDistance3>0.0)
|
|
11
|
+
else if (fragmentInputs.fClipDistance3>0.0)
|
|
12
12
|
#ifdef CLIPPLANE4
|
|
13
|
-
else if (fClipDistance4>0.0)
|
|
13
|
+
else if (fragmentInputs.fClipDistance4>0.0)
|
|
14
14
|
#ifdef CLIPPLANE5
|
|
15
|
-
else if (fClipDistance5>0.0)
|
|
15
|
+
else if (fragmentInputs.fClipDistance5>0.0)
|
|
16
16
|
#ifdef CLIPPLANE6
|
|
17
|
-
else if (fClipDistance6>0.0)
|
|
17
|
+
else if (fragmentInputs.fClipDistance6>0.0)
|
|
18
18
|
`;
|
|
19
19
|
// Sideeffect
|
|
20
20
|
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipPlaneFragment.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/clipPlaneFragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"clipPlaneFragment\";\nconst shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\r#endif\n#ifdef CLIPPLANE\nelse if (fClipDistance>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE2\nelse if (fClipDistance2>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE3\nelse if (fClipDistance3>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE4\nelse if (fClipDistance4>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE5\nelse if (fClipDistance5>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE6\nelse if (fClipDistance6>0.0)\r{\rdiscard;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const clipPlaneFragment = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"clipPlaneFragment.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/clipPlaneFragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"clipPlaneFragment\";\nconst shader = `#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nif (false) {}\r#endif\n#ifdef CLIPPLANE\nelse if (fragmentInputs.fClipDistance>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE2\nelse if (fragmentInputs.fClipDistance2>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE3\nelse if (fragmentInputs.fClipDistance3>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE4\nelse if (fragmentInputs.fClipDistance4>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE5\nelse if (fragmentInputs.fClipDistance5>0.0)\r{\rdiscard;\r}\r#endif\n#ifdef CLIPPLANE6\nelse if (fragmentInputs.fClipDistance6>0.0)\r{\rdiscard;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const clipPlaneFragment = { name, shader };\n"]}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
3
|
const name = "clipPlaneVertex";
|
|
4
4
|
const shader = `#ifdef CLIPPLANE
|
|
5
|
-
fClipDistance=dot(worldPos,uniforms.vClipPlane);
|
|
5
|
+
vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);
|
|
6
6
|
#ifdef CLIPPLANE2
|
|
7
|
-
fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
|
|
7
|
+
vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
|
|
8
8
|
#ifdef CLIPPLANE3
|
|
9
|
-
fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
|
|
9
|
+
vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
|
|
10
10
|
#ifdef CLIPPLANE4
|
|
11
|
-
fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
|
|
11
|
+
vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
|
|
12
12
|
#ifdef CLIPPLANE5
|
|
13
|
-
fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
|
|
13
|
+
vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
|
|
14
14
|
#ifdef CLIPPLANE6
|
|
15
|
-
fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
|
|
15
|
+
vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
|
|
16
16
|
`;
|
|
17
17
|
// Sideeffect
|
|
18
18
|
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipPlaneVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/clipPlaneVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;CAkBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"clipPlaneVertex\";\nconst shader = `#ifdef CLIPPLANE\
|
|
1
|
+
{"version":3,"file":"clipPlaneVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/clipPlaneVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;CAkBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"clipPlaneVertex\";\nconst shader = `#ifdef CLIPPLANE\nvertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);\r#endif\n#ifdef CLIPPLANE2\nvertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);\r#endif\n#ifdef CLIPPLANE3\nvertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);\r#endif\n#ifdef CLIPPLANE4\nvertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);\r#endif\n#ifdef CLIPPLANE5\nvertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);\r#endif\n#ifdef CLIPPLANE6\nvertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const clipPlaneVertex = { name, shader };\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
3
|
const name = "instancesVertex";
|
|
4
4
|
const shader = `#ifdef INSTANCES
|
|
5
|
-
var finalWorld=mat4x4<f32>(world0,world1,world2,world3);
|
|
5
|
+
var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);
|
|
6
6
|
var finalPreviousWorld=mat4x4<f32>(previousWorld0,previousWorld1,previousWorld2,previousWorld3);
|
|
7
7
|
#ifdef THIN_INSTANCES
|
|
8
8
|
#if !defined(WORLD_UBO)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instancesVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/instancesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"instancesVertex\";\nconst shader = `#ifdef INSTANCES\nvar finalWorld=mat4x4<f32>(world0,world1,world2,world3);\r#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=mat4x4<f32>(previousWorld0,previousWorld1,previousWorld2,previousWorld3);\r#endif\n#ifdef THIN_INSTANCES\n#if !defined(WORLD_UBO)\nfinalWorld=uniforms.world*finalWorld;\r#else\nfinalWorld=mesh.world*finalWorld;\r#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nfinalPreviousWorld=previousWorld*finalPreviousWorld;\r#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nvar finalWorld=uniforms.world;\r#else\nvar finalWorld=mesh.world;\r#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=previousWorld;\r#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const instancesVertex = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"instancesVertex.js","sourceRoot":"","sources":["../../../../../lts/core/generated/ShadersWGSL/ShadersInclude/instancesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"instancesVertex\";\nconst shader = `#ifdef INSTANCES\nvar finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);\r#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=mat4x4<f32>(previousWorld0,previousWorld1,previousWorld2,previousWorld3);\r#endif\n#ifdef THIN_INSTANCES\n#if !defined(WORLD_UBO)\nfinalWorld=uniforms.world*finalWorld;\r#else\nfinalWorld=mesh.world*finalWorld;\r#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nfinalPreviousWorld=previousWorld*finalPreviousWorld;\r#endif\n#endif\n#else\n#if !defined(WORLD_UBO)\nvar finalWorld=uniforms.world;\r#else\nvar finalWorld=mesh.world;\r#endif\n#if defined(PREPASS_VELOCITY) || defined(VELOCITY)\nvar finalPreviousWorld=previousWorld;\r#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const instancesVertex = { name, shader };\n"]}
|