@babylonjs/core 6.13.0 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/Animations/animationGroup.d.ts +10 -0
  2. package/Animations/animationGroup.js +19 -0
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/runtimeAnimation.d.ts +10 -10
  5. package/Animations/runtimeAnimation.js +31 -30
  6. package/Animations/runtimeAnimation.js.map +1 -1
  7. package/DeviceInput/webDeviceInputSystem.js +3 -3
  8. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  9. package/Engines/nativeEngine.js +2 -1
  10. package/Engines/nativeEngine.js.map +1 -1
  11. package/Engines/thinEngine.js +2 -2
  12. package/Engines/thinEngine.js.map +1 -1
  13. package/Lights/spotLight.js +2 -2
  14. package/Lights/spotLight.js.map +1 -1
  15. package/Materials/Node/nodeMaterial.js +1 -0
  16. package/Materials/Node/nodeMaterial.js.map +1 -1
  17. package/Materials/PBR/pbrBaseMaterial.d.ts +3 -3
  18. package/Materials/PBR/pbrBaseMaterial.js +3 -3
  19. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  20. package/Materials/PBR/pbrMaterial.d.ts +3 -3
  21. package/Materials/PBR/pbrMaterial.js +3 -3
  22. package/Materials/PBR/pbrMaterial.js.map +1 -1
  23. package/Materials/Textures/rawTexture2DArray.d.ts +4 -2
  24. package/Materials/Textures/rawTexture2DArray.js +3 -2
  25. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  26. package/Materials/Textures/rawTexture3D.d.ts +4 -2
  27. package/Materials/Textures/rawTexture3D.js +3 -2
  28. package/Materials/Textures/rawTexture3D.js.map +1 -1
  29. package/Maths/math.vector.js +11 -7
  30. package/Maths/math.vector.js.map +1 -1
  31. package/Misc/precisionDate.js +2 -2
  32. package/Misc/precisionDate.js.map +1 -1
  33. package/NOTICE.md +2 -0
  34. package/Physics/v1/Plugins/ammoJSPlugin.d.ts +1 -1
  35. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  36. package/Physics/v1/Plugins/cannonJSPlugin.d.ts +1 -1
  37. package/Physics/v1/Plugins/cannonJSPlugin.js +1 -1
  38. package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -1
  39. package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
  40. package/Physics/v2/Plugins/havokPlugin.js +6 -0
  41. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  42. package/Physics/v2/physicsConstraint.d.ts +28 -2
  43. package/Physics/v2/physicsConstraint.js +21 -1
  44. package/Physics/v2/physicsConstraint.js.map +1 -1
  45. package/Physics/v2/physicsShape.d.ts +22 -19
  46. package/Physics/v2/physicsShape.js +22 -19
  47. package/Physics/v2/physicsShape.js.map +1 -1
  48. package/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js +1 -1
  49. package/Shaders/ShadersInclude/pbrBlockAmbientOcclusion.js.map +1 -1
  50. package/Shaders/ShadersInclude/pbrBlockAnisotropic.js +1 -1
  51. package/Shaders/ShadersInclude/pbrBlockAnisotropic.js.map +1 -1
  52. package/Shaders/ShadersInclude/pbrBlockClearcoat.js +9 -1
  53. package/Shaders/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
  54. package/Shaders/ShadersInclude/pbrBlockReflectivity.js +10 -1
  55. package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  56. package/Shaders/ShadersInclude/pbrBlockSheen.js +5 -1
  57. package/Shaders/ShadersInclude/pbrBlockSheen.js.map +1 -1
  58. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +5 -1
  59. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  60. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"pbrBlockClearcoat.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockClearcoat.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyQd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,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 = \"pbrBlockClearcoat\";\nconst shader = `struct clearcoatOutParams\r{\rvec3 specularEnvironmentR0;\rfloat conservationFactor;\rvec3 clearCoatNormalW;\rvec2 clearCoatAARoughnessFactors;\rfloat clearCoatIntensity;\rfloat clearCoatRoughness;\r#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\r#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\rfloat clearCoatNdotVRefract;\rvec3 clearCoatColor;\rfloat clearCoatThickness;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\r#endif\n#if DEBUGMODE>0\nmat3 TBNClearCoat;\rvec2 clearCoatMapData;\rvec4 clearCoatTintMapData;\rvec4 environmentClearCoatRadiance;\rfloat clearCoatNdotV;\rvec3 clearCoatEnvironmentReflectance;\r#endif\n};\r#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\rin vec3 vPositionW,\rin vec3 geometricNormalW,\rin vec3 viewDirectionW,\rin vec2 vClearCoatParams,\r#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nin vec4 clearCoatMapRoughnessData,\r#endif\nin vec3 specularEnvironmentR0,\r#ifdef CLEARCOAT_TEXTURE\nin vec2 clearCoatMapData,\r#endif\n#ifdef CLEARCOAT_TINT\nin vec4 vClearCoatTintParams,\rin float clearCoatColorAtDistance,\rin vec4 vClearCoatRefractionParams,\r#ifdef CLEARCOAT_TINT_TEXTURE\nin vec4 clearCoatTintMapData,\r#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nin vec2 vClearCoatBumpInfos,\rin vec4 clearCoatBumpMapData,\rin vec2 vClearCoatBumpUV,\r#if defined(TANGENT) && defined(NORMAL)\nin mat3 vTBN,\r#else\nin vec2 vClearCoatTangentSpaceParams,\r#endif\n#ifdef OBJECTSPACE_NORMALMAP\nin mat4 normalMatrix,\r#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nin vec3 faceNormal,\r#endif\n#ifdef REFLECTION\nin vec3 vReflectionMicrosurfaceInfos,\rin vec2 vReflectionInfos,\rin vec3 vReflectionColor,\rin vec4 vLightingIntensity,\r#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\r#else\nin sampler2D reflectionSampler,\r#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\rin samplerCube reflectionSamplerHigh,\r#else\nin sampler2D reflectionSamplerLow,\rin sampler2D reflectionSamplerHigh,\r#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\r#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nin float ambientMonochrome,\r#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\nin float frontFacingMultiplier,\r#endif\nout clearcoatOutParams outParams\r)\r{\rfloat clearCoatIntensity=vClearCoatParams.x;\rfloat clearCoatRoughness=vClearCoatParams.y;\r#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\r#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\r#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\r#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL\nclearCoatRoughness*=clearCoatMapData.y;\r#else\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\r#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\routParams.clearCoatRoughness=clearCoatRoughness;\r#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\rfloat clearCoatThickness=vClearCoatTintParams.a;\r#ifdef CLEARCOAT_TINT_TEXTURE\n#ifdef CLEARCOAT_TINT_GAMMATEXTURE\nclearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);\r#else\nclearCoatColor*=clearCoatTintMapData.rgb;\r#endif\nclearCoatThickness*=clearCoatTintMapData.a;\r#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\r#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\routParams.clearCoatThickness=clearCoatThickness;\r#endif\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\r#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\r#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\rvec3 clearCoatNormalW=geometricNormalW;\r#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\r#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\r#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\r#else\nvec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;\rmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);\r#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\r#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);\rclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\r#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\r#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\r#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;\r#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\routParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\rfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\rfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\r#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\r#endif\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);\routParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\r#endif\n#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\r#endif\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\r#ifdef SPECULARAA\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\r#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\rvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\r#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\r#endif\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\r#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\r#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\r#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\r#endif\nsampleReflectionTexture(\rclearCoatAlphaG,\rvReflectionMicrosurfaceInfos,\rvReflectionInfos,\rvReflectionColor,\r#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\r#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\r#endif\nreflectionSampler,\rclearCoatReflectionCoords,\r#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\rreflectionSamplerHigh,\r#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\r#endif\nenvironmentClearCoatRadiance\r);\r#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\r#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\r#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\rclearCoatEnvironmentReflectance*=clearCoatEho;\r#endif\n#endif\n#endif\n#else\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\r#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\r#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\r#endif\noutParams.finalClearCoatRadianceScaled=\renvironmentClearCoatRadiance.rgb *\rclearCoatEnvironmentReflectance *\rvLightingIntensity.z;\r#endif\n#if defined(CLEARCOAT_TINT)\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\r#endif\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\rfresnelIBLClearCoat*=clearCoatIntensity;\routParams.conservationFactor=(1.-fresnelIBLClearCoat);\r#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\r#endif\n}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockClearcoat = { name, shader };\n"]}
