pbrFragmentSamplersDeclaration.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. import "./samplerFragmentDeclaration.js";
  4. import "./samplerFragmentAlternateDeclaration.js";
  5. const name = "pbrFragmentSamplersDeclaration";
  6. const shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
  7. #include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)
  8. #include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)
  9. #include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)
  10. #include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)
  11. #include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)
  12. #include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)
  13. #include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)
  14. #include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)
  15. #include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)
  16. #ifdef CLEARCOAT
  17. #include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)
  18. #include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
  19. #if defined(CLEARCOAT_TEXTURE_ROUGHNESS)
  20. uniform sampler2D clearCoatRoughnessSampler;
  21. #endif
  22. #include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)
  23. #include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)
  24. #endif
  25. #ifdef IRIDESCENCE
  26. #include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)
  27. #include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)
  28. #endif
  29. #ifdef SHEEN
  30. #include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)
  31. #include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
  32. #if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)
  33. uniform sampler2D sheenRoughnessSampler;
  34. #endif
  35. #endif
  36. #ifdef ANISOTROPIC
  37. #include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
  38. #endif
  39. #ifdef REFLECTION
  40. #ifdef REFLECTIONMAP_3D
  41. #define sampleReflection(s,c) textureCube(s,c)
  42. uniform samplerCube reflectionSampler;
  43. #ifdef LODBASEDMICROSFURACE
  44. #define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
  45. #else
  46. uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
  47. #endif
  48. #ifdef USEIRRADIANCEMAP
  49. uniform samplerCube irradianceSampler;
  50. #endif
  51. #else
  52. #define sampleReflection(s,c) texture2D(s,c)
  53. uniform sampler2D reflectionSampler;
  54. #ifdef LODBASEDMICROSFURACE
  55. #define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
  56. #else
  57. uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
  58. #endif
  59. #ifdef USEIRRADIANCEMAP
  60. uniform sampler2D irradianceSampler;
  61. #endif
  62. #endif
  63. #ifdef REFLECTIONMAP_SKYBOX
  64. varying vec3 vPositionUVW;
  65. #else
  66. #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
  67. varying vec3 vDirectionW;
  68. #endif
  69. #endif
  70. #endif
  71. #ifdef ENVIRONMENTBRDF
  72. uniform sampler2D environmentBrdfSampler;
  73. #endif
  74. #ifdef SUBSURFACE
  75. #ifdef SS_REFRACTION
  76. #ifdef SS_REFRACTIONMAP_3D
  77. #define sampleRefraction(s,c) textureCube(s,c)
  78. uniform samplerCube refractionSampler;
  79. #ifdef LODBASEDMICROSFURACE
  80. #define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)
  81. #else
  82. uniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh;
  83. #endif
  84. #else
  85. #define sampleRefraction(s,c) texture2D(s,c)
  86. uniform sampler2D refractionSampler;
  87. #ifdef LODBASEDMICROSFURACE
  88. #define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)
  89. #else
  90. uniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh;
  91. #endif
  92. #endif
  93. #endif
  94. #include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)
  95. #include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)
  96. #include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)
  97. #endif
  98. `;
  99. // Sideeffect
  100. ShaderStore.IncludesShadersStore[name] = shader;
  101. /** @internal */
  102. export const pbrFragmentSamplersDeclaration = { name, shader };
  103. //# sourceMappingURL=pbrFragmentSamplersDeclaration.js.map