@onerjs/core 8.46.6 → 8.46.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/Extensions/engine.multiview.js +6 -0
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/constants.d.ts +9 -4
- package/Engines/constants.js +9 -4
- package/Engines/constants.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +38 -11
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +4 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +4 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +155 -53
- package/Materials/PBR/openpbrMaterial.js +149 -61
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +36 -31
- package/Materials/PBR/pbrBaseMaterial.js +4 -34
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/environmentLighting.defines.d.ts +31 -0
- package/Materials/environmentLighting.defines.js +33 -0
- package/Materials/environmentLighting.defines.js.map +1 -0
- package/Materials/material.js +1 -0
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.functions.js +8 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.js +10 -3
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +43 -0
- package/Materials/prepass.defines.js +45 -0
- package/Materials/prepass.defines.js.map +1 -0
- package/Materials/standardMaterial.d.ts +36 -31
- package/Materials/standardMaterial.js +2 -32
- package/Materials/standardMaterial.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +12 -4
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsConstraint.js +1 -0
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +3 -9
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +35 -12
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +20 -0
- package/Rendering/geometryBufferRenderer.js +203 -14
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/objectRenderer.js +1 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +7 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +5 -0
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +77 -0
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +37 -17
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +43 -17
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +10 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +14 -38
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +4 -2
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js +35 -0
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js +1 -1
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +9 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js +67 -0
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +14 -3
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.js +43 -0
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.js.map +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -32
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/sceneFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/sceneFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/sceneUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/Shaders/geometry.fragment.d.ts +12 -0
- package/Shaders/geometry.fragment.js +102 -1
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/geometry.vertex.d.ts +1 -0
- package/Shaders/geometry.vertex.js +46 -2
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.d.ts +1 -0
- package/Shaders/iblShadowVoxelTracing.fragment.js +2 -5
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +3 -1
- package/Shaders/openpbr.fragment.js +69 -8
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +11 -5
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +5 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +3 -2
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +101 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +39 -19
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -13
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +14 -34
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +5 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js +35 -0
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js +68 -0
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +15 -4
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +2 -2
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.js +39 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -28
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +2 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.d.ts +11 -0
- package/ShadersWGSL/geometry.fragment.js +103 -1
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/geometry.vertex.d.ts +1 -0
- package/ShadersWGSL/geometry.vertex.js +47 -3
- package/ShadersWGSL/geometry.vertex.js.map +1 -1
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.d.ts +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +3 -7
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +3 -1
- package/ShadersWGSL/openpbr.fragment.js +70 -9
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +6 -0
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +7 -0
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openpbrIblFunctions.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrIblFunctions.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyNd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrIblFunctions\";\nconst shader = `#ifdef REFLECTION\nvec3 sampleIrradiance(\nin vec3 surfaceNormal\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,in vec3 vEnvironmentIrradianceSH\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,in mat4 iblMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,in samplerCube irradianceSampler\n#else\n,in sampler2D irradianceSampler\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,in vec3 reflectionDominantDirection\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,in sampler2D icdfSampler\n#endif\n#endif\n,in vec2 vReflectionInfos\n,in vec3 viewDirectionW\n,in float diffuseRoughness\n,in vec3 surfaceAlbedo\n) {vec3 environmentIrradiance=vec3(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\nvec3 irradianceVector=(iblMatrix*vec4(surfaceNormal,0)).xyz;vec3 irradianceView=(iblMatrix*vec4(viewDirectionW,0)).xyz;\n#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\n{float NdotV=max(dot(surfaceNormal,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness);}\n#endif\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradianceSH;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,irradianceVector);\n#else\nvec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradianceFromTexture.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradianceFromTexture);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\nvec3 Ls=normalize(reflectionDominantDirection);float NoL=dot(irradianceVector,Ls);float NoV=dot(irradianceVector,irradianceView);vec3 diffuseRoughnessTerm=vec3(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nfloat LoV=dot (Ls,irradianceView);float mag=length(reflectionDominantDirection)*2.0;vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0)));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvec3 H=(irradianceView+Ls)*0.5;float VoH=dot(irradianceView,H);diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\nenvironmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm;\n#endif\n#endif\nenvironmentIrradiance*=vReflectionInfos.x;return environmentIrradiance;}\n#define pbr_inline\n#ifdef REFLECTIONMAP_3D\nvec3 createReflectionCoords(\n#else\nvec2 createReflectionCoords(\n#endif\nin vec3 vPositionW\n,in vec3 normalW\n)\n{vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\nreturn reflectionCoords;}\n#define pbr_inline\n#define inline\nvec3 sampleRadiance(\nin float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in geometryInfoOutParams geoInfo\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n,const vec3 reflectionCoords\n#else\n,in sampler2D reflectionSampler\n,const vec2 reflectionCoords\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n)\n{vec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\nenvironmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;}\n#if defined(ANISOTROPIC)\n#define pbr_inline\n#define inline\nvec3 sampleRadianceAnisotropic(\nin float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in geometryInfoAnisoOutParams geoInfo\n,const vec3 normalW\n,const vec3 viewDirectionW\n,const vec3 positionW\n,const vec3 noise\n,bool isRefraction\n,float ior\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n#else\n,in sampler2D reflectionSampler\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n)\n{vec4 environmentRadiance=vec4(0.,0.,0.,0.);float alphaT=alphaG*sqrt(2.0/(1.0+(1.0-geoInfo.anisotropy)*(1.0-geoInfo.anisotropy)));float alphaB=(1.0-geoInfo.anisotropy)*alphaT;alphaG=alphaB;\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef REALTIME_FILTERING\nvec3 view=(reflectionMatrix*vec4(viewDirectionW,0.0)).xyz;vec3 tangent=(reflectionMatrix*vec4(geoInfo.anisotropicTangent,0.0)).xyz;vec3 bitangent=(reflectionMatrix*vec4(geoInfo.anisotropicBitangent,0.0)).xyz;vec3 normal=(reflectionMatrix*vec4(normalW,0.0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nview.z*=-1.0;tangent.z*=-1.0;bitangent.z*=-1.0;normal.z*=-1.0;\n#endif\nenvironmentRadiance =\nvec4(radianceAnisotropic(alphaT,alphaB,reflectionSampler,\nview,tangent,\nbitangent,normal,\nvReflectionFilteringInfo,noise.xy,isRefraction,ior),\n1.0);\n#else\nconst int samples=16;vec4 radianceSample=vec4(0.0);vec3 reflectionCoords=vec3(0.0);float sample_weight=0.0;float total_weight=0.0;float step=1.0/float(max(samples-1,1));for (int i=0; i<samples; ++i) {float t=mix(-1.0,1.0,float(i)*step);t+=step*2.0*noise.x;sample_weight=max(1.0-abs(t),0.001);sample_weight*=sample_weight;t*=min(4.0*alphaT*geoInfo.anisotropy,1.0);vec3 bentNormal;if (t<0.0) {float blend=t+1.0;bentNormal=normalize(mix(-geoInfo.anisotropicTangent,normalW,blend));} else if (t>0.0) {float blend=t;bentNormal=normalize(mix(normalW,geoInfo.anisotropicTangent,blend));} else {bentNormal=normalW;}\nif (isRefraction) {reflectionCoords=double_refract(-viewDirectionW,bentNormal,ior);} else {reflectionCoords=reflect(-viewDirectionW,bentNormal);}\nreflectionCoords=vec3(reflectionMatrix*vec4(reflectionCoords,0));\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionCoords.z*=-1.0;\n#endif\nradianceSample=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb+=sample_weight*fromRGBD(radianceSample);\n#elif defined(GAMMAREFLECTION)\nenvironmentRadiance.rgb+=sample_weight*toLinearSpace(radianceSample.rgb);\n#else\nenvironmentRadiance.rgb+=sample_weight*radianceSample.rgb;\n#endif\ntotal_weight+=sample_weight;}\nenvironmentRadiance=vec4(environmentRadiance.xyz/float(total_weight),1.0);\n#endif\nenvironmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;}\n#endif\n#define pbr_inline\nvec3 conductorIblFresnel(in ReflectanceParams reflectance,in float NdotV,in float roughness,in vec3 environmentBrdf)\n{\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nvec3 albedoF0=mix(reflectance.coloredF0,pow(reflectance.coloredF0,vec3(1.4)),roughness);return getF82Specular(NdotV,albedoF0,reflectance.coloredF90,roughness);\n#else\nreturn getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90,environmentBrdf);\n#endif\n}\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrIblFunctions = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"openpbrIblFunctions.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrIblFunctions.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Nd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrIblFunctions\";\nconst shader = `#ifdef REFLECTION\nvec3 sampleIrradiance(\nin vec3 surfaceNormal\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n,in vec3 vEnvironmentIrradianceSH\n#endif\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\n,in mat4 iblMatrix\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\n,in samplerCube irradianceSampler\n#else\n,in sampler2D irradianceSampler\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\n,in vec3 reflectionDominantDirection\n#endif\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#ifdef IBL_CDF_FILTERING\n,in sampler2D icdfSampler\n#endif\n#endif\n,in vec2 vReflectionInfos\n,in vec3 viewDirectionW\n,in float diffuseRoughness\n,in vec3 surfaceAlbedo\n) {vec3 environmentIrradiance=vec3(0.,0.,0.);\n#if (defined(USESPHERICALFROMREFLECTIONMAP) && (!defined(NORMAL) || !defined(USESPHERICALINVERTEX))) || (defined(USEIRRADIANCEMAP) && defined(REFLECTIONMAP_3D))\nvec3 irradianceVector=(iblMatrix*vec4(surfaceNormal,0)).xyz;vec3 irradianceView=(iblMatrix*vec4(viewDirectionW,0)).xyz;\n#if !defined(USE_IRRADIANCE_DOMINANT_DIRECTION) && !defined(REALTIME_FILTERING)\n#if BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LAMBERT && BASE_DIFFUSE_MODEL != BRDF_DIFFUSE_MODEL_LEGACY\n{float NdotV=max(dot(surfaceNormal,viewDirectionW),0.0);irradianceVector=mix(irradianceVector,irradianceView,(0.5*(1.0-NdotV))*diffuseRoughness);}\n#endif\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;irradianceView.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;irradianceView.y*=-1.0;\n#endif\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradianceSH;\n#else\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo,diffuseRoughness,surfaceAlbedo,irradianceView\n#ifdef IBL_CDF_FILTERING\n,icdfSampler\n#endif\n);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,irradianceVector);\n#else\nvec4 environmentIrradianceFromTexture=sampleReflection(irradianceSampler,reflectionCoords);\n#endif\nenvironmentIrradiance=environmentIrradianceFromTexture.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradianceFromTexture);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#ifdef USE_IRRADIANCE_DOMINANT_DIRECTION\nvec3 Ls=normalize(reflectionDominantDirection);float NoL=dot(irradianceVector,Ls);float NoV=dot(irradianceVector,irradianceView);vec3 diffuseRoughnessTerm=vec3(1.0);\n#if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON\nfloat LoV=dot (Ls,irradianceView);float mag=length(reflectionDominantDirection)*2.0;vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;diffuseRoughnessTerm=diffuseRoughnessTerm/clampedAlbedo;diffuseRoughnessTerm=mix(vec3(1.0),diffuseRoughnessTerm,sqrt(clamp(mag*NoV,0.0,1.0)));\n#elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY\nvec3 H=(irradianceView+Ls)*0.5;float VoH=dot(irradianceView,H);diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);\n#endif\nenvironmentIrradiance=environmentIrradiance.rgb*diffuseRoughnessTerm;\n#endif\n#endif\nenvironmentIrradiance*=vReflectionInfos.x;return environmentIrradiance;}\n#define pbr_inline\n#ifdef REFLECTIONMAP_3D\nvec3 createReflectionCoords(\n#else\nvec2 createReflectionCoords(\n#endif\nin vec3 vPositionW\n,in vec3 normalW\n)\n{vec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\nreturn reflectionCoords;}\n#define pbr_inline\n#define inline\nvec3 sampleRadiance(\nin float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in geometryInfoOutParams geoInfo\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n,const vec3 reflectionCoords\n#else\n,in sampler2D reflectionSampler\n,const vec2 reflectionCoords\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n)\n{vec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\nenvironmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;}\n#if defined(ANISOTROPIC)\n#define pbr_inline\n#define inline\nvec3 sampleRadianceAnisotropic(\nin float alphaG\n,in vec3 vReflectionMicrosurfaceInfos\n,in vec2 vReflectionInfos\n,in geometryInfoAnisoOutParams geoInfo\n,const vec3 normalW\n,const vec3 viewDirectionW\n,const vec3 positionW\n,const vec3 noise\n,bool isRefraction\n,float ior\n#ifdef REFLECTIONMAP_3D\n,in samplerCube reflectionSampler\n#else\n,in sampler2D reflectionSampler\n#endif\n#ifdef REALTIME_FILTERING\n,in vec2 vReflectionFilteringInfo\n#endif\n)\n{vec4 environmentRadiance=vec4(0.,0.,0.,0.);float alphaT=alphaG*sqrt(2.0/(1.0+(1.0-geoInfo.anisotropy)*(1.0-geoInfo.anisotropy)));float alphaB=(1.0-geoInfo.anisotropy)*alphaT;alphaG=alphaB;\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,geoInfo.NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef REALTIME_FILTERING\nvec3 view=(reflectionMatrix*vec4(viewDirectionW,0.0)).xyz;vec3 tangent=(reflectionMatrix*vec4(geoInfo.anisotropicTangent,0.0)).xyz;vec3 bitangent=(reflectionMatrix*vec4(geoInfo.anisotropicBitangent,0.0)).xyz;vec3 normal=(reflectionMatrix*vec4(normalW,0.0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nview.z*=-1.0;tangent.z*=-1.0;bitangent.z*=-1.0;normal.z*=-1.0;\n#endif\nenvironmentRadiance =\nvec4(radianceAnisotropic(alphaT,alphaB,reflectionSampler,\nview,tangent,\nbitangent,normal,\nvReflectionFilteringInfo,noise.xy,isRefraction,ior),\n1.0);\n#else\nconst int samples=16;vec4 radianceSample=vec4(0.0);vec3 reflectionCoords=vec3(0.0);float sample_weight=0.0;float total_weight=0.0;float step=1.0/float(max(samples-1,1));for (int i=0; i<samples; ++i) {float t=mix(-1.0,1.0,float(i)*step);t+=step*2.0*noise.x;sample_weight=max(1.0-abs(t),0.001);sample_weight*=sample_weight;t*=min(4.0*alphaT*geoInfo.anisotropy,1.0);vec3 bentNormal;if (t<0.0) {float blend=t+1.0;bentNormal=normalize(mix(-geoInfo.anisotropicTangent,normalW,blend));} else if (t>0.0) {float blend=t;bentNormal=normalize(mix(normalW,geoInfo.anisotropicTangent,blend));} else {bentNormal=normalW;}\nif (isRefraction) {reflectionCoords=double_refract(-viewDirectionW,bentNormal,ior);} else {reflectionCoords=reflect(-viewDirectionW,bentNormal);}\nreflectionCoords=vec3(reflectionMatrix*vec4(reflectionCoords,0));\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionCoords.z*=-1.0;\n#endif\nradianceSample=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb+=sample_weight*fromRGBD(radianceSample);\n#elif defined(GAMMAREFLECTION)\nenvironmentRadiance.rgb+=sample_weight*toLinearSpace(radianceSample.rgb);\n#else\nenvironmentRadiance.rgb+=sample_weight*radianceSample.rgb;\n#endif\ntotal_weight+=sample_weight;}\nenvironmentRadiance=vec4(environmentRadiance.xyz/float(total_weight),1.0);\n#endif\nenvironmentRadiance.rgb*=vec3(vReflectionInfos.x);return environmentRadiance.rgb;}\n#endif\n#ifdef ENVIRONMENTBRDF\n#define pbr_inline\nvec3 conductorIblFresnel(in ReflectanceParams reflectance,in float NdotV,in float roughness,in vec3 environmentBrdf)\n{\n#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)\nvec3 albedoF0=mix(reflectance.coloredF0,pow(reflectance.coloredF0,vec3(1.4)),roughness);return getF82Specular(NdotV,albedoF0,reflectance.coloredF90,roughness);\n#else\nreturn getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90,environmentBrdf);\n#endif\n}\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrIblFunctions = { name, shader };\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
const name = "openpbrSubsurfaceLayerData";
|
|
4
|
+
const shader = `float subsurface_weight=vSubsurfaceWeight;vec3 subsurface_color=vSubsurfaceColor.rgb;float subsurface_radius=vSubsurfaceRadius;vec3 subsurface_radius_scale=vSubsurfaceRadiusScale;float subsurface_scatter_anisotropy=clamp(vSubsurfaceScatterAnisotropy,-0.9999,0.9999);
|
|
5
|
+
#ifdef SUBSURFACE_WEIGHT
|
|
6
|
+
vec4 subsurfaceWeightFromTexture=texture2D(subsurfaceWeightSampler,vSubsurfaceWeightUV+uvOffset);
|
|
7
|
+
#endif
|
|
8
|
+
#ifdef SUBSURFACE_COLOR
|
|
9
|
+
vec4 subsurfaceColorFromTexture=texture2D(subsurfaceColorSampler,vSubsurfaceColorUV+uvOffset);
|
|
10
|
+
#endif
|
|
11
|
+
#ifdef SUBSURFACE_RADIUS_SCALE
|
|
12
|
+
vec4 subsurfaceRadiusScaleFromTexture=texture2D(subsurfaceRadiusScaleSampler,vSubsurfaceRadiusScaleUV+uvOffset);
|
|
13
|
+
#endif
|
|
14
|
+
#ifdef SUBSURFACE_WEIGHT
|
|
15
|
+
subsurface_weight*=subsurfaceWeightFromTexture.r;
|
|
16
|
+
#endif
|
|
17
|
+
#ifdef SUBSURFACE_COLOR
|
|
18
|
+
#ifdef SUBSURFACE_COLOR_GAMMA
|
|
19
|
+
subsurface_color*=toLinearSpace(subsurfaceColorFromTexture.rgb);
|
|
20
|
+
#else
|
|
21
|
+
subsurface_color*=subsurfaceColorFromTexture.rgb;
|
|
22
|
+
#endif
|
|
23
|
+
subsurface_color*=vSubsurfaceColorInfos.y;
|
|
24
|
+
#endif
|
|
25
|
+
#ifdef SUBSURFACE_RADIUS_SCALE
|
|
26
|
+
subsurface_radius_scale*=subsurfaceRadiusScaleFromTexture.rgb;
|
|
27
|
+
#endif
|
|
28
|
+
`;
|
|
29
|
+
// Sideeffect
|
|
30
|
+
if (!ShaderStore.IncludesShadersStore[name]) {
|
|
31
|
+
ShaderStore.IncludesShadersStore[name] = shader;
|
|
32
|
+
}
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const openpbrSubsurfaceLayerData = { name, shader };
|
|
35
|
+
//# sourceMappingURL=openpbrSubsurfaceLayerData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openpbrSubsurfaceLayerData.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAC1C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrSubsurfaceLayerData\";\nconst shader = `float subsurface_weight=vSubsurfaceWeight;vec3 subsurface_color=vSubsurfaceColor.rgb;float subsurface_radius=vSubsurfaceRadius;vec3 subsurface_radius_scale=vSubsurfaceRadiusScale;float subsurface_scatter_anisotropy=clamp(vSubsurfaceScatterAnisotropy,-0.9999,0.9999);\n#ifdef SUBSURFACE_WEIGHT\nvec4 subsurfaceWeightFromTexture=texture2D(subsurfaceWeightSampler,vSubsurfaceWeightUV+uvOffset);\n#endif\n#ifdef SUBSURFACE_COLOR\nvec4 subsurfaceColorFromTexture=texture2D(subsurfaceColorSampler,vSubsurfaceColorUV+uvOffset);\n#endif\n#ifdef SUBSURFACE_RADIUS_SCALE\nvec4 subsurfaceRadiusScaleFromTexture=texture2D(subsurfaceRadiusScaleSampler,vSubsurfaceRadiusScaleUV+uvOffset);\n#endif\n#ifdef SUBSURFACE_WEIGHT\nsubsurface_weight*=subsurfaceWeightFromTexture.r;\n#endif\n#ifdef SUBSURFACE_COLOR\n#ifdef SUBSURFACE_COLOR_GAMMA\nsubsurface_color*=toLinearSpace(subsurfaceColorFromTexture.rgb);\n#else\nsubsurface_color*=subsurfaceColorFromTexture.rgb;\n#endif\nsubsurface_color*=vSubsurfaceColorInfos.y;\n#endif\n#ifdef SUBSURFACE_RADIUS_SCALE\nsubsurface_radius_scale*=subsurfaceRadiusScaleFromTexture.rgb;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrSubsurfaceLayerData = { name, shader };\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
3
|
const name = "openpbrTransmissionLayerData";
|
|
4
|
-
const shader = `float transmission_weight=vTransmissionWeight;vec3 transmission_color=vTransmissionColor.rgb;float transmission_depth=vTransmissionDepth;vec3 transmission_scatter=vTransmissionScatter.rgb;float transmission_scatter_anisotropy=vTransmissionScatterAnisotropy;float transmission_dispersion_scale=vTransmissionDispersionScale;float transmission_dispersion_abbe_number=vTransmissionDispersionAbbeNumber;
|
|
4
|
+
const shader = `float transmission_weight=vTransmissionWeight;vec3 transmission_color=vTransmissionColor.rgb;float transmission_depth=vTransmissionDepth;vec3 transmission_scatter=vTransmissionScatter.rgb;float transmission_scatter_anisotropy=clamp(vTransmissionScatterAnisotropy,-0.9999,0.9999);float transmission_dispersion_scale=vTransmissionDispersionScale;float transmission_dispersion_abbe_number=vTransmissionDispersionAbbeNumber;
|
|
5
5
|
#ifdef TRANSMISSION_WEIGHT
|
|
6
6
|
vec4 transmissionWeightFromTexture=texture2D(transmissionWeightSampler,vTransmissionWeightUV+uvOffset);
|
|
7
7
|
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openpbrTransmissionLayerData.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrTransmissionLayerData.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrTransmissionLayerData\";\nconst shader = `float transmission_weight=vTransmissionWeight;vec3 transmission_color=vTransmissionColor.rgb;float transmission_depth=vTransmissionDepth;vec3 transmission_scatter=vTransmissionScatter.rgb;float transmission_scatter_anisotropy=vTransmissionScatterAnisotropy;float transmission_dispersion_scale=vTransmissionDispersionScale;float transmission_dispersion_abbe_number=vTransmissionDispersionAbbeNumber;\n#ifdef TRANSMISSION_WEIGHT\nvec4 transmissionWeightFromTexture=texture2D(transmissionWeightSampler,vTransmissionWeightUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_COLOR\nvec4 transmissionColorFromTexture=texture2D(transmissionColorSampler,vTransmissionColorUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_DEPTH\nvec4 transmissionDepthFromTexture=texture2D(transmissionDepthSampler,vTransmissionDepthUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_SCATTER\nvec4 transmissionScatterFromTexture=texture2D(transmissionScatterSampler,vTransmissionScatterUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_DISPERSION_SCALE\nvec4 transmissionDispersionScaleFromTexture=texture2D(transmissionDispersionScaleSampler,vTransmissionDispersionScaleUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_WEIGHT\ntransmission_weight*=transmissionWeightFromTexture.r;\n#endif\n#ifdef TRANSMISSION_COLOR\n#ifdef TRANSMISSION_COLOR_GAMMA\ntransmission_color*=toLinearSpace(transmissionColorFromTexture.rgb);\n#else\ntransmission_color*=transmissionColorFromTexture.rgb;\n#endif\ntransmission_color*=vTransmissionColorInfos.y;\n#endif\n#ifdef TRANSMISSION_DEPTH\ntransmission_depth*=transmissionDepthFromTexture.r;\n#endif\n#ifdef TRANSMISSION_SCATTER\ntransmission_scatter*=transmissionScatterFromTexture.rgb;\n#endif\n#ifdef TRANSMISSION_DISPERSION_SCALE\ntransmission_dispersion_scale*=transmissionDispersionScaleFromTexture.r;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrTransmissionLayerData = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"openpbrTransmissionLayerData.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrTransmissionLayerData.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrTransmissionLayerData\";\nconst shader = `float transmission_weight=vTransmissionWeight;vec3 transmission_color=vTransmissionColor.rgb;float transmission_depth=vTransmissionDepth;vec3 transmission_scatter=vTransmissionScatter.rgb;float transmission_scatter_anisotropy=clamp(vTransmissionScatterAnisotropy,-0.9999,0.9999);float transmission_dispersion_scale=vTransmissionDispersionScale;float transmission_dispersion_abbe_number=vTransmissionDispersionAbbeNumber;\n#ifdef TRANSMISSION_WEIGHT\nvec4 transmissionWeightFromTexture=texture2D(transmissionWeightSampler,vTransmissionWeightUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_COLOR\nvec4 transmissionColorFromTexture=texture2D(transmissionColorSampler,vTransmissionColorUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_DEPTH\nvec4 transmissionDepthFromTexture=texture2D(transmissionDepthSampler,vTransmissionDepthUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_SCATTER\nvec4 transmissionScatterFromTexture=texture2D(transmissionScatterSampler,vTransmissionScatterUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_DISPERSION_SCALE\nvec4 transmissionDispersionScaleFromTexture=texture2D(transmissionDispersionScaleSampler,vTransmissionDispersionScaleUV+uvOffset);\n#endif\n#ifdef TRANSMISSION_WEIGHT\ntransmission_weight*=transmissionWeightFromTexture.r;\n#endif\n#ifdef TRANSMISSION_COLOR\n#ifdef TRANSMISSION_COLOR_GAMMA\ntransmission_color*=toLinearSpace(transmissionColorFromTexture.rgb);\n#else\ntransmission_color*=transmissionColorFromTexture.rgb;\n#endif\ntransmission_color*=vTransmissionColorInfos.y;\n#endif\n#ifdef TRANSMISSION_DEPTH\ntransmission_depth*=transmissionDepthFromTexture.r;\n#endif\n#ifdef TRANSMISSION_SCATTER\ntransmission_scatter*=transmissionScatterFromTexture.rgb;\n#endif\n#ifdef TRANSMISSION_DISPERSION_SCALE\ntransmission_dispersion_scale*=transmissionDispersionScaleFromTexture.r;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrTransmissionLayerData = { name, shader };\n"]}
|
|
@@ -3,7 +3,7 @@ import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
|
3
3
|
import "./sceneUboDeclaration.js";
|
|
4
4
|
import "./meshUboDeclaration.js";
|
|
5
5
|
const name = "openpbrUboDeclaration";
|
|
6
|
-
const shader = `layout(std140,column_major) uniform;uniform Material {vec2 vTangentSpaceParams;vec4 vLightingIntensity;float pointSize;vec2 vDebugMode;vec4 cameraInfo;mat4 backgroundRefractionMatrix;vec3 vBackgroundRefractionInfos;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;float vBaseWeight;vec4 vBaseColor;float vBaseDiffuseRoughness;vec4 vReflectanceInfo;vec4 vSpecularColor;vec3 vSpecularAnisotropy;float vTransmissionWeight;vec3 vTransmissionColor;float vTransmissionDepth;vec3 vTransmissionScatter;float vTransmissionScatterAnisotropy;float vTransmissionDispersionScale;float vTransmissionDispersionAbbeNumber;float vCoatWeight;vec3 vCoatColor;float vCoatRoughness;float vCoatRoughnessAnisotropy;float vCoatIor;float vCoatDarkening;float vFuzzWeight;vec3 vFuzzColor;float vFuzzRoughness;vec2 vGeometryCoatTangent;float vGeometryThickness;vec3 vEmissionColor;float vThinFilmWeight;vec2 vThinFilmThickness;float vThinFilmIor;vec2 vBaseWeightInfos;mat4 baseWeightMatrix;vec2 vBaseColorInfos;mat4 baseColorMatrix;vec2 vBaseDiffuseRoughnessInfos;mat4 baseDiffuseRoughnessMatrix;vec2 vBaseMetalnessInfos;mat4 baseMetalnessMatrix;vec2 vSpecularWeightInfos;mat4 specularWeightMatrix;vec2 vSpecularColorInfos;mat4 specularColorMatrix;vec2 vSpecularRoughnessInfos;mat4 specularRoughnessMatrix;vec2 vSpecularRoughnessAnisotropyInfos;mat4 specularRoughnessAnisotropyMatrix;vec2 vTransmissionWeightInfos;mat4 transmissionWeightMatrix;vec2 vTransmissionColorInfos;mat4 transmissionColorMatrix;vec2 vTransmissionDepthInfos;mat4 transmissionDepthMatrix;vec2 vTransmissionScatterInfos;mat4 transmissionScatterMatrix;vec2 vTransmissionDispersionScaleInfos;mat4 transmissionDispersionScaleMatrix;vec2 vCoatWeightInfos;mat4 coatWeightMatrix;vec2 vCoatColorInfos;mat4 coatColorMatrix;vec2 vCoatRoughnessInfos;mat4 coatRoughnessMatrix;vec2 vCoatRoughnessAnisotropyInfos;mat4 coatRoughnessAnisotropyMatrix;vec2 vCoatDarkeningInfos;mat4 coatDarkeningMatrix;vec2 vFuzzWeightInfos;mat4 fuzzWeightMatrix;vec2 vFuzzColorInfos;mat4 fuzzColorMatrix;vec2 vFuzzRoughnessInfos;mat4 fuzzRoughnessMatrix;vec2 vGeometryNormalInfos;mat4 geometryNormalMatrix;vec2 vGeometryTangentInfos;mat4 geometryTangentMatrix;vec2 vGeometryCoatNormalInfos;mat4 geometryCoatNormalMatrix;vec2 vGeometryCoatTangentInfos;mat4 geometryCoatTangentMatrix;vec2 vGeometryOpacityInfos;mat4 geometryOpacityMatrix;vec2 vGeometryThicknessInfos;mat4 geometryThicknessMatrix;vec2 vEmissionColorInfos;mat4 emissionColorMatrix;vec2 vThinFilmWeightInfos;mat4 thinFilmWeightMatrix;vec2 vThinFilmThicknessInfos;mat4 thinFilmThicknessMatrix;vec2 vAmbientOcclusionInfos;mat4 ambientOcclusionMatrix;
|
|
6
|
+
const shader = `layout(std140,column_major) uniform;uniform Material {vec2 vTangentSpaceParams;vec4 vLightingIntensity;float pointSize;vec2 vDebugMode;vec2 renderTargetSize;vec4 cameraInfo;mat4 backgroundRefractionMatrix;vec3 vBackgroundRefractionInfos;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;float vBaseWeight;vec4 vBaseColor;float vBaseDiffuseRoughness;vec4 vReflectanceInfo;vec4 vSpecularColor;vec3 vSpecularAnisotropy;float vTransmissionWeight;vec3 vTransmissionColor;float vTransmissionDepth;vec3 vTransmissionScatter;float vTransmissionScatterAnisotropy;float vTransmissionDispersionScale;float vTransmissionDispersionAbbeNumber;float vSubsurfaceWeight;vec3 vSubsurfaceColor;float vSubsurfaceRadius;vec3 vSubsurfaceRadiusScale;float vSubsurfaceScatterAnisotropy;float vCoatWeight;vec3 vCoatColor;float vCoatRoughness;float vCoatRoughnessAnisotropy;float vCoatIor;float vCoatDarkening;float vFuzzWeight;vec3 vFuzzColor;float vFuzzRoughness;float vGeometryThinWalled;vec2 vGeometryCoatTangent;float vGeometryThickness;vec3 vEmissionColor;float vThinFilmWeight;vec2 vThinFilmThickness;float vThinFilmIor;vec2 vBaseWeightInfos;mat4 baseWeightMatrix;vec2 vBaseColorInfos;mat4 baseColorMatrix;vec2 vBaseDiffuseRoughnessInfos;mat4 baseDiffuseRoughnessMatrix;vec2 vBaseMetalnessInfos;mat4 baseMetalnessMatrix;vec2 vSpecularWeightInfos;mat4 specularWeightMatrix;vec2 vSpecularColorInfos;mat4 specularColorMatrix;vec2 vSpecularRoughnessInfos;mat4 specularRoughnessMatrix;vec2 vSpecularRoughnessAnisotropyInfos;mat4 specularRoughnessAnisotropyMatrix;vec2 vTransmissionWeightInfos;mat4 transmissionWeightMatrix;vec2 vTransmissionColorInfos;mat4 transmissionColorMatrix;vec2 vTransmissionDepthInfos;mat4 transmissionDepthMatrix;vec2 vTransmissionScatterInfos;mat4 transmissionScatterMatrix;vec2 vTransmissionDispersionScaleInfos;mat4 transmissionDispersionScaleMatrix;vec2 vSubsurfaceWeightInfos;mat4 subsurfaceWeightMatrix;vec2 vSubsurfaceColorInfos;mat4 subsurfaceColorMatrix;vec2 vSubsurfaceRadiusScaleInfos;mat4 subsurfaceRadiusScaleMatrix;vec2 vCoatWeightInfos;mat4 coatWeightMatrix;vec2 vCoatColorInfos;mat4 coatColorMatrix;vec2 vCoatRoughnessInfos;mat4 coatRoughnessMatrix;vec2 vCoatRoughnessAnisotropyInfos;mat4 coatRoughnessAnisotropyMatrix;vec2 vCoatDarkeningInfos;mat4 coatDarkeningMatrix;vec2 vFuzzWeightInfos;mat4 fuzzWeightMatrix;vec2 vFuzzColorInfos;mat4 fuzzColorMatrix;vec2 vFuzzRoughnessInfos;mat4 fuzzRoughnessMatrix;vec2 vGeometryNormalInfos;mat4 geometryNormalMatrix;vec2 vGeometryTangentInfos;mat4 geometryTangentMatrix;vec2 vGeometryCoatNormalInfos;mat4 geometryCoatNormalMatrix;vec2 vGeometryCoatTangentInfos;mat4 geometryCoatTangentMatrix;vec2 vGeometryOpacityInfos;mat4 geometryOpacityMatrix;vec2 vGeometryThicknessInfos;mat4 geometryThicknessMatrix;vec2 vEmissionColorInfos;mat4 emissionColorMatrix;vec2 vThinFilmWeightInfos;mat4 thinFilmWeightMatrix;vec2 vThinFilmThicknessInfos;mat4 thinFilmThicknessMatrix;vec2 vAmbientOcclusionInfos;mat4 ambientOcclusionMatrix;
|
|
7
7
|
#define ADDITIONAL_UBO_DECLARATION
|
|
8
8
|
};
|
|
9
9
|
#include<sceneUboDeclaration>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openpbrUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAE9B,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneUboDeclaration\";\nimport \"./meshUboDeclaration\";\n\nconst name = \"openpbrUboDeclaration\";\nconst shader = `layout(std140,column_major) uniform;uniform Material {vec2 vTangentSpaceParams;vec4 vLightingIntensity;float pointSize;vec2 vDebugMode;vec4 cameraInfo;mat4 backgroundRefractionMatrix;vec3 vBackgroundRefractionInfos;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;float vBaseWeight;vec4 vBaseColor;float vBaseDiffuseRoughness;vec4 vReflectanceInfo;vec4 vSpecularColor;vec3 vSpecularAnisotropy;float vTransmissionWeight;vec3 vTransmissionColor;float vTransmissionDepth;vec3 vTransmissionScatter;float vTransmissionScatterAnisotropy;float vTransmissionDispersionScale;float vTransmissionDispersionAbbeNumber;float vCoatWeight;vec3 vCoatColor;float vCoatRoughness;float vCoatRoughnessAnisotropy;float vCoatIor;float vCoatDarkening;float vFuzzWeight;vec3 vFuzzColor;float vFuzzRoughness;vec2 vGeometryCoatTangent;float vGeometryThickness;vec3 vEmissionColor;float vThinFilmWeight;vec2 vThinFilmThickness;float vThinFilmIor;vec2 vBaseWeightInfos;mat4 baseWeightMatrix;vec2 vBaseColorInfos;mat4 baseColorMatrix;vec2 vBaseDiffuseRoughnessInfos;mat4 baseDiffuseRoughnessMatrix;vec2 vBaseMetalnessInfos;mat4 baseMetalnessMatrix;vec2 vSpecularWeightInfos;mat4 specularWeightMatrix;vec2 vSpecularColorInfos;mat4 specularColorMatrix;vec2 vSpecularRoughnessInfos;mat4 specularRoughnessMatrix;vec2 vSpecularRoughnessAnisotropyInfos;mat4 specularRoughnessAnisotropyMatrix;vec2 vTransmissionWeightInfos;mat4 transmissionWeightMatrix;vec2 vTransmissionColorInfos;mat4 transmissionColorMatrix;vec2 vTransmissionDepthInfos;mat4 transmissionDepthMatrix;vec2 vTransmissionScatterInfos;mat4 transmissionScatterMatrix;vec2 vTransmissionDispersionScaleInfos;mat4 transmissionDispersionScaleMatrix;vec2 vCoatWeightInfos;mat4 coatWeightMatrix;vec2 vCoatColorInfos;mat4 coatColorMatrix;vec2 vCoatRoughnessInfos;mat4 coatRoughnessMatrix;vec2 vCoatRoughnessAnisotropyInfos;mat4 coatRoughnessAnisotropyMatrix;vec2 vCoatDarkeningInfos;mat4 coatDarkeningMatrix;vec2 vFuzzWeightInfos;mat4 fuzzWeightMatrix;vec2 vFuzzColorInfos;mat4 fuzzColorMatrix;vec2 vFuzzRoughnessInfos;mat4 fuzzRoughnessMatrix;vec2 vGeometryNormalInfos;mat4 geometryNormalMatrix;vec2 vGeometryTangentInfos;mat4 geometryTangentMatrix;vec2 vGeometryCoatNormalInfos;mat4 geometryCoatNormalMatrix;vec2 vGeometryCoatTangentInfos;mat4 geometryCoatTangentMatrix;vec2 vGeometryOpacityInfos;mat4 geometryOpacityMatrix;vec2 vGeometryThicknessInfos;mat4 geometryThicknessMatrix;vec2 vEmissionColorInfos;mat4 emissionColorMatrix;vec2 vThinFilmWeightInfos;mat4 thinFilmWeightMatrix;vec2 vThinFilmThicknessInfos;mat4 thinFilmThicknessMatrix;vec2 vAmbientOcclusionInfos;mat4 ambientOcclusionMatrix;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrUboDeclaration = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"openpbrUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC;AAE9B,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneUboDeclaration\";\nimport \"./meshUboDeclaration\";\n\nconst name = \"openpbrUboDeclaration\";\nconst shader = `layout(std140,column_major) uniform;uniform Material {vec2 vTangentSpaceParams;vec4 vLightingIntensity;float pointSize;vec2 vDebugMode;vec2 renderTargetSize;vec4 cameraInfo;mat4 backgroundRefractionMatrix;vec3 vBackgroundRefractionInfos;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;float vBaseWeight;vec4 vBaseColor;float vBaseDiffuseRoughness;vec4 vReflectanceInfo;vec4 vSpecularColor;vec3 vSpecularAnisotropy;float vTransmissionWeight;vec3 vTransmissionColor;float vTransmissionDepth;vec3 vTransmissionScatter;float vTransmissionScatterAnisotropy;float vTransmissionDispersionScale;float vTransmissionDispersionAbbeNumber;float vSubsurfaceWeight;vec3 vSubsurfaceColor;float vSubsurfaceRadius;vec3 vSubsurfaceRadiusScale;float vSubsurfaceScatterAnisotropy;float vCoatWeight;vec3 vCoatColor;float vCoatRoughness;float vCoatRoughnessAnisotropy;float vCoatIor;float vCoatDarkening;float vFuzzWeight;vec3 vFuzzColor;float vFuzzRoughness;float vGeometryThinWalled;vec2 vGeometryCoatTangent;float vGeometryThickness;vec3 vEmissionColor;float vThinFilmWeight;vec2 vThinFilmThickness;float vThinFilmIor;vec2 vBaseWeightInfos;mat4 baseWeightMatrix;vec2 vBaseColorInfos;mat4 baseColorMatrix;vec2 vBaseDiffuseRoughnessInfos;mat4 baseDiffuseRoughnessMatrix;vec2 vBaseMetalnessInfos;mat4 baseMetalnessMatrix;vec2 vSpecularWeightInfos;mat4 specularWeightMatrix;vec2 vSpecularColorInfos;mat4 specularColorMatrix;vec2 vSpecularRoughnessInfos;mat4 specularRoughnessMatrix;vec2 vSpecularRoughnessAnisotropyInfos;mat4 specularRoughnessAnisotropyMatrix;vec2 vTransmissionWeightInfos;mat4 transmissionWeightMatrix;vec2 vTransmissionColorInfos;mat4 transmissionColorMatrix;vec2 vTransmissionDepthInfos;mat4 transmissionDepthMatrix;vec2 vTransmissionScatterInfos;mat4 transmissionScatterMatrix;vec2 vTransmissionDispersionScaleInfos;mat4 transmissionDispersionScaleMatrix;vec2 vSubsurfaceWeightInfos;mat4 subsurfaceWeightMatrix;vec2 vSubsurfaceColorInfos;mat4 subsurfaceColorMatrix;vec2 vSubsurfaceRadiusScaleInfos;mat4 subsurfaceRadiusScaleMatrix;vec2 vCoatWeightInfos;mat4 coatWeightMatrix;vec2 vCoatColorInfos;mat4 coatColorMatrix;vec2 vCoatRoughnessInfos;mat4 coatRoughnessMatrix;vec2 vCoatRoughnessAnisotropyInfos;mat4 coatRoughnessAnisotropyMatrix;vec2 vCoatDarkeningInfos;mat4 coatDarkeningMatrix;vec2 vFuzzWeightInfos;mat4 fuzzWeightMatrix;vec2 vFuzzColorInfos;mat4 fuzzColorMatrix;vec2 vFuzzRoughnessInfos;mat4 fuzzRoughnessMatrix;vec2 vGeometryNormalInfos;mat4 geometryNormalMatrix;vec2 vGeometryTangentInfos;mat4 geometryTangentMatrix;vec2 vGeometryCoatNormalInfos;mat4 geometryCoatNormalMatrix;vec2 vGeometryCoatTangentInfos;mat4 geometryCoatTangentMatrix;vec2 vGeometryOpacityInfos;mat4 geometryOpacityMatrix;vec2 vGeometryThicknessInfos;mat4 geometryThicknessMatrix;vec2 vEmissionColorInfos;mat4 emissionColorMatrix;vec2 vThinFilmWeightInfos;mat4 thinFilmWeightMatrix;vec2 vThinFilmThicknessInfos;mat4 thinFilmThicknessMatrix;vec2 vAmbientOcclusionInfos;mat4 ambientOcclusionMatrix;\n#define ADDITIONAL_UBO_DECLARATION\n};\n#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrUboDeclaration = { name, shader };\n"]}
|
|
@@ -50,6 +50,15 @@ uniform vec2 vTransmissionDepthInfos;uniform mat4 transmissionDepthMatrix;
|
|
|
50
50
|
#ifdef TRANSMISSION_DISPERSION_SCALE
|
|
51
51
|
uniform vec2 vTransmissionDispersionScaleInfos;uniform mat4 transmissionDispersionScaleMatrix;
|
|
52
52
|
#endif
|
|
53
|
+
#ifdef SUBSURFACE_WEIGHT
|
|
54
|
+
uniform vec2 vSubsurfaceWeightInfos;uniform mat4 subsurfaceWeightMatrix;
|
|
55
|
+
#endif
|
|
56
|
+
#ifdef SUBSURFACE_COLOR
|
|
57
|
+
uniform vec2 vSubsurfaceColorInfos;uniform mat4 subsurfaceColorMatrix;
|
|
58
|
+
#endif
|
|
59
|
+
#ifdef SUBSURFACE_RADIUS_SCALE
|
|
60
|
+
uniform vec2 vSubsurfaceRadiusScaleInfos;uniform mat4 subsurfaceRadiusScaleMatrix;
|
|
61
|
+
#endif
|
|
53
62
|
#ifdef COAT_WEIGHT
|
|
54
63
|
uniform vec2 vCoatWeightInfos;uniform mat4 coatWeightMatrix;
|
|
55
64
|
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openpbrVertexDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrVertexDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAElC,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"openpbrVertexDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrVertexDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAElC,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Hd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneVertexDeclaration\";\nimport \"./decalVertexDeclaration\";\n\nconst name = \"openpbrVertexDeclaration\";\nconst shader = `#include<sceneVertexDeclaration>\n#ifdef BASE_COLOR\nuniform vec2 vBaseColorInfos;uniform mat4 baseColorMatrix;\n#endif\n#ifdef BASE_WEIGHT\nuniform mat4 baseWeightMatrix;uniform vec2 vBaseWeightInfos;\n#endif\nuniform float vBaseDiffuseRoughness;\n#ifdef BASE_DIFFUSE_ROUGHNESS\nuniform mat4 baseDiffuseRoughnessMatrix;uniform vec2 vBaseDiffuseRoughnessInfos;\n#endif\n#ifdef AMBIENT_OCCLUSION\nuniform vec2 vAmbientOcclusionInfos;uniform mat4 ambientOcclusionMatrix;\n#endif\n#ifdef EMISSION_COLOR\nuniform vec2 vEmissionColorInfos;uniform mat4 emissionColorMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;uniform mat4 lightmapMatrix;\n#endif\n#ifdef BASE_METALNESS\nuniform vec2 vBaseMetalnessInfos;uniform mat4 baseMetalnessMatrix;\n#endif\n#ifdef SPECULAR_WEIGHT\nuniform vec2 vSpecularWeightInfos;uniform mat4 specularWeightMatrix;\n#endif\n#ifdef SPECULAR_COLOR\nuniform vec2 vSpecularColorInfos;uniform mat4 specularColorMatrix;\n#endif\n#ifdef SPECULAR_ROUGHNESS\nuniform vec2 vSpecularRoughnessInfos;uniform mat4 specularRoughnessMatrix;\n#endif\n#ifdef SPECULAR_ROUGHNESS_ANISOTROPY\nuniform vec2 vSpecularRoughnessAnisotropyInfos;uniform mat4 specularRoughnessAnisotropyMatrix;\n#endif\n#ifdef TRANSMISSION_WEIGHT\nuniform vec2 vTransmissionWeightInfos;uniform mat4 transmissionWeightMatrix;\n#endif\n#ifdef TRANSMISSION_COLOR\nuniform vec2 vTransmissionColorInfos;uniform mat4 transmissionColorMatrix;\n#endif\n#ifdef TRANSMISSION_DEPTH\nuniform vec2 vTransmissionDepthInfos;uniform mat4 transmissionDepthMatrix;\n#endif\n#ifdef TRANSMISSION_DISPERSION_SCALE\nuniform vec2 vTransmissionDispersionScaleInfos;uniform mat4 transmissionDispersionScaleMatrix;\n#endif\n#ifdef SUBSURFACE_WEIGHT\nuniform vec2 vSubsurfaceWeightInfos;uniform mat4 subsurfaceWeightMatrix;\n#endif\n#ifdef SUBSURFACE_COLOR\nuniform vec2 vSubsurfaceColorInfos;uniform mat4 subsurfaceColorMatrix;\n#endif\n#ifdef SUBSURFACE_RADIUS_SCALE\nuniform vec2 vSubsurfaceRadiusScaleInfos;uniform mat4 subsurfaceRadiusScaleMatrix;\n#endif\n#ifdef COAT_WEIGHT\nuniform vec2 vCoatWeightInfos;uniform mat4 coatWeightMatrix;\n#endif\n#ifdef COAT_COLOR\nuniform vec2 vCoatColorInfos;uniform mat4 coatColorMatrix;\n#endif\n#ifdef COAT_ROUGHNESS\nuniform vec2 vCoatRoughnessInfos;uniform mat4 coatRoughnessMatrix;\n#endif\n#ifdef COAT_ROUGHNESS_ANISOTROPY\nuniform vec2 vCoatRoughnessAnisotropyInfos;uniform mat4 coatRoughnessAnisotropyMatrix;\n#endif\n#ifdef COAT_IOR\nuniform vec2 vCoatIorInfos;uniform mat4 coatIorMatrix;\n#endif\n#ifdef COAT_DARKENING\nuniform vec2 vCoatDarkeningInfos;uniform mat4 coatDarkeningMatrix;\n#endif\n#ifdef FUZZ_WEIGHT\nuniform vec2 vFuzzWeightInfos;uniform mat4 fuzzWeightMatrix;\n#endif\n#ifdef FUZZ_COLOR\nuniform vec2 vFuzzColorInfos;uniform mat4 fuzzColorMatrix;\n#endif\n#ifdef FUZZ_ROUGHNESS\nuniform vec2 vFuzzRoughnessInfos;uniform mat4 fuzzRoughnessMatrix;\n#endif\n#ifdef GEOMETRY_NORMAL\nuniform vec2 vGeometryNormalInfos;uniform mat4 geometryNormalMatrix;\n#endif\n#ifdef GEOMETRY_TANGENT\nuniform vec2 vGeometryTangentInfos;uniform mat4 geometryTangentMatrix;\n#endif\n#ifdef GEOMETRY_COAT_NORMAL\nuniform vec2 vGeometryCoatNormalInfos;uniform mat4 geometryCoatNormalMatrix;\n#endif\n#ifdef THIN_FILM_WEIGHT\nuniform vec2 vThinFilmWeightInfos;uniform mat4 thinFilmWeightMatrix;\n#endif\n#ifdef THIN_FILM_THICKNESS\nuniform vec2 vThinFilmThicknessInfos;uniform mat4 thinFilmThicknessMatrix;\n#endif\n#ifdef GEOMETRY_OPACITY\nuniform mat4 geometryOpacityMatrix;uniform vec2 vGeometryOpacityInfos;\n#endif\n#ifdef GEOMETRY_THICKNESS\nuniform mat4 geometryThicknessMatrix;uniform vec2 vGeometryThicknessInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nuniform vec4 cameraInfo;\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;uniform mat4 reflectionMatrix;\n#endif\n#ifdef NORMAL\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;uniform vec3 vSphericalL1_1;uniform vec3 vSphericalL10;uniform vec3 vSphericalL11;uniform vec3 vSphericalL2_2;uniform vec3 vSphericalL2_1;uniform vec3 vSphericalL20;uniform vec3 vSphericalL21;uniform vec3 vSphericalL22;\n#else\nuniform vec3 vSphericalX;uniform vec3 vSphericalY;uniform vec3 vSphericalZ;uniform vec3 vSphericalXX_ZZ;uniform vec3 vSphericalYY_ZZ;uniform vec3 vSphericalZZ;uniform vec3 vSphericalXY;uniform vec3 vSphericalYZ;uniform vec3 vSphericalZX;\n#endif\n#endif\n#endif\n#endif\n#ifdef DETAIL\nuniform vec4 vDetailInfos;uniform mat4 detailMatrix;\n#endif\n#include<decalVertexDeclaration>\n#define ADDITIONAL_VERTEX_DECLARATION\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrVertexDeclaration = { name, shader };\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
const name = "openpbrVolumeFunctions";
|
|
4
|
+
const shader = `struct OpenPBRHomogeneousVolume {vec3 extinction_coeff;
|
|
5
|
+
vec3 ss_albedo;
|
|
6
|
+
vec3 multi_scatter_color;
|
|
7
|
+
vec3 absorption_coeff;
|
|
8
|
+
vec3 scatter_coeff;
|
|
9
|
+
float anisotropy; };OpenPBRHomogeneousVolume computeOpenPBRTransmissionVolume(
|
|
10
|
+
in vec3 transmission_color,
|
|
11
|
+
in float transmission_depth,
|
|
12
|
+
in vec3 transmission_scatter,
|
|
13
|
+
in float anisotropy
|
|
14
|
+
)
|
|
15
|
+
{OpenPBRHomogeneousVolume volumeParams;volumeParams.absorption_coeff=vec3(0.0);volumeParams.scatter_coeff=vec3(0.0);volumeParams.anisotropy=anisotropy;
|
|
16
|
+
#ifdef GEOMETRY_THIN_WALLED
|
|
17
|
+
volumeParams.scatter_coeff=vec3(1.0);volumeParams.anisotropy=1.0;
|
|
18
|
+
volumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=vec3(1.0);
|
|
19
|
+
#else
|
|
20
|
+
if (transmission_depth>0.0) {vec3 invDepth=vec3(1./maxEps(transmission_depth));volumeParams.extinction_coeff=-log(maxEps(transmission_color.rgb))*invDepth;volumeParams.scatter_coeff=transmission_scatter.rgb*invDepth;volumeParams.absorption_coeff=volumeParams.extinction_coeff-volumeParams.scatter_coeff.rgb;float minCoeff=min3(volumeParams.absorption_coeff);if (minCoeff<0.0) {volumeParams.absorption_coeff-=vec3(minCoeff);}
|
|
21
|
+
volumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=volumeParams.scatter_coeff/(volumeParams.extinction_coeff);} else {volumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=vec3(0.0);}
|
|
22
|
+
#endif
|
|
23
|
+
return volumeParams;}
|
|
24
|
+
OpenPBRHomogeneousVolume computeOpenPBRSubsurfaceVolume(
|
|
25
|
+
in vec3 subsurface_color,
|
|
26
|
+
in float subsurface_radius,
|
|
27
|
+
in vec3 subsurface_radius_scale,
|
|
28
|
+
in float anisotropy
|
|
29
|
+
)
|
|
30
|
+
{OpenPBRHomogeneousVolume volumeParams;volumeParams.absorption_coeff=vec3(0.0);volumeParams.scatter_coeff=vec3(0.0);volumeParams.anisotropy=anisotropy;volumeParams.multi_scatter_color=subsurface_color;vec3 mfp=subsurface_radius_scale*vec3(subsurface_radius);volumeParams.extinction_coeff=vec3(1.0)/maxEps(mfp);volumeParams.ss_albedo=multiScatterToSingleScatterAlbedo(subsurface_color,anisotropy);volumeParams.scatter_coeff=volumeParams.ss_albedo*volumeParams.extinction_coeff;volumeParams.absorption_coeff=volumeParams.extinction_coeff-volumeParams.scatter_coeff.rgb;float minCoeff=min3(volumeParams.absorption_coeff);if (minCoeff<0.0) {volumeParams.absorption_coeff-=vec3(minCoeff);}
|
|
31
|
+
volumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;return volumeParams;}
|
|
32
|
+
vec3 sss_pdf(float r,vec3 d)
|
|
33
|
+
{d=max(vec3(1e-4f),d);return (exp(-r/d)+exp(-r/(3.0f*d)))/max(vec3(1e-5f),8.0f*PI*d*r);}
|
|
34
|
+
float sss_samples_pdf(float r,float d)
|
|
35
|
+
{d=max(1e-4f,d);return exp(-r/(3.0f*d))/(6.0f*PI*d*r);}
|
|
36
|
+
float sss_samples_icdf(float x,float d)
|
|
37
|
+
{d=max(1e-4f,d);x=max(1e-4f,x);return -3.0f*log(x)*d;}
|
|
38
|
+
float samples_scale(float x,float d)
|
|
39
|
+
{return 1.0f-exp(-x/(3.0f*d));}
|
|
40
|
+
vec3 sss_get_position(sampler2D depth_texture,vec2 tex_coord,vec2 render_resolution,mat4 inv_proj)
|
|
41
|
+
{vec4 P=vec4(tex_coord,texelFetch(depth_texture,ivec2(tex_coord*render_resolution),0).x,1.0f);P.xy=2.0f*P.xy-1.0f;P=inv_proj*P;return P.xyz/P.w;}
|
|
42
|
+
float sss_filter_scale(float currZ,mat4 proj)
|
|
43
|
+
{return 1.0f/dot(vec2(proj[2].w,proj[3].w),vec2(currZ,1.0f));}
|
|
44
|
+
float projective_to_pixels(float proj_dist,mat4 proj,vec2 resolution)
|
|
45
|
+
{return proj_dist*proj[1][1]*resolution.y;}
|
|
46
|
+
float pixels_to_projective(float pixel_dist,mat4 proj,vec2 resolution)
|
|
47
|
+
{return pixel_dist/(proj[1][1]*resolution.y);}
|
|
48
|
+
vec3 sss_convolve(sampler2D sss_irradiance_texture,sampler2D depth_texture,vec2 render_resolution,vec3 d,mat4 proj,mat4 inv_proj,int sample_count,vec2 noise)
|
|
49
|
+
{vec2 tex_coord=gl_FragCoord.xy/render_resolution;vec3 unconvolved_irradiance=texelFetch(sss_irradiance_texture,ivec2(gl_FragCoord.xy),0).rgb;vec3 curr_pos=sss_get_position(depth_texture,tex_coord,render_resolution,inv_proj);float dmax=max3(d);float max_dmax=0.1*float(sample_count);if (dmax>max_dmax)
|
|
50
|
+
{d.rgb*=max_dmax/dmax;dmax=max_dmax;}
|
|
51
|
+
float dz=dmax*sss_filter_scale(curr_pos.z,proj);mat2 projMat2d=mat2(proj);if (determinant(projMat2d)*dz<1e-4f)
|
|
52
|
+
return unconvolved_irradiance;float overscan_size_in_pixels=max(render_resolution.x,render_resolution.y)*0.1;const float filter_crop_ratio=0.8f;
|
|
53
|
+
float crop_radius=projective_to_pixels(sss_samples_icdf(1.0f-filter_crop_ratio,dz),proj,render_resolution);if (crop_radius>overscan_size_in_pixels)
|
|
54
|
+
{d.rgb*=overscan_size_in_pixels/crop_radius;dz*=overscan_size_in_pixels/crop_radius;}
|
|
55
|
+
float filter_samples_scale=samples_scale(pixels_to_projective(overscan_size_in_pixels,proj,render_resolution),dz);vec3 irradiance_sum=vec3(0.0f);vec3 weight_sum=vec3(0.0f);for (int i=0; i<sample_count; i++)
|
|
56
|
+
{vec2 r=fract(plasticSequence(uint(i+sample_count))+noise*0.2);r.x*=TWO_PI;r.y*=filter_samples_scale;float icdf=sss_samples_icdf(1.0-r.y,dz);vec2 sample_uv=tex_coord+icdf*projMat2d*vec2(cos(r.x),sin(r.x));vec4 sss_irradiance=texelFetch(sss_irradiance_texture,ivec2(sample_uv*render_resolution),0);float dist=distance(curr_pos,sss_get_position(depth_texture,sample_uv,render_resolution,inv_proj));if (dist>0.0f)
|
|
57
|
+
{vec3 weights=sss_irradiance.a/sss_samples_pdf(icdf,dz)*sss_pdf(dist,d.rgb);irradiance_sum+=weights*sss_irradiance.rgb;weight_sum+=weights;}}
|
|
58
|
+
return vec3(weight_sum.r<1e-5f ? unconvolved_irradiance.r : irradiance_sum.r/weight_sum.r,
|
|
59
|
+
weight_sum.g<1e-5f ? unconvolved_irradiance.g : irradiance_sum.g/weight_sum.g,
|
|
60
|
+
weight_sum.b<1e-5f ? unconvolved_irradiance.b : irradiance_sum.b/weight_sum.b);}`;
|
|
61
|
+
// Sideeffect
|
|
62
|
+
if (!ShaderStore.IncludesShadersStore[name]) {
|
|
63
|
+
ShaderStore.IncludesShadersStore[name] = shader;
|
|
64
|
+
}
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const openpbrVolumeFunctions = { name, shader };
|
|
67
|
+
//# sourceMappingURL=openpbrVolumeFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openpbrVolumeFunctions.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/openpbrVolumeFunctions.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,wBAAwB,CAAC;AACtC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAwDkE,CAAC;AAClF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"openpbrVolumeFunctions\";\nconst shader = `struct OpenPBRHomogeneousVolume {vec3 extinction_coeff; \nvec3 ss_albedo; \nvec3 multi_scatter_color; \nvec3 absorption_coeff; \nvec3 scatter_coeff; \nfloat anisotropy; };OpenPBRHomogeneousVolume computeOpenPBRTransmissionVolume(\nin vec3 transmission_color,\nin float transmission_depth,\nin vec3 transmission_scatter,\nin float anisotropy\n)\n{OpenPBRHomogeneousVolume volumeParams;volumeParams.absorption_coeff=vec3(0.0);volumeParams.scatter_coeff=vec3(0.0);volumeParams.anisotropy=anisotropy;\n#ifdef GEOMETRY_THIN_WALLED\nvolumeParams.scatter_coeff=vec3(1.0);volumeParams.anisotropy=1.0; \nvolumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=vec3(1.0);\n#else\nif (transmission_depth>0.0) {vec3 invDepth=vec3(1./maxEps(transmission_depth));volumeParams.extinction_coeff=-log(maxEps(transmission_color.rgb))*invDepth;volumeParams.scatter_coeff=transmission_scatter.rgb*invDepth;volumeParams.absorption_coeff=volumeParams.extinction_coeff-volumeParams.scatter_coeff.rgb;float minCoeff=min3(volumeParams.absorption_coeff);if (minCoeff<0.0) {volumeParams.absorption_coeff-=vec3(minCoeff);}\nvolumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=volumeParams.scatter_coeff/(volumeParams.extinction_coeff);} else {volumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;volumeParams.ss_albedo=vec3(0.0);}\n#endif\nreturn volumeParams;}\nOpenPBRHomogeneousVolume computeOpenPBRSubsurfaceVolume(\nin vec3 subsurface_color,\nin float subsurface_radius,\nin vec3 subsurface_radius_scale,\nin float anisotropy\n)\n{OpenPBRHomogeneousVolume volumeParams;volumeParams.absorption_coeff=vec3(0.0);volumeParams.scatter_coeff=vec3(0.0);volumeParams.anisotropy=anisotropy;volumeParams.multi_scatter_color=subsurface_color;vec3 mfp=subsurface_radius_scale*vec3(subsurface_radius);volumeParams.extinction_coeff=vec3(1.0)/maxEps(mfp);volumeParams.ss_albedo=multiScatterToSingleScatterAlbedo(subsurface_color,anisotropy);volumeParams.scatter_coeff=volumeParams.ss_albedo*volumeParams.extinction_coeff;volumeParams.absorption_coeff=volumeParams.extinction_coeff-volumeParams.scatter_coeff.rgb;float minCoeff=min3(volumeParams.absorption_coeff);if (minCoeff<0.0) {volumeParams.absorption_coeff-=vec3(minCoeff);}\nvolumeParams.extinction_coeff=volumeParams.absorption_coeff+volumeParams.scatter_coeff;return volumeParams;}\nvec3 sss_pdf(float r,vec3 d)\n{d=max(vec3(1e-4f),d);return (exp(-r/d)+exp(-r/(3.0f*d)))/max(vec3(1e-5f),8.0f*PI*d*r);}\nfloat sss_samples_pdf(float r,float d)\n{d=max(1e-4f,d);return exp(-r/(3.0f*d))/(6.0f*PI*d*r);}\nfloat sss_samples_icdf(float x,float d)\n{d=max(1e-4f,d);x=max(1e-4f,x);return -3.0f*log(x)*d;}\nfloat samples_scale(float x,float d)\n{return 1.0f-exp(-x/(3.0f*d));}\nvec3 sss_get_position(sampler2D depth_texture,vec2 tex_coord,vec2 render_resolution,mat4 inv_proj)\n{vec4 P=vec4(tex_coord,texelFetch(depth_texture,ivec2(tex_coord*render_resolution),0).x,1.0f);P.xy=2.0f*P.xy-1.0f;P=inv_proj*P;return P.xyz/P.w;}\nfloat sss_filter_scale(float currZ,mat4 proj)\n{return 1.0f/dot(vec2(proj[2].w,proj[3].w),vec2(currZ,1.0f));}\nfloat projective_to_pixels(float proj_dist,mat4 proj,vec2 resolution)\n{return proj_dist*proj[1][1]*resolution.y;}\nfloat pixels_to_projective(float pixel_dist,mat4 proj,vec2 resolution)\n{return pixel_dist/(proj[1][1]*resolution.y);}\nvec3 sss_convolve(sampler2D sss_irradiance_texture,sampler2D depth_texture,vec2 render_resolution,vec3 d,mat4 proj,mat4 inv_proj,int sample_count,vec2 noise)\n{vec2 tex_coord=gl_FragCoord.xy/render_resolution;vec3 unconvolved_irradiance=texelFetch(sss_irradiance_texture,ivec2(gl_FragCoord.xy),0).rgb;vec3 curr_pos=sss_get_position(depth_texture,tex_coord,render_resolution,inv_proj);float dmax=max3(d);float max_dmax=0.1*float(sample_count);if (dmax>max_dmax)\n{d.rgb*=max_dmax/dmax;dmax=max_dmax;}\nfloat dz=dmax*sss_filter_scale(curr_pos.z,proj);mat2 projMat2d=mat2(proj);if (determinant(projMat2d)*dz<1e-4f)\nreturn unconvolved_irradiance;float overscan_size_in_pixels=max(render_resolution.x,render_resolution.y)*0.1;const float filter_crop_ratio=0.8f; \nfloat crop_radius=projective_to_pixels(sss_samples_icdf(1.0f-filter_crop_ratio,dz),proj,render_resolution);if (crop_radius>overscan_size_in_pixels)\n{d.rgb*=overscan_size_in_pixels/crop_radius;dz*=overscan_size_in_pixels/crop_radius;}\nfloat filter_samples_scale=samples_scale(pixels_to_projective(overscan_size_in_pixels,proj,render_resolution),dz);vec3 irradiance_sum=vec3(0.0f);vec3 weight_sum=vec3(0.0f);for (int i=0; i<sample_count; i++)\n{vec2 r=fract(plasticSequence(uint(i+sample_count))+noise*0.2);r.x*=TWO_PI;r.y*=filter_samples_scale;float icdf=sss_samples_icdf(1.0-r.y,dz);vec2 sample_uv=tex_coord+icdf*projMat2d*vec2(cos(r.x),sin(r.x));vec4 sss_irradiance=texelFetch(sss_irradiance_texture,ivec2(sample_uv*render_resolution),0);float dist=distance(curr_pos,sss_get_position(depth_texture,sample_uv,render_resolution,inv_proj));if (dist>0.0f)\n{vec3 weights=sss_irradiance.a/sss_samples_pdf(icdf,dz)*sss_pdf(dist,d.rgb);irradiance_sum+=weights*sss_irradiance.rgb;weight_sum+=weights;}}\nreturn vec3(weight_sum.r<1e-5f ? unconvolved_irradiance.r : irradiance_sum.r/weight_sum.r,\nweight_sum.g<1e-5f ? unconvolved_irradiance.g : irradiance_sum.g/weight_sum.g,\nweight_sum.b<1e-5f ? unconvolved_irradiance.b : irradiance_sum.b/weight_sum.b);}`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const openpbrVolumeFunctions = { name, shader };\n"]}
|
|
@@ -20,7 +20,7 @@ gl_FragData[PREPASS_ALBEDO_INDEX]=vec4(surfaceAlbedo,writeGeometryInfo);
|
|
|
20
20
|
#ifdef PREPASS_ALBEDO_SQRT
|
|
21
21
|
vec3 sqAlbedo=sqrt(surfaceAlbedo);
|
|
22
22
|
#endif
|
|
23
|
-
#ifdef
|
|
23
|
+
#ifdef PREPASS_IRRADIANCE_LEGACY
|
|
24
24
|
vec3 irradiance=finalDiffuse;
|
|
25
25
|
#ifndef UNLIT
|
|
26
26
|
#ifdef REFLECTION
|
|
@@ -38,10 +38,21 @@ gl_FragData[PREPASS_COLOR_INDEX]=finalColor;
|
|
|
38
38
|
#endif
|
|
39
39
|
float scatteringDiffusionProfile=255.;
|
|
40
40
|
#endif
|
|
41
|
-
gl_FragData[
|
|
42
|
-
#
|
|
41
|
+
gl_FragData[PREPASS_IRRADIANCE_LEGACY_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.);
|
|
42
|
+
#else
|
|
43
|
+
#ifdef PREPASS_IRRADIANCE
|
|
44
|
+
vec3 irradiance=finalDiffuse;
|
|
45
|
+
#ifndef UNLIT
|
|
46
|
+
#ifdef REFLECTION
|
|
47
|
+
irradiance+=finalIrradiance;
|
|
48
|
+
#endif
|
|
49
|
+
#endif
|
|
50
|
+
gl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(irradiance,writeGeometryInfo);
|
|
51
|
+
#endif
|
|
52
|
+
#if defined(PREPASS_COLOR)
|
|
43
53
|
gl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb,finalColor.a);
|
|
44
54
|
#endif
|
|
55
|
+
#endif
|
|
45
56
|
#ifdef PREPASS_DEPTH
|
|
46
57
|
gl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo);
|
|
47
58
|
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrBlockPrePass.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockPrePass.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"pbrBlockPrePass.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrBlockPrePass.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrBlockPrePass\";\nconst shader = `#if SCENE_MRT_COUNT>0\nfloat writeGeometryInfo=finalColor.a>ALPHATESTVALUE ? 1.0 : 0.0;\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\ngl_FragData[PREPASS_LOCAL_POSITION_INDEX]=vec4(vPosition,writeGeometryInfo);\n#endif\n#if defined(PREPASS_VELOCITY)\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;vec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;vec2 velocity=abs(a-b);velocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;gl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvec2 velocity=vec2(0.5)*((vPreviousPosition.xy/vPreviousPosition.w)-(vCurrentPosition.xy/vCurrentPosition.w));gl_FragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(surfaceAlbedo,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nvec3 sqAlbedo=sqrt(surfaceAlbedo); \n#endif\n#ifdef PREPASS_IRRADIANCE_LEGACY\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\n#ifdef SS_SCATTERING\n#ifdef PREPASS_COLOR\ngl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb-irradiance,finalColor.a); \n#endif\nirradiance/=sqAlbedo;\n#else\n#ifdef PREPASS_COLOR\ngl_FragData[PREPASS_COLOR_INDEX]=finalColor; \n#endif\nfloat scatteringDiffusionProfile=255.;\n#endif\ngl_FragData[PREPASS_IRRADIANCE_LEGACY_INDEX]=vec4(clamp(irradiance,vec3(0.),vec3(1.)),writeGeometryInfo*scatteringDiffusionProfile/255.); \n#else\n#ifdef PREPASS_IRRADIANCE\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(irradiance,writeGeometryInfo);\n#endif\n#if defined(PREPASS_COLOR)\ngl_FragData[PREPASS_COLOR_INDEX]=vec4(finalColor.rgb,finalColor.a);\n#endif\n#endif\n#ifdef PREPASS_DEPTH\ngl_FragData[PREPASS_DEPTH_INDEX]=vec4(vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\ngl_FragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4(gl_FragCoord.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\ngl_FragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4(vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalW,writeGeometryInfo);\n#else\ngl_FragData[PREPASS_NORMAL_INDEX]=vec4(normalize((view*vec4(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\ngl_FragData[PREPASS_WORLD_NORMAL_INDEX]=vec4(normalW*0.5+0.5,writeGeometryInfo); \n#endif\n#ifdef PREPASS_ALBEDO_SQRT\ngl_FragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4(sqAlbedo,writeGeometryInfo); \n#endif\n#ifdef PREPASS_REFLECTIVITY\n#ifndef UNLIT\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(specularEnvironmentR0,microSurface)*writeGeometryInfo;\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4( 0.0,0.0,0.0,1.0 )*writeGeometryInfo;\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const pbrBlockPrePass = { name, shader };\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
|
+
const name = "pbrFragmentReflectionDeclaration";
|
|
4
|
+
const shader = `#ifdef REFLECTION
|
|
5
|
+
#ifdef REFLECTIONMAP_3D
|
|
6
|
+
#define sampleReflection(s,c) textureCube(s,c)
|
|
7
|
+
uniform samplerCube reflectionSampler;
|
|
8
|
+
#ifdef LODBASEDMICROSFURACE
|
|
9
|
+
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
|
|
10
|
+
#else
|
|
11
|
+
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
|
|
12
|
+
#endif
|
|
13
|
+
#ifdef USEIRRADIANCEMAP
|
|
14
|
+
uniform samplerCube irradianceSampler;
|
|
15
|
+
#endif
|
|
16
|
+
#else
|
|
17
|
+
#define sampleReflection(s,c) texture2D(s,c)
|
|
18
|
+
uniform sampler2D reflectionSampler;
|
|
19
|
+
#ifdef LODBASEDMICROSFURACE
|
|
20
|
+
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
|
|
21
|
+
#else
|
|
22
|
+
uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
|
|
23
|
+
#endif
|
|
24
|
+
#ifdef USEIRRADIANCEMAP
|
|
25
|
+
uniform sampler2D irradianceSampler;
|
|
26
|
+
#endif
|
|
27
|
+
#endif
|
|
28
|
+
#ifdef REFLECTIONMAP_SKYBOX
|
|
29
|
+
varying vec3 vPositionUVW;
|
|
30
|
+
#else
|
|
31
|
+
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
|
|
32
|
+
varying vec3 vDirectionW;
|
|
33
|
+
#endif
|
|
34
|
+
#endif
|
|
35
|
+
#endif
|
|
36
|
+
`;
|
|
37
|
+
// Sideeffect
|
|
38
|
+
if (!ShaderStore.IncludesShadersStore[name]) {
|
|
39
|
+
ShaderStore.IncludesShadersStore[name] = shader;
|
|
40
|
+
}
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const pbrFragmentReflectionDeclaration = { name, shader };
|
|
43
|
+
//# sourceMappingURL=pbrFragmentReflectionDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pbrFragmentReflectionDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,kCAAkC,CAAC;AAChD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"pbrFragmentReflectionDeclaration\";\nconst shader = `#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const pbrFragmentReflectionDeclaration = { name, shader };\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ShaderStore } from "../../Engines/shaderStore.js";
|
|
3
3
|
import "./samplerFragmentDeclaration.js";
|
|
4
4
|
import "./samplerFragmentAlternateDeclaration.js";
|
|
5
|
+
import "./pbrFragmentReflectionDeclaration.js";
|
|
5
6
|
const name = "pbrFragmentSamplersDeclaration";
|
|
6
7
|
const shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)
|
|
7
8
|
#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight)
|
|
@@ -38,38 +39,7 @@ uniform sampler2D sheenRoughnessSampler;
|
|
|
38
39
|
#ifdef ANISOTROPIC
|
|
39
40
|
#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)
|
|
40
41
|
#endif
|
|
41
|
-
#
|
|
42
|
-
#ifdef REFLECTIONMAP_3D
|
|
43
|
-
#define sampleReflection(s,c) textureCube(s,c)
|
|
44
|
-
uniform samplerCube reflectionSampler;
|
|
45
|
-
#ifdef LODBASEDMICROSFURACE
|
|
46
|
-
#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
|
|
47
|
-
#else
|
|
48
|
-
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
|
|
49
|
-
#endif
|
|
50
|
-
#ifdef USEIRRADIANCEMAP
|
|
51
|
-
uniform samplerCube irradianceSampler;
|
|
52
|
-
#endif
|
|
53
|
-
#else
|
|
54
|
-
#define sampleReflection(s,c) texture2D(s,c)
|
|
55
|
-
uniform sampler2D reflectionSampler;
|
|
56
|
-
#ifdef LODBASEDMICROSFURACE
|
|
57
|
-
#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
|
|
58
|
-
#else
|
|
59
|
-
uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
|
|
60
|
-
#endif
|
|
61
|
-
#ifdef USEIRRADIANCEMAP
|
|
62
|
-
uniform sampler2D irradianceSampler;
|
|
63
|
-
#endif
|
|
64
|
-
#endif
|
|
65
|
-
#ifdef REFLECTIONMAP_SKYBOX
|
|
66
|
-
varying vec3 vPositionUVW;
|
|
67
|
-
#else
|
|
68
|
-
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
|
|
69
|
-
varying vec3 vDirectionW;
|
|
70
|
-
#endif
|
|
71
|
-
#endif
|
|
72
|
-
#endif
|
|
42
|
+
#include<pbrFragmentReflectionDeclaration>
|
|
73
43
|
#ifdef ENVIRONMENTBRDF
|
|
74
44
|
uniform sampler2D environmentBrdfSampler;
|
|
75
45
|
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrFragmentSamplersDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,8BAA8B,CAAC;AACtC,OAAO,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"pbrFragmentSamplersDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,8BAA8B,CAAC;AACtC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,oCAAoC,CAAC;AAE5C,MAAM,IAAI,GAAG,gCAAgC,CAAC;AAC9C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./samplerFragmentDeclaration\";\nimport \"./samplerFragmentAlternateDeclaration\";\nimport \"./pbrFragmentReflectionDeclaration\";\n\nconst name = \"pbrFragmentSamplersDeclaration\";\nconst shader = `#include<samplerFragmentDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_SAMPLERNAME_,albedo)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_WEIGHT,_VARYINGNAME_,BaseWeight,_SAMPLERNAME_,baseWeight)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,BASE_DIFFUSE_ROUGHNESS,_VARYINGNAME_,BaseDiffuseRoughness,_SAMPLERNAME_,baseDiffuseRoughness)\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_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_SAMPLERNAME_,reflectivity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_SAMPLERNAME_,microSurface)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_SAMPLERNAME_,metallicReflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_SAMPLERNAME_,reflectance)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef CLEARCOAT\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_SAMPLERNAME_,clearCoat)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform sampler2D clearCoatRoughnessSampler;\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_SAMPLERNAME_,clearCoatBump)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_SAMPLERNAME_,clearCoatTint)\n#endif\n#ifdef IRIDESCENCE\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_SAMPLERNAME_,iridescence)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_SAMPLERNAME_,iridescenceThickness)\n#endif\n#ifdef SHEEN\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_SAMPLERNAME_,sheen)\n#include<samplerFragmentAlternateDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform sampler2D sheenRoughnessSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#include<samplerFragmentDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_SAMPLERNAME_,anisotropy)\n#endif\n#include<pbrFragmentReflectionDeclaration>\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;uniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;uniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_SAMPLERNAME_,thickness)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_SAMPLERNAME_,refractionIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_SAMPLERNAME_,translucencyIntensity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_SAMPLERNAME_,translucencyColor)\n#endif\n#ifdef IBL_CDF_FILTERING\nuniform sampler2D icdfSampler;\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const pbrFragmentSamplersDeclaration = { name, shader };\n"]}
|
|
@@ -5,7 +5,7 @@ const shader = `uniform mat4 viewProjection;
|
|
|
5
5
|
#ifdef MULTIVIEW
|
|
6
6
|
uniform mat4 viewProjectionR;
|
|
7
7
|
#endif
|
|
8
|
-
uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;
|
|
8
|
+
uniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;uniform mat4 inverseProjection;
|
|
9
9
|
`;
|
|
10
10
|
// Sideeffect
|
|
11
11
|
if (!ShaderStore.IncludesShadersStore[name]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sceneFragmentDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/sceneFragmentDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"sceneFragmentDeclaration\";\nconst shader = `uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\nuniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const sceneFragmentDeclaration = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"sceneFragmentDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/sceneFragmentDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"sceneFragmentDeclaration\";\nconst shader = `uniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\nuniform mat4 view;uniform mat4 projection;uniform vec4 vEyePosition;uniform mat4 inverseProjection;\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const sceneFragmentDeclaration = { name, shader };\n"]}
|
|
@@ -5,7 +5,7 @@ const shader = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProj
|
|
|
5
5
|
#ifdef MULTIVIEW
|
|
6
6
|
mat4 viewProjectionR;
|
|
7
7
|
#endif
|
|
8
|
-
mat4 view;mat4 projection;vec4 vEyePosition;};
|
|
8
|
+
mat4 view;mat4 projection;vec4 vEyePosition;mat4 inverseProjection;};
|
|
9
9
|
`;
|
|
10
10
|
// Sideeffect
|
|
11
11
|
if (!ShaderStore.IncludesShadersStore[name]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sceneUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/sceneUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"sceneUboDeclaration\";\nconst shader = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif \nmat4 view;mat4 projection;vec4 vEyePosition;};\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const sceneUboDeclaration = { name, shader };\n"]}
|
|
1
|
+
{"version":3,"file":"sceneUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/Shaders/ShadersInclude/sceneUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;CAKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1C,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"sceneUboDeclaration\";\nconst shader = `layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif \nmat4 view;mat4 projection;vec4 vEyePosition;mat4 inverseProjection;};\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStore[name]) {\n ShaderStore.IncludesShadersStore[name] = shader;\n}\n/** @internal */\nexport const sceneUboDeclaration = { name, shader };\n"]}
|
|
@@ -3,8 +3,20 @@ import "./ShadersInclude/mrtFragmentDeclaration.js";
|
|
|
3
3
|
import "./ShadersInclude/bumpFragmentMainFunctions.js";
|
|
4
4
|
import "./ShadersInclude/bumpFragmentFunctions.js";
|
|
5
5
|
import "./ShadersInclude/helperFunctions.js";
|
|
6
|
+
import "./ShadersInclude/pbrFragmentReflectionDeclaration.js";
|
|
7
|
+
import "./ShadersInclude/sceneFragmentDeclaration.js";
|
|
8
|
+
import "./ShadersInclude/sceneUboDeclaration.js";
|
|
9
|
+
import "./ShadersInclude/pbrBRDFFunctions.js";
|
|
10
|
+
import "./ShadersInclude/openpbrDielectricReflectance.js";
|
|
11
|
+
import "./ShadersInclude/pbrIBLFunctions.js";
|
|
12
|
+
import "./ShadersInclude/reflectionFunction.js";
|
|
13
|
+
import "./ShadersInclude/openpbrGeometryInfo.js";
|
|
14
|
+
import "./ShadersInclude/openpbrIblFunctions.js";
|
|
15
|
+
import "./ShadersInclude/samplerFragmentDeclaration.js";
|
|
6
16
|
import "./ShadersInclude/clipPlaneFragment.js";
|
|
7
17
|
import "./ShadersInclude/bumpFragment.js";
|
|
18
|
+
import "./ShadersInclude/openpbrSubsurfaceLayerData.js";
|
|
19
|
+
import "./ShadersInclude/openpbrTransmissionLayerData.js";
|
|
8
20
|
/** @internal */
|
|
9
21
|
export declare const geometryPixelShader: {
|
|
10
22
|
name: string;
|