1
+ {"version":3,"file":"pbrBlockClearcoat.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockClearcoat.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiRd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,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 = \"pbrBlockClearcoat\";\nconst shader = `struct clearcoatOutParams\r{\rvec3 specularEnvironmentR0;\rfloat conservationFactor;\rvec3 clearCoatNormalW;\rvec2 clearCoatAARoughnessFactors;\rfloat clearCoatIntensity;\rfloat clearCoatRoughness;\r#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\r#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\rfloat clearCoatNdotVRefract;\rvec3 clearCoatColor;\rfloat clearCoatThickness;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\r#endif\n#if DEBUGMODE>0\n#ifdef CLEARCOAT_BUMP\nmat3 TBNClearCoat;\r#endif\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData;\r#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData;\r#endif\n#ifdef REFLECTION\nvec4 environmentClearCoatRadiance;\rvec3 clearCoatEnvironmentReflectance;\r#endif\nfloat clearCoatNdotV;\r#endif\n};\r#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\rin vec3 vPositionW,\rin vec3 geometricNormalW,\rin vec3 viewDirectionW,\rin vec2 vClearCoatParams,\r#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nin vec4 clearCoatMapRoughnessData,\r#endif\nin vec3 specularEnvironmentR0,\r#ifdef CLEARCOAT_TEXTURE\nin vec2 clearCoatMapData,\r#endif\n#ifdef CLEARCOAT_TINT\nin vec4 vClearCoatTintParams,\rin float clearCoatColorAtDistance,\rin vec4 vClearCoatRefractionParams,\r#ifdef CLEARCOAT_TINT_TEXTURE\nin vec4 clearCoatTintMapData,\r#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nin vec2 vClearCoatBumpInfos,\rin vec4 clearCoatBumpMapData,\rin vec2 vClearCoatBumpUV,\r#if defined(TANGENT) && defined(NORMAL)\nin mat3 vTBN,\r#else\nin vec2 vClearCoatTangentSpaceParams,\r#endif\n#ifdef OBJECTSPACE_NORMALMAP\nin mat4 normalMatrix,\r#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nin vec3 faceNormal,\r#endif\n#ifdef REFLECTION\nin vec3 vReflectionMicrosurfaceInfos,\rin vec2 vReflectionInfos,\rin vec3 vReflectionColor,\rin vec4 vLightingIntensity,\r#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\r#else\nin sampler2D reflectionSampler,\r#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\rin samplerCube reflectionSamplerHigh,\r#else\nin sampler2D reflectionSamplerLow,\rin sampler2D reflectionSamplerHigh,\r#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\r#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nin float ambientMonochrome,\r#endif\n#endif\n#if defined(CLEARCOAT_BUMP) || defined(TWOSIDEDLIGHTING)\nin float frontFacingMultiplier,\r#endif\nout clearcoatOutParams outParams\r)\r{\rfloat clearCoatIntensity=vClearCoatParams.x;\rfloat clearCoatRoughness=vClearCoatParams.y;\r#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\r#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\r#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\r#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL\nclearCoatRoughness*=clearCoatMapData.y;\r#else\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\r#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\routParams.clearCoatRoughness=clearCoatRoughness;\r#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\rfloat clearCoatThickness=vClearCoatTintParams.a;\r#ifdef CLEARCOAT_TINT_TEXTURE\n#ifdef CLEARCOAT_TINT_GAMMATEXTURE\nclearCoatColor*=toLinearSpace(clearCoatTintMapData.rgb);\r#else\nclearCoatColor*=clearCoatTintMapData.rgb;\r#endif\nclearCoatThickness*=clearCoatTintMapData.a;\r#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\r#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\routParams.clearCoatThickness=clearCoatThickness;\r#endif\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\r#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\r#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\rvec3 clearCoatNormalW=geometricNormalW;\r#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\r#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\r#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\r#else\nvec2 TBNClearCoatUV=vClearCoatBumpUV*frontFacingMultiplier;\rmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,TBNClearCoatUV,vClearCoatTangentSpaceParams);\r#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\r#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz *2.0-1.0);\rclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\r#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\r#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\r#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=clearCoatNormalW*frontFacingMultiplier;\r#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\routParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\rfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\rfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\r#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\r#endif\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatVRefract=refract(-viewDirectionW,clearCoatNormalW,vClearCoatRefractionParams.y);\routParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\r#endif\n#if defined(ENVIRONMENTBRDF) && (!defined(REFLECTIONMAP_SKYBOX) || defined(MS_BRDF_ENERGY_CONSERVATION))\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\r#endif\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\r#ifdef SPECULARAA\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\r#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\rvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\r#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\r#endif\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\r#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\r#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\r#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\r#endif\nsampleReflectionTexture(\rclearCoatAlphaG,\rvReflectionMicrosurfaceInfos,\rvReflectionInfos,\rvReflectionColor,\r#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\r#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\r#endif\nreflectionSampler,\rclearCoatReflectionCoords,\r#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\rreflectionSamplerHigh,\r#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\r#endif\nenvironmentClearCoatRadiance\r);\r#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\r#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\r#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\rclearCoatEnvironmentReflectance*=clearCoatEho;\r#endif\n#endif\n#endif\n#else\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\r#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\r#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\r#endif\noutParams.finalClearCoatRadianceScaled=\renvironmentClearCoatRadiance.rgb *\rclearCoatEnvironmentReflectance *\rvLightingIntensity.z;\r#endif\n#if defined(CLEARCOAT_TINT)\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\r#endif\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\rfresnelIBLClearCoat*=clearCoatIntensity;\routParams.conservationFactor=(1.-fresnelIBLClearCoat);\r#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\r#endif\n}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockClearcoat = { name, shader };\n"]}
@@ -6,7 +6,16 @@ vec3 surfaceAlbedo;
6
6
  #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)
