@vived/component-abb-6700 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.todo.md +13 -0
- package/README.md +122 -0
- package/dist/.gitkeep +0 -0
- package/dist/Adapters/aBB6700PMAdapter.d.ts +10 -0
- package/dist/Adapters/aBB6700PMAdapter.d.ts.map +1 -0
- package/dist/Controllers/createABB6700.d.ts +12 -0
- package/dist/Controllers/createABB6700.d.ts.map +1 -0
- package/dist/Controllers/getPose.d.ts +11 -0
- package/dist/Controllers/getPose.d.ts.map +1 -0
- package/dist/Controllers/setJointAngle.d.ts +12 -0
- package/dist/Controllers/setJointAngle.d.ts.map +1 -0
- package/dist/Controllers/setPose.d.ts +11 -0
- package/dist/Controllers/setPose.d.ts.map +1 -0
- package/dist/Entities/ABB6700Entity.d.ts +35 -0
- package/dist/Entities/ABB6700Entity.d.ts.map +1 -0
- package/dist/Entities/ABB6700Repo.d.ts +32 -0
- package/dist/Entities/ABB6700Repo.d.ts.map +1 -0
- package/dist/Factory/ABB6700FeatureFactory.d.ts +26 -0
- package/dist/Factory/ABB6700FeatureFactory.d.ts.map +1 -0
- package/dist/Mocks/MockABB6700PM.d.ts +11 -0
- package/dist/Mocks/MockABB6700PM.d.ts.map +1 -0
- package/dist/Mocks/MockSetJointAngleUC.d.ts +7 -0
- package/dist/Mocks/MockSetJointAngleUC.d.ts.map +1 -0
- package/dist/Mocks/MockSetPoseUC.d.ts +7 -0
- package/dist/Mocks/MockSetPoseUC.d.ts.map +1 -0
- package/dist/PMs/ABB6700PM.d.ts +32 -0
- package/dist/PMs/ABB6700PM.d.ts.map +1 -0
- package/dist/UCs/CalcStabilizerUC.d.ts +7 -0
- package/dist/UCs/CalcStabilizerUC.d.ts.map +1 -0
- package/dist/UCs/SetJointAngleUC.d.ts +15 -0
- package/dist/UCs/SetJointAngleUC.d.ts.map +1 -0
- package/dist/UCs/SetPoseUC.d.ts +22 -0
- package/dist/UCs/SetPoseUC.d.ts.map +1 -0
- package/dist/Views/ABB6700BabylonView.d.ts +27 -0
- package/dist/Views/ABB6700BabylonView.d.ts.map +1 -0
- package/dist/abb_6700.glb +0 -0
- package/dist/abstractAudioBus-CyBWsmuN.js +14 -0
- package/dist/animationGroup-BhNThqQe.js +1454 -0
- package/dist/basisTextureLoader-BT391BsV.js +310 -0
- package/dist/brdfTextureTools-DUyKBAXf.js +79 -0
- package/dist/bumpFragment-Dd-ojPA1.js +134 -0
- package/dist/bumpFragment-KE1_PuMl.js +287 -0
- package/dist/bumpVertex-BcdvVFVx.js +8 -0
- package/dist/bumpVertexDeclaration-B5Uvs-RS.js +8 -0
- package/dist/bumpVertexDeclaration-ixSg-yGI.js +8 -0
- package/dist/clipPlaneFragment-DJwQynjA.js +136 -0
- package/dist/clipPlaneVertex-D4Wk50XG.js +376 -0
- package/dist/clipPlaneVertex-eQ147Tn2.js +350 -0
- package/dist/component.config.d.ts +17 -0
- package/dist/component.config.d.ts.map +1 -0
- package/dist/ddsTextureLoader-DeoF3iGO.js +331 -0
- package/dist/default.fragment-DKnTR9nY.js +548 -0
- package/dist/default.fragment-rIGWrUS5.js +486 -0
- package/dist/default.vertex-Bt5y1VyA.js +212 -0
- package/dist/default.vertex-Dext1liJ.js +224 -0
- package/dist/defaultUboDeclaration-BwslQZX8.js +11 -0
- package/dist/defaultUboDeclaration-DSXACgip.js +9 -0
- package/dist/easing-BAt0SO-B.js +163 -0
- package/dist/envTextureLoader-CBiW_Q-U.js +40 -0
- package/dist/exrTextureLoader-5SC6PKIA.js +740 -0
- package/dist/flowGraphApplyForceBlock-6e8-wcaw.js +32 -0
- package/dist/flowGraphApplyImpulseBlock-B27EZQow.js +32 -0
- package/dist/flowGraphArrayIndexBlock-DIUn5e4i.js +31 -0
- package/dist/flowGraphBezierCurveEasingBlock-BJmiHk40.js +25 -0
- package/dist/flowGraphBinaryOperationBlock-Bj7TANCc.js +25 -0
- package/dist/flowGraphBranchBlock-7CRvIKWc.js +19 -0
- package/dist/flowGraphCachedOperationBlock-CP1ZiuIB.js +26 -0
- package/dist/flowGraphCancelDelayBlock-DqtgzBGm.js +20 -0
- package/dist/flowGraphCodeExecutionBlock-CaYXCGqo.js +23 -0
- package/dist/flowGraphConditionalDataBlock-DJ7evX8_.js +28 -0
- package/dist/flowGraphConsoleLogBlock-cMkpqLzO.js +68 -0
- package/dist/flowGraphConstantBlock-JWybwT0A.js +28 -0
- package/dist/flowGraphContextBlock-CFDXHcbn.js +19 -0
- package/dist/flowGraphCounterBlock-B0uPkgw9.js +24 -0
- package/dist/flowGraphDataSwitchBlock-B0GSifvJ.js +27 -0
- package/dist/flowGraphDebounceBlock-CSw8zKym.js +24 -0
- package/dist/flowGraphDebugBlock-DiSR6Ahn.js +65 -0
- package/dist/flowGraphDoNBlock-C-48oQ2H.js +24 -0
- package/dist/flowGraphEasingBlock-DKUaE7Rp.js +50 -0
- package/dist/flowGraphFlipFlopBlock-DX5BGhMV.js +20 -0
- package/dist/flowGraphForLoopBlock-Di-Qwg23.js +27 -0
- package/dist/flowGraphFunctionReferenceBlock-D8X5TFsO.js +20 -0
- package/dist/flowGraphGLTFDataProvider-C4j7nPQv.js +16 -0
- package/dist/flowGraphGetAngularVelocityBlock-Cq-yTQ4D.js +31 -0
- package/dist/flowGraphGetAssetBlock-B36eioor.js +21 -0
- package/dist/flowGraphGetLinearVelocityBlock-MdrV0eUD.js +31 -0
- package/dist/flowGraphGetPhysicsMassPropertiesBlock-wXDZP1wM.js +30 -0
- package/dist/flowGraphGetPropertyBlock-eP0badwf.js +46 -0
- package/dist/flowGraphGetSoundVolumeBlock-D3gXGHXa.js +29 -0
- package/dist/flowGraphGetVariableBlock-C7-qZAec.js +31 -0
- package/dist/flowGraphIndexOfBlock-CC5l9n9P.js +31 -0
- package/dist/flowGraphInterpolationBlock-B6922jzt.js +50 -0
- package/dist/flowGraphIsKeyPressedBlock-X_iuiUOX.js +31 -0
- package/dist/flowGraphIsSoundPlayingBlock-DONQX8N8.js +29 -0
- package/dist/flowGraphJsonPointerParserBlock-DBH_gN8I.js +95 -0
- package/dist/flowGraphKeyDownEventBlock-D5T1Uyfv.js +26 -0
- package/dist/flowGraphKeyUpEventBlock-BPY_Kgkm.js +21 -0
- package/dist/flowGraphKeyboardEventBlock-C49fx3TC.js +20 -0
- package/dist/flowGraphMathBlocks-CkvrN3VJ.js +864 -0
- package/dist/flowGraphMathCombineExtractBlocks-QSjGlnoz.js +248 -0
- package/dist/flowGraphMatrixMathBlocks-B3D7Cz9p.js +117 -0
- package/dist/flowGraphMeshPickEventBlock-BBTz-taa.js +35 -0
- package/dist/flowGraphMultiGateBlock-BhY1y5BG.js +50 -0
- package/dist/flowGraphPauseAnimationBlock-CHZZXMbg.js +19 -0
- package/dist/flowGraphPauseSoundBlock-B7hMmJ0c.js +31 -0
- package/dist/flowGraphPhysicsCollisionEventBlock-CxoPpT-q.js +56 -0
- package/dist/flowGraphPlayAnimationBlock-DVAvIFux.js +99 -0
- package/dist/flowGraphPlaySoundBlock-DjHGrqbC.js +32 -0
- package/dist/flowGraphPointerDownEventBlock-qI-H0JST.js +31 -0
- package/dist/flowGraphPointerMoveEventBlock-DAi4VUyy.js +31 -0
- package/dist/flowGraphPointerOutEventBlock-CFtj68aC.js +21 -0
- package/dist/flowGraphPointerOverEventBlock-VxdHhFuu.js +23 -0
- package/dist/flowGraphPointerUpEventBlock-DRR1f07q.js +31 -0
- package/dist/flowGraphReceiveCustomEventBlock-B3bwdB66.js +52 -0
- package/dist/flowGraphSceneReadyEventBlock-Dy6lDT3j.js +23 -0
- package/dist/flowGraphSceneTickEventBlock-Bl9BF_Xw.js +32 -0
- package/dist/flowGraphSendCustomEventBlock-BAR4PGFq.js +35 -0
- package/dist/flowGraphSequenceBlock-veqU32ZZ.js +32 -0
- package/dist/flowGraphSetAngularVelocityBlock-Dj9b-zu6.js +31 -0
- package/dist/flowGraphSetDelayBlock-CMjudtvk.js +131 -0
- package/dist/flowGraphSetLinearVelocityBlock-DVDhhJBd.js +31 -0
- package/dist/flowGraphSetPhysicsMotionTypeBlock-CL3cxNCO.js +36 -0
- package/dist/flowGraphSetPropertyBlock-D3sWL3Ss.js +47 -0
- package/dist/flowGraphSetSoundVolumeBlock-CxVk45yR.js +32 -0
- package/dist/flowGraphSetVariableBlock-D1oJiwLj.js +47 -0
- package/dist/flowGraphSoundEndedEventBlock-CubEwii0.js +47 -0
- package/dist/flowGraphStopAnimationBlock-B9inwIQx.js +48 -0
- package/dist/flowGraphStopSoundBlock-BijIX2jC.js +31 -0
- package/dist/flowGraphSwitchBlock-BMhPb4OX.js +54 -0
- package/dist/flowGraphThrottleBlock-C7vrnkb1.js +37 -0
- package/dist/flowGraphTransformCoordinatesSystemBlock-DoISqaUG.js +29 -0
- package/dist/flowGraphTypeToTypeBlocks-CSML6QWx.js +57 -0
- package/dist/flowGraphUnaryOperationBlock-B0Shf-lJ.js +24 -0
- package/dist/flowGraphVectorMathBlocks-DoTRR_E0.js +178 -0
- package/dist/flowGraphWaitAllBlock-BvmDMc24.js +54 -0
- package/dist/flowGraphWhileLoopBlock-BaIq4-K2.js +27 -0
- package/dist/geometry.fragment-Bsis3UG2.js +275 -0
- package/dist/geometry.vertex-DskQ5b8j.js +222 -0
- package/dist/harmonicsFunctions-CtNrRfir.js +193 -0
- package/dist/harmonicsFunctions-PEz6APC7.js +18 -0
- package/dist/hdrTextureLoader-D9rYxJ9q.js +112 -0
- package/dist/helperFunctions-Bt7Zfkrp.js +89 -0
- package/dist/helperFunctions-CPmRxd37.js +121 -0
- package/dist/iesTextureLoader-BGUFjVhI.js +93 -0
- package/dist/index-CS3Icp_r.js +67657 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/ktxTextureLoader-cUaGg9_L.js +459 -0
- package/dist/lightFragment-BRDibDKG.js +404 -0
- package/dist/lightFragment-DCqtGMp_.js +402 -0
- package/dist/logDepthDeclaration-Bwm-3KyB.js +16 -0
- package/dist/logDepthDeclaration-gUfeSnXX.js +20 -0
- package/dist/logDepthVertex-CKeuJ6ae.js +213 -0
- package/dist/logDepthVertex-CXkmZels.js +459 -0
- package/dist/mesh.vertexData.functions-Bc9lJlrU.js +74 -0
- package/dist/oitFragment-B8zuQigp.js +792 -0
- package/dist/oitFragment-DH3h3T6x.js +657 -0
- package/dist/openpbr.fragment-BglYS6LA.js +1405 -0
- package/dist/openpbr.fragment-DrOTZs4m.js +1553 -0
- package/dist/openpbr.vertex-B-PaLFOR.js +384 -0
- package/dist/openpbr.vertex-DMdFRTnX.js +268 -0
- package/dist/openpbrMaterial-HCU0aOca.js +2880 -0
- package/dist/openpbrMaterialLoadingAdapter-CWRAa-7S.js +1122 -0
- package/dist/openpbrTransmissionLayerData-CfDVObj5.js +352 -0
- package/dist/openpbrUboDeclaration-CA2pvSbt.js +9 -0
- package/dist/openpbrUboDeclaration-xU8VOaib.js +10 -0
- package/dist/pass.fragment-1mMP54bb.js +10 -0
- package/dist/pass.fragment-DzaUp_jk.js +10 -0
- package/dist/passCube.fragment-CQaXS7g3.js +29 -0
- package/dist/passCube.fragment-QJGPwAXI.js +29 -0
- package/dist/pbr.fragment-BnaAAGxb.js +2775 -0
- package/dist/pbr.fragment-CYZk_EGU.js +2619 -0
- package/dist/pbr.vertex-CyvdCw91.js +372 -0
- package/dist/pbr.vertex-DJMAkDxs.js +270 -0
- package/dist/pbrBRDFFunctions-EugoWm6O.js +175 -0
- package/dist/pbrDebug-Bk3sPoEG.js +719 -0
- package/dist/pbrDebug-Cdalzb1I.js +614 -0
- package/dist/pbrIBLFunctions-B0bVAXCF.js +47 -0
- package/dist/pbrIBLFunctions-C06z-ouZ.js +51 -0
- package/dist/pbrMaterial-C4FCKBZQ.js +1660 -0
- package/dist/pbrMaterialLoadingAdapter-BGHlS_ZN.js +1032 -0
- package/dist/pbrUboDeclaration-1lN5_-Bw.js +9 -0
- package/dist/pbrUboDeclaration-BJOUUOZ2.js +10 -0
- package/dist/procedural.vertex-CFPKczKj.js +14 -0
- package/dist/procedural.vertex-DUW7bYZt.js +13 -0
- package/dist/rgbdDecode.fragment-CEGgE4tL.js +8 -0
- package/dist/rgbdDecode.fragment-FT0wkgah.js +8 -0
- package/dist/rgbdEncode.fragment-CLnJJf6E.js +8 -0
- package/dist/rgbdEncode.fragment-CaAcMsY9.js +8 -0
- package/dist/sceneUboDeclaration-B6oxsfcj.js +8 -0
- package/dist/sceneUboDeclaration-JByfVKik.js +13 -0
- package/dist/setupABB6700InstanceFactory.d.ts +7 -0
- package/dist/setupABB6700InstanceFactory.d.ts.map +1 -0
- package/dist/studio.env +0 -0
- package/dist/textureProcessor.fragment-BYPw6SMQ.js +152 -0
- package/dist/textureProcessor.fragment-Ciw9-F3w.js +157 -0
- package/dist/textureTools-Cct_bGgp.js +40 -0
- package/dist/tgaTextureLoader-BJOIdnFr.js +198 -0
- package/dist/thinEngine-Bt9FW4dD.js +2425 -0
- package/dist/webAudioBus-BUzRHSxr.js +88 -0
- package/dist/webAudioMainBus-Dds1TgJG.js +49 -0
- package/package.json +49 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { b0 as e } from "./index-CS3Icp_r.js";
|
|
2
|
+
const i = "clusteredLightingFunctions", n = `struct ClusteredLight {vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;vec4 vLightDirection;vec4 vLightFalloff;};
|
|
3
|
+
#define inline
|
|
4
|
+
ClusteredLight getClusteredLight(sampler2D lightDataTexture,int index) {return ClusteredLight(
|
|
5
|
+
texelFetch(lightDataTexture,ivec2(0,index),0),
|
|
6
|
+
texelFetch(lightDataTexture,ivec2(1,index),0),
|
|
7
|
+
texelFetch(lightDataTexture,ivec2(2,index),0),
|
|
8
|
+
texelFetch(lightDataTexture,ivec2(3,index),0),
|
|
9
|
+
texelFetch(lightDataTexture,ivec2(4,index),0)
|
|
10
|
+
);}
|
|
11
|
+
int getClusteredSliceIndex(vec2 sliceData,float viewDepth) {return int(log(viewDepth)*sliceData.x+sliceData.y);}
|
|
12
|
+
`;
|
|
13
|
+
e.IncludesShadersStore[i] || (e.IncludesShadersStore[i] = n);
|
|
14
|
+
const t = "decalFragment", f = `#ifdef DECAL
|
|
15
|
+
#ifdef GAMMADECAL
|
|
16
|
+
decalColor.rgb=toLinearSpace(decalColor.rgb);
|
|
17
|
+
#endif
|
|
18
|
+
#ifdef DECAL_SMOOTHALPHA
|
|
19
|
+
decalColor.a*=decalColor.a;
|
|
20
|
+
#endif
|
|
21
|
+
surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);
|
|
22
|
+
#endif
|
|
23
|
+
`;
|
|
24
|
+
e.IncludesShadersStore[t] || (e.IncludesShadersStore[t] = f);
|
|
25
|
+
const o = "lightFragment", d = `#ifdef LIGHT{X}
|
|
26
|
+
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
|
|
27
|
+
#else
|
|
28
|
+
vec4 diffuse{X}=light{X}.vLightDiffuse;
|
|
29
|
+
#define CUSTOM_LIGHT{X}_COLOR
|
|
30
|
+
#if defined(PBR) && defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
|
|
31
|
+
{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(
|
|
32
|
+
lightDataTexture{X},
|
|
33
|
+
tileMaskTexture{X},
|
|
34
|
+
light{X}.vLightData,
|
|
35
|
+
ivec2(light{X}.vSliceRanges[sliceIndex]),
|
|
36
|
+
viewDirectionW,
|
|
37
|
+
normalW,
|
|
38
|
+
vPositionW,
|
|
39
|
+
surfaceAlbedo,
|
|
40
|
+
reflectivityOut
|
|
41
|
+
#ifdef IRIDESCENCE
|
|
42
|
+
,iridescenceIntensity
|
|
43
|
+
#endif
|
|
44
|
+
#ifdef SS_TRANSLUCENCY
|
|
45
|
+
,subSurfaceOut
|
|
46
|
+
#endif
|
|
47
|
+
#ifdef SPECULARTERM
|
|
48
|
+
,AARoughnessFactors.x
|
|
49
|
+
#endif
|
|
50
|
+
#ifdef ANISOTROPIC
|
|
51
|
+
,anisotropicOut
|
|
52
|
+
#endif
|
|
53
|
+
#ifdef SHEEN
|
|
54
|
+
,sheenOut
|
|
55
|
+
#endif
|
|
56
|
+
#ifdef CLEARCOAT
|
|
57
|
+
,clearcoatOut
|
|
58
|
+
#endif
|
|
59
|
+
);}
|
|
60
|
+
#elif defined(PBR)
|
|
61
|
+
#ifdef SPOTLIGHT{X}
|
|
62
|
+
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
|
|
63
|
+
#elif defined(POINTLIGHT{X})
|
|
64
|
+
preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
|
|
65
|
+
#elif defined(HEMILIGHT{X})
|
|
66
|
+
preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
|
|
67
|
+
#elif defined(DIRLIGHT{X})
|
|
68
|
+
preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
|
|
69
|
+
#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
|
|
70
|
+
#if defined(RECTAREALIGHTEMISSIONTEXTURE{X})
|
|
71
|
+
preInfo=computeAreaPreLightingInfoWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);
|
|
72
|
+
#else
|
|
73
|
+
preInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);
|
|
74
|
+
#endif
|
|
75
|
+
#endif
|
|
76
|
+
preInfo.NdotV=NdotV;
|
|
77
|
+
#ifdef SPOTLIGHT{X}
|
|
78
|
+
#ifdef LIGHT_FALLOFF_GLTF{X}
|
|
79
|
+
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
|
|
80
|
+
#ifdef IESLIGHTTEXTURE{X}
|
|
81
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
|
|
82
|
+
#else
|
|
83
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
|
|
84
|
+
#endif
|
|
85
|
+
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
|
|
86
|
+
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
|
|
87
|
+
#ifdef IESLIGHTTEXTURE{X}
|
|
88
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
|
|
89
|
+
#else
|
|
90
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
|
|
91
|
+
#endif
|
|
92
|
+
#elif defined(LIGHT_FALLOFF_STANDARD{X})
|
|
93
|
+
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
|
|
94
|
+
#ifdef IESLIGHTTEXTURE{X}
|
|
95
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
|
|
96
|
+
#else
|
|
97
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
|
|
98
|
+
#endif
|
|
99
|
+
#else
|
|
100
|
+
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
|
|
101
|
+
#ifdef IESLIGHTTEXTURE{X}
|
|
102
|
+
preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
|
|
103
|
+
#else
|
|
104
|
+
preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
|
|
105
|
+
#endif
|
|
106
|
+
#endif
|
|
107
|
+
#elif defined(POINTLIGHT{X})
|
|
108
|
+
#ifdef LIGHT_FALLOFF_GLTF{X}
|
|
109
|
+
preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
|
|
110
|
+
#elif defined(LIGHT_FALLOFF_PHYSICAL{X})
|
|
111
|
+
preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
|
|
112
|
+
#elif defined(LIGHT_FALLOFF_STANDARD{X})
|
|
113
|
+
preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
|
|
114
|
+
#else
|
|
115
|
+
preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
|
|
116
|
+
#endif
|
|
117
|
+
#else
|
|
118
|
+
preInfo.attenuation=1.0;
|
|
119
|
+
#endif
|
|
120
|
+
#if defined(HEMILIGHT{X})
|
|
121
|
+
preInfo.roughness=roughness;
|
|
122
|
+
#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
|
|
123
|
+
preInfo.roughness=roughness;
|
|
124
|
+
#else
|
|
125
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
|
|
126
|
+
#endif
|
|
127
|
+
preInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
|
|
128
|
+
#ifdef IRIDESCENCE
|
|
129
|
+
preInfo.iridescenceIntensity=iridescenceIntensity;
|
|
130
|
+
#endif
|
|
131
|
+
#ifdef SS_TRANSLUCENCY
|
|
132
|
+
info.diffuseTransmission=vec3(0.0);
|
|
133
|
+
#endif
|
|
134
|
+
#ifdef HEMILIGHT{X}
|
|
135
|
+
info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);
|
|
136
|
+
#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
|
|
137
|
+
info.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb);
|
|
138
|
+
#elif defined(SS_TRANSLUCENCY)
|
|
139
|
+
#ifndef SS_TRANSLUCENCY_LEGACY
|
|
140
|
+
info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
|
|
141
|
+
#else
|
|
142
|
+
info.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
|
|
143
|
+
#endif
|
|
144
|
+
#else
|
|
145
|
+
info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);
|
|
146
|
+
#endif
|
|
147
|
+
#ifdef SPECULARTERM
|
|
148
|
+
#if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
|
|
149
|
+
info.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
|
|
150
|
+
#else
|
|
151
|
+
#if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)
|
|
152
|
+
{vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);}
|
|
153
|
+
#else
|
|
154
|
+
coloredFresnel=fresnelSchlickGGX(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
|
|
155
|
+
#endif
|
|
156
|
+
#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
|
|
157
|
+
{float NdotH=dot(normalW,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);}
|
|
158
|
+
#endif
|
|
159
|
+
#ifdef ANISOTROPIC
|
|
160
|
+
info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
|
|
161
|
+
#else
|
|
162
|
+
info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb);
|
|
163
|
+
#endif
|
|
164
|
+
#endif
|
|
165
|
+
#endif
|
|
166
|
+
#ifndef AREALIGHT{X}
|
|
167
|
+
#ifdef SHEEN
|
|
168
|
+
#ifdef SHEEN_LINKWITHALBEDO
|
|
169
|
+
preInfo.roughness=sheenOut.sheenIntensity;
|
|
170
|
+
#else
|
|
171
|
+
#ifdef HEMILIGHT{X}
|
|
172
|
+
preInfo.roughness=sheenOut.sheenRoughness;
|
|
173
|
+
#else
|
|
174
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
|
|
175
|
+
#endif
|
|
176
|
+
#endif
|
|
177
|
+
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
|
|
178
|
+
#endif
|
|
179
|
+
#ifdef CLEARCOAT
|
|
180
|
+
#ifdef HEMILIGHT{X}
|
|
181
|
+
preInfo.roughness=clearcoatOut.clearCoatRoughness;
|
|
182
|
+
#else
|
|
183
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
|
|
184
|
+
#endif
|
|
185
|
+
info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);
|
|
186
|
+
#ifdef CLEARCOAT_TINT
|
|
187
|
+
absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
|
|
188
|
+
#ifdef SS_TRANSLUCENCY
|
|
189
|
+
info.diffuseTransmission*=absorption;
|
|
190
|
+
#endif
|
|
191
|
+
#ifdef SPECULARTERM
|
|
192
|
+
info.specular*=absorption;
|
|
193
|
+
#endif
|
|
194
|
+
#endif
|
|
195
|
+
info.diffuse*=info.clearCoat.w;
|
|
196
|
+
#ifdef SS_TRANSLUCENCY
|
|
197
|
+
info.diffuseTransmission*=info.clearCoat.w;
|
|
198
|
+
#endif
|
|
199
|
+
#ifdef SPECULARTERM
|
|
200
|
+
info.specular*=info.clearCoat.w;
|
|
201
|
+
#endif
|
|
202
|
+
#ifdef SHEEN
|
|
203
|
+
info.sheen*=info.clearCoat.w;
|
|
204
|
+
#endif
|
|
205
|
+
#endif
|
|
206
|
+
#endif
|
|
207
|
+
#else
|
|
208
|
+
#ifdef SPOTLIGHT{X}
|
|
209
|
+
#ifdef IESLIGHTTEXTURE{X}
|
|
210
|
+
info=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X});
|
|
211
|
+
#else
|
|
212
|
+
info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
|
|
213
|
+
#endif
|
|
214
|
+
#elif defined(HEMILIGHT{X})
|
|
215
|
+
info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
|
|
216
|
+
#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
|
|
217
|
+
info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
|
|
218
|
+
#elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
|
|
219
|
+
#if defined(RECTAREALIGHTEMISSIONTEXTURE{X})
|
|
220
|
+
info=computeAreaLightingWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,
|
|
221
|
+
#ifdef AREALIGHTNOROUGHTNESS
|
|
222
|
+
0.5
|
|
223
|
+
#else
|
|
224
|
+
vReflectionInfos.y
|
|
225
|
+
#endif
|
|
226
|
+
#else
|
|
227
|
+
info=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,
|
|
228
|
+
#ifdef AREALIGHTNOROUGHTNESS
|
|
229
|
+
0.5
|
|
230
|
+
#else
|
|
231
|
+
vReflectionInfos.y
|
|
232
|
+
#endif
|
|
233
|
+
#endif
|
|
234
|
+
);
|
|
235
|
+
#elif defined(CLUSTLIGHT{X}) && CLUSTLIGHT_BATCH>0
|
|
236
|
+
{int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(lightDataTexture{X},tileMaskTexture{X},viewDirectionW,normalW,light{X}.vLightData,ivec2(light{X}.vSliceRanges[sliceIndex]),glossiness);}
|
|
237
|
+
#endif
|
|
238
|
+
#endif
|
|
239
|
+
#ifdef PROJECTEDLIGHTTEXTURE{X}
|
|
240
|
+
info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW);
|
|
241
|
+
#endif
|
|
242
|
+
#endif
|
|
243
|
+
#ifdef SHADOW{X}
|
|
244
|
+
#ifdef SHADOWCSM{X}
|
|
245
|
+
for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)
|
|
246
|
+
{
|
|
247
|
+
#ifdef SHADOWCSM_RIGHTHANDED{X}
|
|
248
|
+
diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;
|
|
249
|
+
#else
|
|
250
|
+
diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;
|
|
251
|
+
#endif
|
|
252
|
+
if (diff{X}>=0.) {index{X}=i;break;}}
|
|
253
|
+
#ifdef SHADOWCSMUSESHADOWMAXZ{X}
|
|
254
|
+
if (index{X}>=0)
|
|
255
|
+
#endif
|
|
256
|
+
{
|
|
257
|
+
#if defined(SHADOWPCF{X})
|
|
258
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
259
|
+
shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
260
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
261
|
+
shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
262
|
+
#else
|
|
263
|
+
shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
264
|
+
#endif
|
|
265
|
+
#elif defined(SHADOWPCSS{X})
|
|
266
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
267
|
+
shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
268
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
269
|
+
shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
270
|
+
#else
|
|
271
|
+
shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
272
|
+
#endif
|
|
273
|
+
#else
|
|
274
|
+
shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
275
|
+
#endif
|
|
276
|
+
#ifdef SHADOWCSMDEBUG{X}
|
|
277
|
+
shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];
|
|
278
|
+
#endif
|
|
279
|
+
#ifndef SHADOWCSMNOBLEND{X}
|
|
280
|
+
float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
|
|
281
|
+
{index{X}+=1;float nextShadow=0.;
|
|
282
|
+
#if defined(SHADOWPCF{X})
|
|
283
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
284
|
+
nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
285
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
286
|
+
nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
287
|
+
#else
|
|
288
|
+
nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
289
|
+
#endif
|
|
290
|
+
#elif defined(SHADOWPCSS{X})
|
|
291
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
292
|
+
nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
293
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
294
|
+
nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
295
|
+
#else
|
|
296
|
+
nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
|
|
297
|
+
#endif
|
|
298
|
+
#else
|
|
299
|
+
nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
300
|
+
#endif
|
|
301
|
+
shadow=mix(nextShadow,shadow,diffRatio);
|
|
302
|
+
#ifdef SHADOWCSMDEBUG{X}
|
|
303
|
+
shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
|
|
304
|
+
#endif
|
|
305
|
+
}
|
|
306
|
+
#endif
|
|
307
|
+
}
|
|
308
|
+
#elif defined(SHADOWCLOSEESM{X})
|
|
309
|
+
#if defined(SHADOWCUBE{X})
|
|
310
|
+
shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
|
|
311
|
+
#else
|
|
312
|
+
shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
|
|
313
|
+
#endif
|
|
314
|
+
#elif defined(SHADOWESM{X})
|
|
315
|
+
#if defined(SHADOWCUBE{X})
|
|
316
|
+
shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
|
|
317
|
+
#else
|
|
318
|
+
shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
|
|
319
|
+
#endif
|
|
320
|
+
#elif defined(SHADOWPOISSON{X})
|
|
321
|
+
#if defined(SHADOWCUBE{X})
|
|
322
|
+
shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
|
|
323
|
+
#else
|
|
324
|
+
shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
325
|
+
#endif
|
|
326
|
+
#elif defined(SHADOWPCF{X})
|
|
327
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
328
|
+
shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
329
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
330
|
+
shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
331
|
+
#else
|
|
332
|
+
shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
333
|
+
#endif
|
|
334
|
+
#elif defined(SHADOWPCSS{X})
|
|
335
|
+
#if defined(SHADOWLOWQUALITY{X})
|
|
336
|
+
shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
337
|
+
#elif defined(SHADOWMEDIUMQUALITY{X})
|
|
338
|
+
shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
339
|
+
#else
|
|
340
|
+
shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
341
|
+
#endif
|
|
342
|
+
#else
|
|
343
|
+
#if defined(SHADOWCUBE{X})
|
|
344
|
+
shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues);
|
|
345
|
+
#else
|
|
346
|
+
shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
|
|
347
|
+
#endif
|
|
348
|
+
#endif
|
|
349
|
+
#ifdef SHADOWONLY
|
|
350
|
+
#ifndef SHADOWINUSE
|
|
351
|
+
#define SHADOWINUSE
|
|
352
|
+
#endif
|
|
353
|
+
globalShadow+=shadow;shadowLightCount+=1.0;
|
|
354
|
+
#endif
|
|
355
|
+
#else
|
|
356
|
+
shadow=1.;
|
|
357
|
+
#endif
|
|
358
|
+
aggShadow+=shadow;numLights+=1.0;
|
|
359
|
+
#ifndef SHADOWONLY
|
|
360
|
+
#ifdef CUSTOMUSERLIGHTING
|
|
361
|
+
diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
|
|
362
|
+
#ifdef SPECULARTERM
|
|
363
|
+
specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
|
|
364
|
+
#endif
|
|
365
|
+
#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
|
|
366
|
+
diffuseBase+=lightmapColor.rgb*shadow;
|
|
367
|
+
#ifdef SPECULARTERM
|
|
368
|
+
#ifndef LIGHTMAPNOSPECULAR{X}
|
|
369
|
+
specularBase+=info.specular*shadow*lightmapColor.rgb;
|
|
370
|
+
#endif
|
|
371
|
+
#endif
|
|
372
|
+
#ifdef CLEARCOAT
|
|
373
|
+
#ifndef LIGHTMAPNOSPECULAR{X}
|
|
374
|
+
clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
|
|
375
|
+
#endif
|
|
376
|
+
#endif
|
|
377
|
+
#ifdef SHEEN
|
|
378
|
+
#ifndef LIGHTMAPNOSPECULAR{X}
|
|
379
|
+
sheenBase+=info.sheen.rgb*shadow;
|
|
380
|
+
#endif
|
|
381
|
+
#endif
|
|
382
|
+
#else
|
|
383
|
+
#ifdef SHADOWCSMDEBUG{X}
|
|
384
|
+
diffuseBase+=info.diffuse*shadowDebug{X};
|
|
385
|
+
#else
|
|
386
|
+
diffuseBase+=info.diffuse*shadow;
|
|
387
|
+
#endif
|
|
388
|
+
#ifdef SS_TRANSLUCENCY
|
|
389
|
+
diffuseTransmissionBase+=info.diffuseTransmission*shadow;
|
|
390
|
+
#endif
|
|
391
|
+
#ifdef SPECULARTERM
|
|
392
|
+
specularBase+=info.specular*shadow;
|
|
393
|
+
#endif
|
|
394
|
+
#ifdef CLEARCOAT
|
|
395
|
+
clearCoatBase+=info.clearCoat.rgb*shadow;
|
|
396
|
+
#endif
|
|
397
|
+
#ifdef SHEEN
|
|
398
|
+
sheenBase+=info.sheen.rgb*shadow;
|
|
399
|
+
#endif
|
|
400
|
+
#endif
|
|
401
|
+
#endif
|
|
402
|
+
#endif
|
|
403
|
+
`;
|
|
404
|
+
e.IncludesShadersStore[o] || (e.IncludesShadersStore[o] = d);
|