@graphty/graphty-element 1.0.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.
Files changed (103) hide show
  1. package/README.md +9 -0
  2. package/dist/basisTextureLoader-BqIvxvNl.js +312 -0
  3. package/dist/basisTextureLoader-BqIvxvNl.js.map +1 -0
  4. package/dist/custom-elements.json +1 -0
  5. package/dist/dds-BlAaKjyJ.js +357 -0
  6. package/dist/dds-BlAaKjyJ.js.map +1 -0
  7. package/dist/ddsTextureLoader-D7Jh83wc.js +44 -0
  8. package/dist/ddsTextureLoader-D7Jh83wc.js.map +1 -0
  9. package/dist/default.fragment-BNc4beoN.js +452 -0
  10. package/dist/default.fragment-BNc4beoN.js.map +1 -0
  11. package/dist/default.fragment-CSeCDRwv.js +512 -0
  12. package/dist/default.fragment-CSeCDRwv.js.map +1 -0
  13. package/dist/default.vertex-9pBFrn06.js +202 -0
  14. package/dist/default.vertex-9pBFrn06.js.map +1 -0
  15. package/dist/default.vertex-DDjK1DRv.js +185 -0
  16. package/dist/default.vertex-DDjK1DRv.js.map +1 -0
  17. package/dist/defaultUboDeclaration-CG47IDRY.js +9 -0
  18. package/dist/defaultUboDeclaration-CG47IDRY.js.map +1 -0
  19. package/dist/defaultUboDeclaration-Ct5CiQ-w.js +11 -0
  20. package/dist/defaultUboDeclaration-Ct5CiQ-w.js.map +1 -0
  21. package/dist/dumpTools-DA1xMSIZ.js +103 -0
  22. package/dist/dumpTools-DA1xMSIZ.js.map +1 -0
  23. package/dist/envTextureLoader-DdCLpySN.js +238 -0
  24. package/dist/envTextureLoader-DdCLpySN.js.map +1 -0
  25. package/dist/exrTextureLoader-CnJSRQ9w.js +741 -0
  26. package/dist/exrTextureLoader-CnJSRQ9w.js.map +1 -0
  27. package/dist/graphty.js +12 -0
  28. package/dist/graphty.js.map +1 -0
  29. package/dist/graphty.umd.cjs +12657 -0
  30. package/dist/graphty.umd.cjs.map +1 -0
  31. package/dist/greasedLine.fragment-BZnGGe-r.js +30 -0
  32. package/dist/greasedLine.fragment-BZnGGe-r.js.map +1 -0
  33. package/dist/greasedLine.fragment-DixuqXus.js +12 -0
  34. package/dist/greasedLine.fragment-DixuqXus.js.map +1 -0
  35. package/dist/greasedLine.vertex-BhhwFKPy.js +33 -0
  36. package/dist/greasedLine.vertex-BhhwFKPy.js.map +1 -0
  37. package/dist/greasedLine.vertex-DIhgGSOi.js +49 -0
  38. package/dist/greasedLine.vertex-DIhgGSOi.js.map +1 -0
  39. package/dist/harmonicsFunctions-B9jTNKTF.js +197 -0
  40. package/dist/harmonicsFunctions-B9jTNKTF.js.map +1 -0
  41. package/dist/harmonicsFunctions-D9ZL5yLA.js +194 -0
  42. package/dist/harmonicsFunctions-D9ZL5yLA.js.map +1 -0
  43. package/dist/hdrTextureLoader-DreWCvHD.js +112 -0
  44. package/dist/hdrTextureLoader-DreWCvHD.js.map +1 -0
  45. package/dist/helperFunctions-Dh1WD8YN.js +106 -0
  46. package/dist/helperFunctions-Dh1WD8YN.js.map +1 -0
  47. package/dist/helperFunctions-ZBnqb-in.js +79 -0
  48. package/dist/helperFunctions-ZBnqb-in.js.map +1 -0
  49. package/dist/iesTextureLoader-JdfAyRK-.js +94 -0
  50. package/dist/iesTextureLoader-JdfAyRK-.js.map +1 -0
  51. package/dist/index-ChGTkj2q.js +62191 -0
  52. package/dist/index-ChGTkj2q.js.map +1 -0
  53. package/dist/instancesVertex-BrWNnWxF.js +46 -0
  54. package/dist/instancesVertex-BrWNnWxF.js.map +1 -0
  55. package/dist/instancesVertex-evcSIvCA.js +55 -0
  56. package/dist/instancesVertex-evcSIvCA.js.map +1 -0
  57. package/dist/ktxTextureLoader-Dg1h0a-4.js +520 -0
  58. package/dist/ktxTextureLoader-Dg1h0a-4.js.map +1 -0
  59. package/dist/logDepthDeclaration-BHUUDd5l.js +12 -0
  60. package/dist/logDepthDeclaration-BHUUDd5l.js.map +1 -0
  61. package/dist/logDepthDeclaration-Bou5AJOP.js +28 -0
  62. package/dist/logDepthDeclaration-Bou5AJOP.js.map +1 -0
  63. package/dist/logDepthVertex-CCFGLExi.js +496 -0
  64. package/dist/logDepthVertex-CCFGLExi.js.map +1 -0
  65. package/dist/logDepthVertex-r_niddz9.js +496 -0
  66. package/dist/logDepthVertex-r_niddz9.js.map +1 -0
  67. package/dist/mesh.vertexData.functions-Bc9lJlrU.js +75 -0
  68. package/dist/mesh.vertexData.functions-Bc9lJlrU.js.map +1 -0
  69. package/dist/meshUboDeclaration-Dg__Mhmj.js +18 -0
  70. package/dist/meshUboDeclaration-Dg__Mhmj.js.map +1 -0
  71. package/dist/oitFragment-Bn29Ggvj.js +1191 -0
  72. package/dist/oitFragment-Bn29Ggvj.js.map +1 -0
  73. package/dist/oitFragment-D6JBEGk0.js +1328 -0
  74. package/dist/oitFragment-D6JBEGk0.js.map +1 -0
  75. package/dist/pass.fragment-C9O4ZLJL.js +11 -0
  76. package/dist/pass.fragment-C9O4ZLJL.js.map +1 -0
  77. package/dist/pass.fragment-Cf0ob1Y3.js +11 -0
  78. package/dist/pass.fragment-Cf0ob1Y3.js.map +1 -0
  79. package/dist/passCube.fragment-Mg8Qj5T9.js +30 -0
  80. package/dist/passCube.fragment-Mg8Qj5T9.js.map +1 -0
  81. package/dist/passCube.fragment-uM4B7TOI.js +30 -0
  82. package/dist/passCube.fragment-uM4B7TOI.js.map +1 -0
  83. package/dist/pbr.fragment-C8Lm3cwF.js +3176 -0
  84. package/dist/pbr.fragment-C8Lm3cwF.js.map +1 -0
  85. package/dist/pbr.fragment-siOdCYqI.js +3219 -0
  86. package/dist/pbr.fragment-siOdCYqI.js.map +1 -0
  87. package/dist/pbr.vertex-Bw_TrGQv.js +229 -0
  88. package/dist/pbr.vertex-Bw_TrGQv.js.map +1 -0
  89. package/dist/pbr.vertex-CmEPCcBW.js +365 -0
  90. package/dist/pbr.vertex-CmEPCcBW.js.map +1 -0
  91. package/dist/postprocess.vertex-B086G8mM.js +16 -0
  92. package/dist/postprocess.vertex-B086G8mM.js.map +1 -0
  93. package/dist/rgbdDecode.fragment-bNaGtQ-x.js +9 -0
  94. package/dist/rgbdDecode.fragment-bNaGtQ-x.js.map +1 -0
  95. package/dist/rgbdDecode.fragment-koAcppx0.js +9 -0
  96. package/dist/rgbdDecode.fragment-koAcppx0.js.map +1 -0
  97. package/dist/rgbdEncode.fragment-BDHL2P_i.js +9 -0
  98. package/dist/rgbdEncode.fragment-BDHL2P_i.js.map +1 -0
  99. package/dist/rgbdEncode.fragment-Dw0FS9aH.js +9 -0
  100. package/dist/rgbdEncode.fragment-Dw0FS9aH.js.map +1 -0
  101. package/dist/tgaTextureLoader-DIfkfgQh.js +199 -0
  102. package/dist/tgaTextureLoader-DIfkfgQh.js.map +1 -0
  103. package/package.json +124 -0