7
7
  vec3 ambientOcclusionColor;
8
8
  #if DEBUGMODE>0
9
- vec4 surfaceMetallicColorMap;
9
+ #ifdef METALLICWORKFLOW
10
+ vec2 metallicRoughness;
11
+ vec4 surfaceMetallicColorMap;
12
+ #ifndef FROSTBITE_REFLECTANCE
13
+ vec3 metallicF0;
14
+ #else
15
+ #ifdef REFLECTIVITY
16
+ vec4 surfaceReflectivityColorMap;
17
+ #endif
18
+ #endif
10
19
  };
11
20
  void reflectivityBlock(
12
21
  in vec3 surfaceAlbedo,
@@ -1 +1 @@
1
- {"version":3,"file":"pbrBlockReflectivity.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockReflectivity.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuHd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,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 = \"pbrBlockReflectivity\";\nconst shader = `struct reflectivityOutParams\r{\rfloat microSurface;\rfloat roughness;\rvec3 surfaceReflectivityColor;\r#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\r#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\r#endif\n#if DEBUGMODE>0\nvec4 surfaceMetallicColorMap;\rvec4 surfaceReflectivityColorMap;\rvec2 metallicRoughness;\rvec3 metallicF0;\r#endif\n};\r#define pbr_inline\nvoid reflectivityBlock(\rin vec4 vReflectivityColor,\r#ifdef METALLICWORKFLOW\nin vec3 surfaceAlbedo,\rin vec4 metallicReflectanceFactors,\r#endif\n#ifdef REFLECTIVITY\nin vec3 reflectivityInfos,\rin vec4 surfaceMetallicOrReflectivityColorMap,\r#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nin vec3 ambientOcclusionColorIn,\r#endif\n#ifdef MICROSURFACEMAP\nin vec4 microSurfaceTexel,\r#endif\n#ifdef DETAIL\nin vec4 detailColor,\rin vec4 vDetailInfos,\r#endif\nout reflectivityOutParams outParams\r)\r{\rfloat microSurface=vReflectivityColor.a;\rvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\r#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\r#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\r#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\routParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\r#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\r#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\r#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\r#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\r#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);\rfloat loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);\rfloat hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);\rmetallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\r#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\r#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\nmicroSurface=1.0-metallicRoughness.g;\rvec3 baseColor=surfaceAlbedo;\r#ifdef FROSTBITE_REFLECTANCE\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\rsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\r#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\r#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\r#endif\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\rsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\r#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\r#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\r#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\rmicroSurface*=reflectivityInfos.z;\r#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\r#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\nmicroSurface=saturate(microSurface);\rfloat roughness=1.-microSurface;\routParams.microSurface=microSurface;\routParams.roughness=roughness;\routParams.surfaceReflectivityColor=surfaceReflectivityColor;\r}\r`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockReflectivity = { name, shader };\n"]}
1
+ {"version":3,"file":"pbrBlockReflectivity.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockReflectivity.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgId,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,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 = \"pbrBlockReflectivity\";\nconst shader = `struct reflectivityOutParams\r{\rfloat microSurface;\rfloat roughness;\rvec3 surfaceReflectivityColor;\r#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\r#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\r#endif\n#if DEBUGMODE>0\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness;\r#ifdef REFLECTIVITY\nvec4 surfaceMetallicColorMap;\r#endif\n#ifndef FROSTBITE_REFLECTANCE\nvec3 metallicF0;\r#endif\n#else\n#ifdef REFLECTIVITY\nvec4 surfaceReflectivityColorMap;\r#endif\n#endif\n#endif\n};\r#define pbr_inline\nvoid reflectivityBlock(\rin vec4 vReflectivityColor,\r#ifdef METALLICWORKFLOW\nin vec3 surfaceAlbedo,\rin vec4 metallicReflectanceFactors,\r#endif\n#ifdef REFLECTIVITY\nin vec3 reflectivityInfos,\rin vec4 surfaceMetallicOrReflectivityColorMap,\r#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nin vec3 ambientOcclusionColorIn,\r#endif\n#ifdef MICROSURFACEMAP\nin vec4 microSurfaceTexel,\r#endif\n#ifdef DETAIL\nin vec4 detailColor,\rin vec4 vDetailInfos,\r#endif\nout reflectivityOutParams outParams\r)\r{\rfloat microSurface=vReflectivityColor.a;\rvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\r#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\r#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\r#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\routParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\r#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\r#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\r#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\r#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\r#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);\rfloat loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);\rfloat hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);\rmetallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\r#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\r#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\nmicroSurface=1.0-metallicRoughness.g;\rvec3 baseColor=surfaceAlbedo;\r#ifdef FROSTBITE_REFLECTANCE\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\rsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\r#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\r#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\r#endif\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\rsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\r#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\r#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\r#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\rmicroSurface*=reflectivityInfos.z;\r#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\r#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\r#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\nmicroSurface=saturate(microSurface);\rfloat roughness=1.-microSurface;\routParams.microSurface=microSurface;\routParams.roughness=roughness;\routParams.surfaceReflectivityColor=surfaceReflectivityColor;\r}\r`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockReflectivity = { name, shader };\n"]}
@@ -9,7 +9,11 @@ float sheenAlbedoScaling;
9
9
  #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
10
10
  vec3 finalSheenRadianceScaled;
11
11
  #if DEBUGMODE>0
12
- vec4 sheenMapData;
12
+ #ifdef SHEEN_TEXTURE
13
+ vec4 sheenMapData;
14
+ #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)
15
+ vec3 sheenEnvironmentReflectance;
16
+ #endif
13
17
  };
14
18
  #define inline
15
19
  void sheenBlock(
@@ -1 +1 @@
1
- {"version":3,"file":"pbrBlockSheen.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockSheen.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Ld,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,gBAAgB;AAChB,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockSheen\";\nconst shader = `#ifdef SHEEN\nstruct sheenOutParams\r{\rfloat sheenIntensity;\rvec3 sheenColor;\rfloat sheenRoughness;\r#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\r#endif\n#if DEBUGMODE>0\nvec4 sheenMapData;\rvec3 sheenEnvironmentReflectance;\r#endif\n};\r#define pbr_inline\n#define inline\nvoid sheenBlock(\rin vec4 vSheenColor,\r#ifdef SHEEN_ROUGHNESS\nin float vSheenRoughness,\r#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nin vec4 sheenMapRoughnessData,\r#endif\n#endif\nin float roughness,\r#ifdef SHEEN_TEXTURE\nin vec4 sheenMapData,\rin float sheenMapLevel,\r#endif\nin float reflectance,\r#ifdef SHEEN_LINKWITHALBEDO\nin vec3 baseColor,\rin vec3 surfaceAlbedo,\r#endif\n#ifdef ENVIRONMENTBRDF\nin float NdotV,\rin vec3 environmentBrdf,\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nin vec2 AARoughnessFactors,\rin vec3 vReflectionMicrosurfaceInfos,\rin vec2 vReflectionInfos,\rin vec3 vReflectionColor,\rin vec4 vLightingIntensity,\r#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\rin vec3 reflectionCoords,\r#else\nin sampler2D reflectionSampler,\rin vec2 reflectionCoords,\r#endif\nin float NdotVUnclamped,\r#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\rin samplerCube reflectionSamplerHigh,\r#else\nin sampler2D reflectionSamplerLow,\rin sampler2D reflectionSamplerHigh,\r#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nin float seo,\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nin float eho,\r#endif\n#endif\nout sheenOutParams outParams\r)\r{\rfloat sheenIntensity=vSheenColor.a;\r#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\r#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\rvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\rfloat sheenRoughness=sheenIntensity;\routParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\r#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\r#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\r#ifdef SHEEN_TEXTURE\n#ifdef SHEEN_GAMMATEXTURE\nsheenColor.rgb*=toLinearSpace(sheenMapData.rgb);\r#else\nsheenColor.rgb*=sheenMapData.rgb;\r#endif\nsheenColor.rgb*=sheenMapLevel;\r#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\r#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\r#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\n#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL\nsheenRoughness*=sheenMapData.a;\r#else\nsheenRoughness*=sheenMapRoughnessData.a;\r#endif\n#endif\n#else\nfloat sheenRoughness=roughness;\r#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\r#endif\n#endif\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\r#endif\nsheenColor*=sheenIntensity;\r#endif\n#ifdef ENVIRONMENTBRDF\n/*#ifdef SHEEN_SOFTER\rvec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));\r#else*/\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\r#else\nvec3 environmentSheenBrdf=environmentBrdf;\r#endif\n/*#endif*/\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\r#ifdef SPECULARAA\nsheenAlphaG+=AARoughnessFactors.y;\r#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\rsampleReflectionTexture(\rsheenAlphaG,\rvReflectionMicrosurfaceInfos,\rvReflectionInfos,\rvReflectionColor,\r#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\r#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\r#endif\nreflectionSampler,\rreflectionCoords,\r#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\rreflectionSamplerHigh,\r#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\r#endif\nenvironmentSheenRadiance\r);\rvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\r#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\r#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\r#endif\noutParams.finalSheenRadianceScaled=\renvironmentSheenRadiance.rgb *\rsheenEnvironmentReflectance *\rvLightingIntensity.z;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\r#endif\noutParams.sheenIntensity=sheenIntensity;\routParams.sheenColor=sheenColor;\routParams.sheenRoughness=sheenRoughness;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockSheen = { name, shader };\n"]}
1
+ {"version":3,"file":"pbrBlockSheen.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockSheen.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkMd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,gBAAgB;AAChB,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockSheen\";\nconst shader = `#ifdef SHEEN\nstruct sheenOutParams\r{\rfloat sheenIntensity;\rvec3 sheenColor;\rfloat sheenRoughness;\r#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\r#endif\n#if DEBUGMODE>0\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData;\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 sheenEnvironmentReflectance;\r#endif\n#endif\n};\r#define pbr_inline\n#define inline\nvoid sheenBlock(\rin vec4 vSheenColor,\r#ifdef SHEEN_ROUGHNESS\nin float vSheenRoughness,\r#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nin vec4 sheenMapRoughnessData,\r#endif\n#endif\nin float roughness,\r#ifdef SHEEN_TEXTURE\nin vec4 sheenMapData,\rin float sheenMapLevel,\r#endif\nin float reflectance,\r#ifdef SHEEN_LINKWITHALBEDO\nin vec3 baseColor,\rin vec3 surfaceAlbedo,\r#endif\n#ifdef ENVIRONMENTBRDF\nin float NdotV,\rin vec3 environmentBrdf,\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nin vec2 AARoughnessFactors,\rin vec3 vReflectionMicrosurfaceInfos,\rin vec2 vReflectionInfos,\rin vec3 vReflectionColor,\rin vec4 vLightingIntensity,\r#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSampler,\rin vec3 reflectionCoords,\r#else\nin sampler2D reflectionSampler,\rin vec2 reflectionCoords,\r#endif\nin float NdotVUnclamped,\r#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nin samplerCube reflectionSamplerLow,\rin samplerCube reflectionSamplerHigh,\r#else\nin sampler2D reflectionSamplerLow,\rin sampler2D reflectionSamplerHigh,\r#endif\n#endif\n#ifdef REALTIME_FILTERING\nin vec2 vReflectionFilteringInfo,\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nin float seo,\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nin float eho,\r#endif\n#endif\nout sheenOutParams outParams\r)\r{\rfloat sheenIntensity=vSheenColor.a;\r#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\r#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\rvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\rfloat sheenRoughness=sheenIntensity;\routParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\r#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\r#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\r#ifdef SHEEN_TEXTURE\n#ifdef SHEEN_GAMMATEXTURE\nsheenColor.rgb*=toLinearSpace(sheenMapData.rgb);\r#else\nsheenColor.rgb*=sheenMapData.rgb;\r#endif\nsheenColor.rgb*=sheenMapLevel;\r#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\r#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\r#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\n#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL\nsheenRoughness*=sheenMapData.a;\r#else\nsheenRoughness*=sheenMapRoughnessData.a;\r#endif\n#endif\n#else\nfloat sheenRoughness=roughness;\r#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\r#endif\n#endif\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\r#endif\nsheenColor*=sheenIntensity;\r#endif\n#ifdef ENVIRONMENTBRDF\n/*#ifdef SHEEN_SOFTER\rvec3 environmentSheenBrdf=vec3(0.,0.,getBRDFLookupCharlieSheen(NdotV,sheenRoughness));\r#else*/\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\r#else\nvec3 environmentSheenBrdf=environmentBrdf;\r#endif\n/*#endif*/\r#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\r#ifdef SPECULARAA\nsheenAlphaG+=AARoughnessFactors.y;\r#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\rsampleReflectionTexture(\rsheenAlphaG,\rvReflectionMicrosurfaceInfos,\rvReflectionInfos,\rvReflectionColor,\r#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\r#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\r#endif\nreflectionSampler,\rreflectionCoords,\r#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\rreflectionSamplerHigh,\r#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\r#endif\nenvironmentSheenRadiance\r);\rvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\r#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\r#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\r#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\r#endif\noutParams.finalSheenRadianceScaled=\renvironmentSheenRadiance.rgb *\rsheenEnvironmentReflectance *\rvLightingIntensity.z;\r#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\r#endif\noutParams.sheenIntensity=sheenIntensity;\routParams.sheenColor=sheenColor;\routParams.sheenRoughness=sheenRoughness;\r}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockSheen = { name, shader };\n"]}
@@ -12,7 +12,11 @@ vec3 transmittance;
12
12
  vec3 refractionIrradiance;