@@ -0,0 +1,452 @@
1
+ import { S as e } from "./index-ChGTkj2q.js";
2
+ import "./defaultUboDeclaration-CG47IDRY.js";
3
+ import "./oitFragment-Bn29Ggvj.js";
4
+ import "./logDepthDeclaration-BHUUDd5l.js";
5
+ import "./helperFunctions-ZBnqb-in.js";
6
+ const i = "lightsFragmentFunctions", a = `struct lightingInfo
7
+ {diffuse: vec3f,
8
+ #ifdef SPECULARTERM
9
+ specular: vec3f,
10
+ #endif
11
+ #ifdef NDOTL
12
+ ndl: f32,
13
+ #endif
14
+ };fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.)
15
+ {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var attenuation: f32=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}
16
+ else
17
+ {lightVectorW=normalize(-lightData.xyz);}
18
+ var ndl: f32=max(0.,dot(vNormal,lightVectorW));
19
+ #ifdef NDOTL
20
+ result.ndl=ndl;
21
+ #endif
22
+ result.diffuse=ndl*diffuseColor*attenuation;
23
+ #ifdef SPECULARTERM
24
+ var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
25
+ #endif
26
+ return result;}
27
+ fn getAttenuation(cosAngle: f32,exponent: f32)->f32 {return max(0.,pow(cosAngle,exponent));}
28
+ fn getIESAttenuation(cosAngle: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->f32 {var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;}
29
+ fn computeBasicSpotLighting(viewDirectionW: vec3f,lightVectorW: vec3f,vNormal: vec3f,attenuation: f32,diffuseColor: vec3f,specularColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=max(0.,dot(vNormal,lightVectorW));
30
+ #ifdef NDOTL
31
+ result.ndl=ndl;
32
+ #endif
33
+ result.diffuse=ndl*diffuseColor*attenuation;
34
+ #ifdef SPECULARTERM
35
+ var angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;
36
+ #endif
37
+ return result;}
38
+ fn computeIESSpotLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var dotProduct=dot(lightDirection.xyz,-lightVectorW);var cosAngle: f32=max(0.,dotProduct);if (cosAngle>=lightDirection.w)
39
+ {attenuation*=getIESAttenuation(dotProduct,iesLightTexture,iesLightTextureSampler);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}
40
+ var result: lightingInfo;result.diffuse=vec3f(0.);
41
+ #ifdef SPECULARTERM
42
+ result.specular=vec3f(0.);
43
+ #endif
44
+ #ifdef NDOTL
45
+ result.ndl=0.;
46
+ #endif
47
+ return result;}
48
+ fn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)
49
+ {attenuation*=getAttenuation(cosAngle,lightData.w);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}
50
+ var result: lightingInfo;result.diffuse=vec3f(0.);
51
+ #ifdef SPECULARTERM
52
+ result.specular=vec3f(0.);
53
+ #endif
54
+ #ifdef NDOTL
55
+ result.ndl=0.;
56
+ #endif
57
+ return result;}
58
+ fn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=dot(vNormal,lightData.xyz)*0.5+0.5;
59
+ #ifdef NDOTL
60
+ result.ndl=ndl;
61
+ #endif
62
+ result.diffuse=mix(groundColor,diffuseColor,ndl);
63
+ #ifdef SPECULARTERM
64
+ var angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;
65
+ #endif
66
+ return result;}
67
+ fn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;}
68
+ #if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
69
+ #include<ltcHelperFunctions>
70
+ var areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d<f32>;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d<f32>;fn computeAreaLighting(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightPosition:vec3f,halfWidth:vec3f, halfHeight:vec3f,diffuseColor:vec3f,specularColor:vec3f,roughness:f32 )->lightingInfo
71
+ {var result: lightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness);
72
+ #ifdef SPECULARTERM
73
+ var fresnel:vec3f=( specularColor*data.Fresnel.x+( vec3f( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular;
74
+ #endif
75
+ result.diffuse+=diffuseColor*data.Diffuse;return result;}
76
+ #endif
77
+ `;
78
+ e.IncludesShadersStoreWGSL[i] || (e.IncludesShadersStoreWGSL[i] = a);
79
+ const o = "fresnelFunction", t = `#ifdef FRESNEL
80
+ fn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32
81
+ {let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}
82
+ #endif
83
+ `;
84
+ e.IncludesShadersStoreWGSL[o] || (e.IncludesShadersStoreWGSL[o] = t);
85
+ const r = "defaultPixelShader", f = `#include<defaultUboDeclaration>
86
+ #include<prePassDeclaration>[SCENE_MRT_COUNT]
87
+ #include<oitDeclaration>
88
+ #define CUSTOM_FRAGMENT_BEGIN
89
+ varying vPositionW: vec3f;
90
+ #ifdef NORMAL
91
+ varying vNormalW: vec3f;
92
+ #endif
93
+ #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
94
+ varying vColor: vec4f;
95
+ #endif
96
+ #include<mainUVVaryingDeclaration>[1..7]
97
+ #include<helperFunctions>
98
+ #include<lightUboDeclaration>[0..maxSimultaneousLights]
99
+ #include<lightsFragmentFunctions>
100
+ #include<shadowsFragmentFunctions>
101
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)
102
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
103
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
104
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
105
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
106
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
107
+ #ifdef REFRACTION
108
+ #ifdef REFRACTIONMAP_3D
109
+ var refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;
110
+ #else
111
+ var refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;
112
+ #endif
113
+ #endif
114
+ #if defined(SPECULARTERM)
115
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)
116
+ #endif
117
+ #include<fresnelFunction>
118
+ #ifdef REFLECTION
119
+ #ifdef REFLECTIONMAP_3D
120
+ var reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;
121
+ #else
122
+ var reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;
123
+ #endif
124
+ #ifdef REFLECTIONMAP_SKYBOX
125
+ varying vPositionUVW: vec3f;
126
+ #else
127
+ #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
128
+ varying vDirectionW: vec3f;
129
+ #endif
130
+ #endif
131
+ #include<reflectionFunction>
132
+ #endif
133
+ #include<imageProcessingDeclaration>
134
+ #include<imageProcessingFunctions>
135
+ #include<bumpFragmentMainFunctions>
136
+ #include<bumpFragmentFunctions>
137
+ #include<clipPlaneFragmentDeclaration>
138
+ #include<logDepthDeclaration>
139
+ #include<fogFragmentDeclaration>
140
+ #define CUSTOM_FRAGMENT_DEFINITIONS
141
+ @fragment
142
+ fn main(input: FragmentInputs)->FragmentOutputs {
143
+ #define CUSTOM_FRAGMENT_MAIN_BEGIN
144
+ #include<clipPlaneFragment>
145
+ var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;
146
+ #ifdef NORMAL
147
+ var normalW: vec3f=normalize(fragmentInputs.vNormalW);
148
+ #else
149
+ var normalW: vec3f=normalize(-cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)));
150
+ #endif
151
+ #include<bumpFragment>
152
+ #ifdef TWOSIDEDLIGHTING
153
+ normalW=select(-normalW,normalW,fragmentInputs.frontFacing);
154
+ #endif
155
+ #ifdef DIFFUSE
156
+ baseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);
157
+ #if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)
158
+ if (baseColor.a<uniforms.alphaCutOff) {discard;}
159
+ #endif
160
+ #ifdef ALPHAFROMDIFFUSE
161
+ alpha*=baseColor.a;
162
+ #endif
163
+ #define CUSTOM_FRAGMENT_UPDATE_ALPHA
164
+ baseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);
165
+ #endif
166
+ #if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)
167
+ var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);
168
+ #include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
169
+ #endif
170
+ #include<depthPrePass>
171
+ #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
172
+ baseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);
173
+ #endif
174
+ #ifdef DETAIL
175
+ baseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);
176
+ #endif
177
+ #if defined(DECAL) && defined(DECAL_AFTER_DETAIL)
178
+ var decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);
179
+ #include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)
180
+ #endif
181
+ #define CUSTOM_FRAGMENT_UPDATE_DIFFUSE
182
+ var baseAmbientColor: vec3f= vec3f(1.,1.,1.);
183
+ #ifdef AMBIENT
184
+ baseAmbientColor=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;
185
+ #endif
186
+ #define CUSTOM_FRAGMENT_BEFORE_LIGHTS
187
+ var glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;
188
+ #ifdef SPECULARTERM
189
+ #ifdef SPECULAR
190
+ var specularMapColor: vec4f=textureSample(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;
191
+ #ifdef GLOSSINESS
192
+ glossiness=glossiness*specularMapColor.a;
193
+ #endif
194
+ #endif
195
+ #endif
196
+ var diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;
197
+ #ifdef SPECULARTERM
198
+ var specularBase: vec3f= vec3f(0.,0.,0.);
199
+ #endif
200
+ var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;
201
+ #ifdef LIGHTMAP
202
+ var lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);
203
+ #ifdef RGBDLIGHTMAP
204
+ lightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);
205
+ #endif
206
+ lightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);
207
+ #endif
208
+ #include<lightFragment>[0..maxSimultaneousLights]
209
+ aggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);
210
+ #ifdef REFRACTION
211
+ var refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));
212
+ #ifdef REFRACTIONMAP_3D
213
+ #ifdef USE_LOCAL_REFRACTIONMAP_CUBIC
214
+ refractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);
215
+ #endif
216
+ refractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}
217
+ #else
218
+ var vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);
219
+ #endif
220
+ #ifdef RGBDREFRACTION
221
+ refractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);
222
+ #endif
223
+ #ifdef IS_REFRACTION_LINEAR
224
+ refractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);
225
+ #endif
226
+ refractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);
227
+ #endif
228
+ var reflectionColor: vec4f= vec4f(0.,0.,0.,1.);
229
+ #ifdef REFLECTION
230
+ var vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);
231
+ #ifdef REFLECTIONMAP_OPPOSITEZ
232
+ vReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);
233
+ #endif
234
+ #ifdef REFLECTIONMAP_3D
235
+ #ifdef ROUGHNESS
236
+ var bias: f32=uniforms.vReflectionInfos.y;
237
+ #ifdef SPECULARTERM
238
+ #ifdef SPECULAR
239
+ #ifdef GLOSSINESS
240
+ bias*=(1.0-specularMapColor.a);
241
+ #endif
242
+ #endif
243
+ #endif
244
+ reflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);
245
+ #else
246
+ reflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);
247
+ #endif
248
+ #else
249
+ var coords: vec2f=vReflectionUVW.xy;
250
+ #ifdef REFLECTIONMAP_PROJECTION
251
+ coords/=vReflectionUVW.z;
252
+ #endif
253
+ coords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);
254
+ #endif
255
+ #ifdef RGBDREFLECTION
256
+ reflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);
257
+ #endif
258
+ #ifdef IS_REFLECTION_LINEAR
259
+ reflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);
260
+ #endif
261
+ reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);
262
+ #ifdef REFLECTIONFRESNEL
263
+ var reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);
264
+ #ifdef REFLECTIONFRESNELFROMSPECULAR
265
+ #ifdef SPECULARTERM
266
+ reflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
267
+ #else
268
+ reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
269
+ #endif
270
+ #else
271
+ reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
272
+ #endif
273
+ #endif
274
+ #endif
275
+ #ifdef REFRACTIONFRESNEL
276
+ var refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);
277
+ #endif
278
+ #ifdef OPACITY
279
+ var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);
280
+ #ifdef OPACITYRGB
281
+ opacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* uniforms.vOpacityInfos.y;
282
+ #else
283
+ alpha*=opacityMap.a*uniforms.vOpacityInfos.y;
284
+ #endif
285
+ #endif
286
+ #if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)
287
+ alpha*=fragmentInputs.vColor.a;
288
+ #endif
289
+ #ifdef OPACITYFRESNEL
290
+ var opacityFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.opacityParts.z,uniforms.opacityParts.w);alpha+=uniforms.opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*uniforms.opacityParts.y;
291
+ #endif
292
+ #ifdef ALPHATEST
293
+ #ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS
294
+ if (alpha<uniforms.alphaCutOff) {discard;}
295
+ #endif
296
+ #ifndef ALPHABLEND
297
+ alpha=1.0;
298
+ #endif
299
+ #endif
300
+ var emissiveColor: vec3f=uniforms.vEmissiveColor;
301
+ #ifdef EMISSIVE
302
+ emissiveColor+=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;
303
+ #endif
304
+ #ifdef EMISSIVEFRESNEL
305
+ var emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;
306
+ #endif
307
+ #ifdef DIFFUSEFRESNEL
308
+ var diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;
309
+ #endif
310
+ #ifdef EMISSIVEASILLUMINATION
311
+ var finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
312
+ #else
313
+ #ifdef LINKEMISSIVEWITHDIFFUSE
314
+ var finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
315
+ #else
316
+ var finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;
317
+ #endif
318
+ #endif
319
+ #ifdef SPECULARTERM
320
+ var finalSpecular: vec3f=specularBase*specularColor;
321
+ #ifdef SPECULAROVERALPHA
322
+ alpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);
323
+ #endif
324
+ #else
325
+ var finalSpecular: vec3f= vec3f(0.0);
326
+ #endif
327
+ #ifdef REFLECTIONOVERALPHA
328
+ alpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);
329
+ #endif
330
+ #ifdef EMISSIVEASILLUMINATION
331
+ var color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);
332
+ #else
333
+ var color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);
334
+ #endif
335
+ #ifdef LIGHTMAP
336
+ #ifndef LIGHTMAPEXCLUDED
337
+ #ifdef USELIGHTMAPASSHADOWMAP
338
+ color=vec4f(color.rgb*lightmapColor.rgb,color.a);
339
+ #else
340
+ color=vec4f(color.rgb+lightmapColor.rgb,color.a);
341
+ #endif
342
+ #endif
343
+ #endif
344
+ #define CUSTOM_FRAGMENT_BEFORE_FOG
345
+ color=vec4f(max(color.rgb,vec3f(0.)),color.a);
346
+ #include<logDepthFragment>
347
+ #include<fogFragment>
348
+ #ifdef IMAGEPROCESSINGPOSTPROCESS
349
+ color=vec4f(toLinearSpaceVec3(color.rgb),color.a);
350
+ #else
351
+ #ifdef IMAGEPROCESSING
352
+ color=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);
353
+ #endif
354
+ #endif
355
+ color=vec4f(color.rgb,color.a*mesh.visibility);
356
+ #ifdef PREMULTIPLYALPHA
357
+ color=vec4f(color.rgb*color.a, color.a);
358
+ #endif
359
+ #define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR
360
+ #ifdef PREPASS
361
+ var writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;
362
+ #ifdef PREPASS_COLOR
363
+ fragData[PREPASS_COLOR_INDEX]=color;
364
+ #endif
365
+ #ifdef PREPASS_POSITION
366
+ fragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);
367
+ #endif
368
+ #ifdef PREPASS_LOCAL_POSITION
369
+ fragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);
370
+ #endif
371
+ #ifdef PREPASS_VELOCITY
372
+ var a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);
373
+ #elif defined(PREPASS_VELOCITY_LINEAR)
374
+ var velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -
375
+ (fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);
376
+ #endif
377
+ #ifdef PREPASS_IRRADIANCE
378
+ fragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo);
379
+ #endif
380
+ #ifdef PREPASS_DEPTH
381
+ fragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo);
382
+ #endif
383
+ #ifdef PREPASS_SCREENSPACE_DEPTH
384
+ fragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);
385
+ #endif
386
+ #ifdef PREPASS_NORMALIZED_VIEW_DEPTH
387
+ fragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);
388
+ #endif
389
+ #ifdef PREPASS_NORMAL
390
+ #ifdef PREPASS_NORMAL_WORLDSPACE
391
+ fragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);
392
+ #else
393
+ fragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);
394
+ #endif
395
+ #endif
396
+ #ifdef PREPASS_WORLD_NORMAL
397
+ fragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);
398
+ #endif
399
+ #ifdef PREPASS_ALBEDO
400
+ fragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);
401
+ #endif
402
+ #ifdef PREPASS_ALBEDO_SQRT
403
+ fragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);
404
+ #endif
405
+ #ifdef PREPASS_REFLECTIVITY
406
+ #if defined(SPECULAR)
407
+ fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo;
408
+ #else
409
+ fragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;
410
+ #endif
411
+ #endif
412
+ #if SCENE_MRT_COUNT>0
413
+ fragmentOutputs.fragData0=fragData[0];
414
+ #endif
415
+ #if SCENE_MRT_COUNT>1
416
+ fragmentOutputs.fragData1=fragData[1];
417
+ #endif
418
+ #if SCENE_MRT_COUNT>2
419
+ fragmentOutputs.fragData2=fragData[2];
420
+ #endif
421
+ #if SCENE_MRT_COUNT>3
422
+ fragmentOutputs.fragData3=fragData[3];
423
+ #endif
424
+ #if SCENE_MRT_COUNT>4
425
+ fragmentOutputs.fragData4=fragData[4];
426
+ #endif
427
+ #if SCENE_MRT_COUNT>5
428
+ fragmentOutputs.fragData5=fragData[5];
429
+ #endif
430
+ #if SCENE_MRT_COUNT>6
431
+ fragmentOutputs.fragData6=fragData[6];
432
+ #endif
433
+ #if SCENE_MRT_COUNT>7
434
+ fragmentOutputs.fragData7=fragData[7];
435
+ #endif
436
+ #endif
437
+ #if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)
438
+ fragmentOutputs.color=color;
439
+ #endif
440
+ #include<oitFragment>
441
+ #if ORDER_INDEPENDENT_TRANSPARENCY
442
+ if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}
443
+ #endif
444
+ #define CUSTOM_FRAGMENT_MAIN_END
445
+ }
446
+ `;
447
+ e.ShadersStoreWGSL[r] || (e.ShadersStoreWGSL[r] = f);
448
+ const d = { name: r, shader: f };
449
+ export {
450
+ d as defaultPixelShaderWGSL
451
+ };
452
+ //# sourceMappingURL=default.fragment-BNc4beoN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.fragment-BNc4beoN.js","sources":["../node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js","../node_modules/@babylonjs/core/ShadersWGSL/ShadersInclude/fresnelFunction.js","../node_modules/@babylonjs/core/ShadersWGSL/default.fragment.js"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nimport \"./ltcHelperFunctions.js\";\nconst name = \"lightsFragmentFunctions\";\nconst shader = `struct lightingInfo\n{diffuse: vec3f,\n#ifdef SPECULARTERM\nspecular: vec3f,\n#endif\n#ifdef NDOTL\nndl: f32,\n#endif\n};fn computeLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var result: lightingInfo;var lightVectorW: vec3f;var attenuation: f32=1.0;if (lightData.w==0.)\n{var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var attenuation: f32=max(0.,1.0-length(direction)/range);lightVectorW=normalize(direction);}\nelse\n{lightVectorW=normalize(-lightData.xyz);}\nvar ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfn getAttenuation(cosAngle: f32,exponent: f32)->f32 {return max(0.,pow(cosAngle,exponent));}\nfn getIESAttenuation(cosAngle: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->f32 {var angle=acos(cosAngle)/PI;return textureSampleLevel(iesLightTexture,iesLightTextureSampler,vec2f(angle,0),0.).r;}\nfn computeBasicSpotLighting(viewDirectionW: vec3f,lightVectorW: vec3f,vNormal: vec3f,attenuation: f32,diffuseColor: vec3f,specularColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightVectorW);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;}\nfn computeIESSpotLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32,iesLightTexture: texture_2d<f32>,iesLightTextureSampler: sampler)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var dotProduct=dot(lightDirection.xyz,-lightVectorW);var cosAngle: f32=max(0.,dotProduct);if (cosAngle>=lightDirection.w)\n{attenuation*=getIESAttenuation(dotProduct,iesLightTexture,iesLightTextureSampler);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nvar result: lightingInfo;result.diffuse=vec3f(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3f(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nfn computeSpotLighting(viewDirectionW: vec3f,vNormal: vec3f ,lightData: vec4f,lightDirection: vec4f,diffuseColor: vec3f,specularColor: vec3f,range: f32,glossiness: f32)->lightingInfo {var direction: vec3f=lightData.xyz-fragmentInputs.vPositionW;var lightVectorW: vec3f=normalize(direction);var attenuation: f32=max(0.,1.0-length(direction)/range);var cosAngle: f32=max(0.,dot(lightDirection.xyz,-lightVectorW));if (cosAngle>=lightDirection.w)\n{attenuation*=getAttenuation(cosAngle,lightData.w);return computeBasicSpotLighting(viewDirectionW,lightVectorW,vNormal,attenuation,diffuseColor,specularColor,glossiness);}\nvar result: lightingInfo;result.diffuse=vec3f(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3f(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;}\nfn computeHemisphericLighting(viewDirectionW: vec3f,vNormal: vec3f,lightData: vec4f,diffuseColor: vec3f,specularColor: vec3f,groundColor: vec3f,glossiness: f32)->lightingInfo {var result: lightingInfo;var ndl: f32=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\nvar angleW: vec3f=normalize(viewDirectionW+lightData.xyz);var specComp: f32=max(0.,dot(vNormal,angleW));specComp=pow(specComp,max(1.,glossiness));result.specular=specComp*specularColor;\n#endif\nreturn result;}\nfn computeProjectionTextureDiffuseLighting(projectionLightTexture: texture_2d<f32>,projectionLightSampler: sampler,textureProjectionMatrix: mat4x4f,posW: vec3f)->vec3f {var strq: vec4f=textureProjectionMatrix*vec4f(posW,1.0);strq/=strq.w;var textureColor: vec3f=textureSample(projectionLightTexture,projectionLightSampler,strq.xy).rgb;return textureColor;}\n#if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)\n#include<ltcHelperFunctions>\nvar areaLightsLTC1SamplerSampler: sampler;var areaLightsLTC1Sampler: texture_2d<f32>;var areaLightsLTC2SamplerSampler: sampler;var areaLightsLTC2Sampler: texture_2d<f32>;fn computeAreaLighting(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDirectionW: vec3f,vNormal:vec3f,vPosition:vec3f,lightPosition:vec3f,halfWidth:vec3f, halfHeight:vec3f,diffuseColor:vec3f,specularColor:vec3f,roughness:f32 )->lightingInfo\n{var result: lightingInfo;var data: areaLightData=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc1Sampler,ltc2,ltc2Sampler,viewDirectionW,vNormal,vPosition,lightPosition,halfWidth,halfHeight,roughness);\n#ifdef SPECULARTERM\nvar fresnel:vec3f=( specularColor*data.Fresnel.x+( vec3f( 1.0 )-specularColor )*data.Fresnel.y );result.specular+=specularColor*fresnel*data.Specular;\n#endif\nresult.diffuse+=diffuseColor*data.Diffuse;return result;}\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const lightsFragmentFunctionsWGSL = { name, shader };\n//# sourceMappingURL=lightsFragmentFunctions.js.map","// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore.js\";\nconst name = \"fresnelFunction\";\nconst shader = `#ifdef FRESNEL\nfn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32\n{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const fresnelFunctionWGSL = { name, shader };\n//# sourceMappingURL=fresnelFunction.js.map","// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore.js\";\nimport \"./ShadersInclude/defaultUboDeclaration.js\";\nimport \"./ShadersInclude/prePassDeclaration.js\";\nimport \"./ShadersInclude/oitDeclaration.js\";\nimport \"./ShadersInclude/mainUVVaryingDeclaration.js\";\nimport \"./ShadersInclude/helperFunctions.js\";\nimport \"./ShadersInclude/lightUboDeclaration.js\";\nimport \"./ShadersInclude/lightsFragmentFunctions.js\";\nimport \"./ShadersInclude/shadowsFragmentFunctions.js\";\nimport \"./ShadersInclude/samplerFragmentDeclaration.js\";\nimport \"./ShadersInclude/fresnelFunction.js\";\nimport \"./ShadersInclude/reflectionFunction.js\";\nimport \"./ShadersInclude/imageProcessingDeclaration.js\";\nimport \"./ShadersInclude/imageProcessingFunctions.js\";\nimport \"./ShadersInclude/bumpFragmentMainFunctions.js\";\nimport \"./ShadersInclude/bumpFragmentFunctions.js\";\nimport \"./ShadersInclude/clipPlaneFragmentDeclaration.js\";\nimport \"./ShadersInclude/logDepthDeclaration.js\";\nimport \"./ShadersInclude/fogFragmentDeclaration.js\";\nimport \"./ShadersInclude/clipPlaneFragment.js\";\nimport \"./ShadersInclude/bumpFragment.js\";\nimport \"./ShadersInclude/decalFragment.js\";\nimport \"./ShadersInclude/depthPrePass.js\";\nimport \"./ShadersInclude/lightFragment.js\";\nimport \"./ShadersInclude/logDepthFragment.js\";\nimport \"./ShadersInclude/fogFragment.js\";\nimport \"./ShadersInclude/oitFragment.js\";\nconst name = \"defaultPixelShader\";\nconst shader = `#include<defaultUboDeclaration>\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<lightUboDeclaration>[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\nvar refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;\n#else\nvar refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;\n#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\nvar reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;\n#else\nvar reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#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\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f=normalize(-cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=select(-normalW,normalW,fragmentInputs.frontFacing);\n#endif\n#ifdef DIFFUSE\nbaseColor=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<uniforms.alphaCutOff) {discard;}\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#include<depthPrePass>\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef DETAIL\nbaseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);\n#endif\n#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvar baseAmbientColor: vec3f= vec3f(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=textureSample(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\nvar specularMapColor: vec4f=textureSample(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef LIGHTMAP\nvar lightmapColor: vec4f=textureSample(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);\n#endif\nlightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\naggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFRACTION\nvar refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}\n#else\nvar vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);\n#endif\nrefractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);\n#endif\nvar reflectionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFLECTION\nvar vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nvar bias: f32=uniforms.vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);\n#endif\n#else\nvar coords: vec2f=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);\n#endif\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);\n#ifdef REFLECTIONFRESNEL\nvar reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nvar refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);\n#endif\n#ifdef OPACITY\nvar opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap=vec4f(opacityMap.rgb* vec3f(0.3,0.59,0.11),opacityMap.a);alpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* uniforms.vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*uniforms.vOpacityInfos.y;\n#endif\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nvar opacityFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.opacityParts.z,uniforms.opacityParts.w);alpha+=uniforms.opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*uniforms.opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<uniforms.alphaCutOff) {discard;}\n#endif\n#ifndef ALPHABLEND\nalpha=1.0;\n#endif\n#endif\nvar emissiveColor: vec3f=uniforms.vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nvar emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;\n#endif\n#ifdef DIFFUSEFRESNEL\nvar diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvar finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvar color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor=vec4f(color.rgb*lightmapColor.rgb,color.a);\n#else\ncolor=vec4f(color.rgb+lightmapColor.rgb,color.a);\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor=vec4f(max(color.rgb,vec3f(0.)),color.a);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#else\n#ifdef IMAGEPROCESSING\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\n#endif\ncolor=vec4f(color.rgb,color.a*mesh.visibility);\n#ifdef PREMULTIPLYALPHA\ncolor=vec4f(color.rgb*color.a, color.a);\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\nvar writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);var fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=color; \n#endif\n#ifdef PREPASS_POSITION\nfragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nfragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);\n#endif\n#ifdef PREPASS_VELOCITY\nvar a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvar velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -\n(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_IRRADIANCE\nfragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_DEPTH\nfragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\nfragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nfragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);\n#else\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nfragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\nfragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nfragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; \n#else\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;\n#endif\n#endif\n#if SCENE_MRT_COUNT>0\nfragmentOutputs.fragData0=fragData[0];\n#endif\n#if SCENE_MRT_COUNT>1\nfragmentOutputs.fragData1=fragData[1];\n#endif\n#if SCENE_MRT_COUNT>2\nfragmentOutputs.fragData2=fragData[2];\n#endif\n#if SCENE_MRT_COUNT>3\nfragmentOutputs.fragData3=fragData[3];\n#endif\n#if SCENE_MRT_COUNT>4\nfragmentOutputs.fragData4=fragData[4];\n#endif\n#if SCENE_MRT_COUNT>5\nfragmentOutputs.fragData5=fragData[5];\n#endif\n#if SCENE_MRT_COUNT>6\nfragmentOutputs.fragData6=fragData[6];\n#endif\n#if SCENE_MRT_COUNT>7\nfragmentOutputs.fragData7=fragData[7];\n#endif\n#endif\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=color;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const defaultPixelShaderWGSL = { name, shader };\n//# sourceMappingURL=default.fragment.js.map"],"names":["name","shader","ShaderStore","defaultPixelShaderWGSL"],"mappings":";;;;;AAGA,MAAMA,IAAO,2BACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEVC,EAAY,yBAAyBF,CAAI,MAC1CE,EAAY,yBAAyBF,CAAI,IAAIC;AC5EjD,MAAMD,IAAO,mBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAMVC,EAAY,yBAAyBF,CAAI,MAC1CE,EAAY,yBAAyBF,CAAI,IAAIC;ACkBjD,MAAMD,IAAO,sBACPC,IAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2WVC,EAAY,iBAAiBF,CAAI,MAClCE,EAAY,iBAAiBF,CAAI,IAAIC;AAG7B,MAACE,IAAyB,EAAE,MAAAH,GAAM,QAAAC,EAAM;","x_google_ignoreList":[0,1,2]}