13
13
  #endif
14
14
  #if DEBUGMODE>0
15
- vec4 thicknessMap;
15
+ #ifdef SS_THICKNESSANDMASK_TEXTURE
16
+ vec4 thicknessMap;
17
+ #ifdef SS_REFRACTION
18
+ vec4 environmentRefraction;
19
+ #endif
16
20
  };
17
21
  #define pbr_inline
18
22
  #define inline
@@ -1 +1 @@
1
- {"version":3,"file":"pbrBlockSubSurface.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockSubSurface.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Ud,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockSubSurface\";\nconst shader = `struct subSurfaceOutParams\r{\rvec3 specularEnvironmentReflectance;\r#ifdef SS_REFRACTION\nvec3 finalRefraction;\rvec3 surfaceAlbedo;\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\r#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\rfloat translucencyIntensity;\r#ifdef REFLECTION\nvec3 refractionIrradiance;\r#endif\n#endif\n#if DEBUGMODE>0\nvec4 thicknessMap;\rvec4 environmentRefraction;\rvec3 refractionTransmittance;\r#endif\n};\r#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\rin vec3 vSubSurfaceIntensity,\rin vec2 vThicknessParam,\rin vec4 vTintColor,\rin vec3 normalW,\rin vec3 specularEnvironmentReflectance,\r#ifdef SS_THICKNESSANDMASK_TEXTURE\nin vec4 thicknessMap,\r#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nin vec4 refractionIntensityMap,\r#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nin vec4 translucencyIntensityMap,\r#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nin mat4 reflectionMatrix,\r#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nin vec3 irradianceVector_,\r#endif\n#if defined(REALTIME_FILTERING)\nin samplerCube reflectionSampler,\rin vec2 vReflectionFilteringInfo,\r#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nin samplerCube irradianceSampler,\r#else\nin sampler2D irradianceSampler,\r#endif\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\nin vec3 surfaceAlbedo,\r#endif\n#ifdef SS_REFRACTION\nin vec3 vPositionW,\rin vec3 viewDirectionW,\rin mat4 view,\rin vec4 vRefractionInfos,\rin mat4 refractionMatrix,\rin vec4 vRefractionMicrosurfaceInfos,\rin vec4 vLightingIntensity,\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nin float alpha,\r#endif\n#ifdef SS_LODINREFRACTIONALPHA\nin float NdotVUnclamped,\r#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nin float roughness,\r#endif\nin float alphaG,\r#ifdef SS_REFRACTIONMAP_3D\nin samplerCube refractionSampler,\r#ifndef LODBASEDMICROSFURACE\nin samplerCube refractionSamplerLow,\rin samplerCube refractionSamplerHigh,\r#endif\n#else\nin sampler2D refractionSampler,\r#ifndef LODBASEDMICROSFURACE\nin sampler2D refractionSamplerLow,\rin sampler2D refractionSamplerHigh,\r#endif\n#endif\n#ifdef ANISOTROPIC\nin anisotropicOutParams anisotropicOut,\r#endif\n#ifdef REALTIME_FILTERING\nin vec2 vRefractionFilteringInfo,\r#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nin vec3 refractionPosition,\rin vec3 refractionSize,\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nin vec3 vDiffusionDistance,\r#endif\nout subSurfaceOutParams outParams\r)\r{\routParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\r#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\routParams.alpha=1.0;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\r#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if defined(SS_USE_GLTF_TEXTURES)\nfloat thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\r#else\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\r#endif\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\r#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE)\n#if defined(SS_USE_GLTF_TEXTURES)\nrefractionIntensity*=thicknessMap.r;\r#else\nrefractionIntensity*=thicknessMap.g;\r#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE)\ntranslucencyIntensity*=thicknessMap.b;\r#endif\n#endif\n#else\nfloat thickness=vThicknessParam.y;\r#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=refractionIntensityMap.r;\r#else\nrefractionIntensity*=refractionIntensityMap.g;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\ntranslucencyIntensity*=translucencyIntensityMap.b;\r#endif\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\rvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\rtransmittance*=translucencyIntensity;\routParams.transmittance=transmittance;\routParams.translucencyIntensity=translucencyIntensity;\r#endif\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\r#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\r#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\r#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\r#endif\n#ifdef SS_REFRACTIONMAP_3D\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);\r#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\rvec3 refractionCoords=refractionVector;\rrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\r#else\n#ifdef SS_USE_THICKNESS_AS_DEPTH\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));\r#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\r#endif\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\rrefractionCoords.y=1.0-refractionCoords.y;\r#endif\n#ifdef SS_HAS_THICKNESS\nfloat ior=vRefractionInfos.y;\r#else\nfloat ior=vRefractionMicrosurfaceInfos.w;\r#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionAlphaG=alphaG;\rrefractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);\r#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionRoughness=alphaG;\rrefractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);\r#else\nfloat refractionAlphaG=alphaG;\rrefractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);\r#endif\n#ifdef LODBASEDMICROSFURACE\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\r#ifdef SS_LODINREFRACTIONALPHA\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\rfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\r#else\nfloat requestedRefractionLOD=refractionLOD;\r#endif\n#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\r#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\r#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\rfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\rvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\rif (lodRefractionNormalizedDoubled<1.0){\renvironmentRefraction=mix(\rsampleRefraction(refractionSamplerHigh,refractionCoords),\renvironmentRefractionMid,\rlodRefractionNormalizedDoubled\r);\r} else {\renvironmentRefraction=mix(\renvironmentRefractionMid,\rsampleRefraction(refractionSamplerLow,refractionCoords),\rlodRefractionNormalizedDoubled-1.0\r);\r}\r#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\r#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\r#endif\nenvironmentRefraction.rgb*=vRefractionInfos.x;\r#endif\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\r#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\rrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\r#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\rvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\renvironmentRefraction.rgb*=volumeAlbedo;\r#else\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\rrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\r#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\r#endif\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\r#ifdef REFLECTION\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\r#endif\n#ifdef UNUSED_MULTIPLEBOUNCES\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\routParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\r#endif\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\r#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\r#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\r#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\r#endif\n#endif\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\r#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\r#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\r#endif\n#else\nvec3 irradianceVector=irradianceVector_;\r#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\r#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\r#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\r#else\nvec2 irradianceCoords=irradianceVector.xy;\r#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\r#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\r#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\r#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\r#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\r#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\r#endif\nrefractionIrradiance.rgb*=transmittance;\r#ifdef SS_ALBEDOFORTRANSLUCENCYTINT\nrefractionIrradiance.rgb*=surfaceAlbedo.rgb;\r#endif\noutParams.refractionIrradiance=refractionIrradiance.rgb;\r#endif\n}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockSubSurface = { name, shader };\n"]}
1
+ {"version":3,"file":"pbrBlockSubSurface.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockSubSurface.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Ud,CAAC;AACF,aAAa;AACb,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockSubSurface\";\nconst shader = `struct subSurfaceOutParams\r{\rvec3 specularEnvironmentReflectance;\r#ifdef SS_REFRACTION\nvec3 finalRefraction;\rvec3 surfaceAlbedo;\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\r#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\rfloat translucencyIntensity;\r#ifdef REFLECTION\nvec3 refractionIrradiance;\r#endif\n#endif\n#if DEBUGMODE>0\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap;\r#endif\n#ifdef SS_REFRACTION\nvec4 environmentRefraction;\rvec3 refractionTransmittance;\r#endif\n#endif\n};\r#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\rin vec3 vSubSurfaceIntensity,\rin vec2 vThicknessParam,\rin vec4 vTintColor,\rin vec3 normalW,\rin vec3 specularEnvironmentReflectance,\r#ifdef SS_THICKNESSANDMASK_TEXTURE\nin vec4 thicknessMap,\r#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\nin vec4 refractionIntensityMap,\r#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\nin vec4 translucencyIntensityMap,\r#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nin mat4 reflectionMatrix,\r#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nin vec3 irradianceVector_,\r#endif\n#if defined(REALTIME_FILTERING)\nin samplerCube reflectionSampler,\rin vec2 vReflectionFilteringInfo,\r#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nin samplerCube irradianceSampler,\r#else\nin sampler2D irradianceSampler,\r#endif\n#endif\n#endif\n#endif\n#if defined(SS_REFRACTION) || defined(SS_TRANSLUCENCY)\nin vec3 surfaceAlbedo,\r#endif\n#ifdef SS_REFRACTION\nin vec3 vPositionW,\rin vec3 viewDirectionW,\rin mat4 view,\rin vec4 vRefractionInfos,\rin mat4 refractionMatrix,\rin vec4 vRefractionMicrosurfaceInfos,\rin vec4 vLightingIntensity,\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nin float alpha,\r#endif\n#ifdef SS_LODINREFRACTIONALPHA\nin float NdotVUnclamped,\r#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nin float roughness,\r#endif\nin float alphaG,\r#ifdef SS_REFRACTIONMAP_3D\nin samplerCube refractionSampler,\r#ifndef LODBASEDMICROSFURACE\nin samplerCube refractionSamplerLow,\rin samplerCube refractionSamplerHigh,\r#endif\n#else\nin sampler2D refractionSampler,\r#ifndef LODBASEDMICROSFURACE\nin sampler2D refractionSamplerLow,\rin sampler2D refractionSamplerHigh,\r#endif\n#endif\n#ifdef ANISOTROPIC\nin anisotropicOutParams anisotropicOut,\r#endif\n#ifdef REALTIME_FILTERING\nin vec2 vRefractionFilteringInfo,\r#endif\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nin vec3 refractionPosition,\rin vec3 refractionSize,\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nin vec3 vDiffusionDistance,\r#endif\nout subSurfaceOutParams outParams\r)\r{\routParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\r#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\r#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\routParams.alpha=1.0;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\r#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if defined(SS_USE_GLTF_TEXTURES)\nfloat thickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\r#else\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\r#endif\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\r#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#if defined(SS_REFRACTION) && defined(SS_REFRACTION_USE_INTENSITY_FROM_TEXTURE)\n#if defined(SS_USE_GLTF_TEXTURES)\nrefractionIntensity*=thicknessMap.r;\r#else\nrefractionIntensity*=thicknessMap.g;\r#endif\n#endif\n#if defined(SS_TRANSLUCENCY) && defined(SS_TRANSLUCENCY_USE_INTENSITY_FROM_TEXTURE)\ntranslucencyIntensity*=thicknessMap.b;\r#endif\n#endif\n#else\nfloat thickness=vThicknessParam.y;\r#endif\n#ifdef SS_REFRACTIONINTENSITY_TEXTURE\n#ifdef SS_USE_GLTF_TEXTURES\nrefractionIntensity*=refractionIntensityMap.r;\r#else\nrefractionIntensity*=refractionIntensityMap.g;\r#endif\n#endif\n#ifdef SS_TRANSLUCENCYINTENSITY_TEXTURE\ntranslucencyIntensity*=translucencyIntensityMap.b;\r#endif\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\rvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\rtransmittance*=translucencyIntensity;\routParams.transmittance=transmittance;\routParams.translucencyIntensity=translucencyIntensity;\r#endif\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\r#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\r#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\r#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\r#endif\n#ifdef SS_REFRACTIONMAP_3D\n#ifdef SS_USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(vPositionW,refractionVector,refractionSize,refractionPosition);\r#endif\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\rvec3 refractionCoords=refractionVector;\rrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\r#else\n#ifdef SS_USE_THICKNESS_AS_DEPTH\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*thickness,1.0)));\r#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\r#endif\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\rrefractionCoords.y=1.0-refractionCoords.y;\r#endif\n#ifdef SS_HAS_THICKNESS\nfloat ior=vRefractionInfos.y;\r#else\nfloat ior=vRefractionMicrosurfaceInfos.w;\r#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionAlphaG=alphaG;\rrefractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG,NdotVUnclamped);\r#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionRoughness=alphaG;\rrefractionRoughness=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,refractionRoughness);\r#else\nfloat refractionAlphaG=alphaG;\rrefractionAlphaG=mix(alphaG,0.0,clamp(ior*3.0-2.0,0.0,1.0));\rfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,refractionAlphaG);\r#endif\n#ifdef LODBASEDMICROSFURACE\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\r#ifdef SS_LODINREFRACTIONALPHA\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\rfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\r#else\nfloat requestedRefractionLOD=refractionLOD;\r#endif\n#if defined(REALTIME_FILTERING) && defined(SS_REFRACTIONMAP_3D)\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\r#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\r#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\rfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\rvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\rif (lodRefractionNormalizedDoubled<1.0){\renvironmentRefraction=mix(\rsampleRefraction(refractionSamplerHigh,refractionCoords),\renvironmentRefractionMid,\rlodRefractionNormalizedDoubled\r);\r} else {\renvironmentRefraction=mix(\renvironmentRefractionMid,\rsampleRefraction(refractionSamplerLow,refractionCoords),\rlodRefractionNormalizedDoubled-1.0\r);\r}\r#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\r#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\r#endif\nenvironmentRefraction.rgb*=vRefractionInfos.x;\r#endif\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\r#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\rrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\r#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\rvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\renvironmentRefraction.rgb*=volumeAlbedo;\r#else\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\rrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\r#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\r#endif\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\r#ifdef REFLECTION\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\r#endif\n#ifdef UNUSED_MULTIPLEBOUNCES\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\routParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\r#endif\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\r#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\r#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\r#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\r#endif\n#endif\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\r#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\r#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\r#endif\n#else\nvec3 irradianceVector=irradianceVector_;\r#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\r#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\r#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\r#else\nvec2 irradianceCoords=irradianceVector.xy;\r#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\r#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\r#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\r#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\r#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\r#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\r#endif\nrefractionIrradiance.rgb*=transmittance;\r#ifdef SS_ALBEDOFORTRANSLUCENCYTINT\nrefractionIrradiance.rgb*=surfaceAlbedo.rgb;\r#endif\noutParams.refractionIrradiance=refractionIrradiance.rgb;\r#endif\n}\r#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStore[name] = shader;\n/** @internal */\nexport const pbrBlockSubSurface = { name, shader };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "6.13.0",
3
+ "version": "6.14.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -9,7 +9,8 @@
9
9
  "**/*.d.ts",
10
10
  "**/*.map",
11
11
  "readme.md",
12
- "license.md"
12
+ "license.md",
13
+ "NOTICE.md"
13
14
  ],
14
15
  "scripts": {
15
16
  "build": "npm run clean && npm run compile",