unity_art_puzzle_playable_luna/5.5.0/engine/luna/urp-1.js

1 line
8.5 KiB
JavaScript
Raw Permalink Normal View History

2023-12-21 08:46:57 +00:00
"use strict";(self.webpackChunkluna=self.webpackChunkluna||[]).push([[12],{52:(e,t,i)=>{var s=i(31),a=i(11),n=i(2),r=(i(26),i(38)),o=i(0);const d=256,h=new Float32Array(d),l=new Float32Array(d),c=new Float32Array(d),g=new Float32Array(d),u=new Float32Array(d),p=new Float32Array(4),L=new Float32Array([4,0,0,0]),_=new Float32Array([0,0,0,0]),m=new Float32Array([0,0,0,0]),y=new Float32Array([0,0,0,0]),I=new Float32Array(16),E=new Float32Array([0,0,0,0]),T=new pc.Vec4,A=new pc.Vec4(-1,1,-1,-1),D=new o.i,R=[],P=[],C=[],v=[],U=new a.a,f=new a.a;let w=null;class S extends s.a{constructor(e,t,i){super(e,t,i),this.urpAsset=UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset,this.additionalLightsRenderingMode=this.urpAsset.AdditionalLightsRenderingMode;const s=this.device.scope;var a;this.unityUrpIds={mainLightColor:s.resolve("_MainLightColor"),mainLightPosition:s.resolve("_MainLightPosition"),lightDirection:s.resolve("_LightDirection"),unityLightData:s.resolve("unity_LightData"),lightIndices:s.resolve("unity_LightIndices[0]"),additionalLightsCount:s.resolve("_AdditionalLightsCount"),occlusionProbes:s.resolve("unity_ProbesOcclusion"),glossyEnvironmentColor:s.resolve("_GlossyEnvironmentColor"),additionalLightsPosition:s.resolve("_AdditionalLightsPosition[0]"),additionalLightsColor:s.resolve("_AdditionalLightsColor[0]"),additionalLightsAttenuation:s.resolve("_AdditionalLightsAttenuation[0]"),additionalLightsSpotDir:s.resolve("_AdditionalLightsSpotDir[0]"),additionalLightsOcclusionProbe:s.resolve("_AdditionalLightsOcclusionProbes[0]"),cameraOpaqueTexture:s.resolve("_CameraOpaqueTexture"),scaledScreenParamsId:s.resolve("_ScaledScreenParams"),invCameraViewProj:s.resolve((a="_InvCameraViewProj","hlslcc_mtx4x4"+a+"[0]"))}}setCamera(e,t,i=!1){D.copy(e.invViewProjMat),this.unityUrpIds.invCameraViewProj.setValue(D.data),super.setCamera(e,t,i)}processClear(e){if(e.additionalCameraData.renderType===n.c.URP_CAMERA_RENDER_TYPE_BASE)this.device.clear(e.camera._clearOptions);else if(e.additionalCameraData.renderType===n.c.URP_CAMERA_RENDER_TYPE_OVERLAY&&e.additionalCameraData.clearDepth){const e={depth:1,flags:n.c.CLEARFLAG_DEPTH};this.device.clear(e)}}renderCameras(e){for(let t=0;t<e.length;t++){const i=e[t];this.renderCamera(i);const s=i.additionalCameraData;if(s&&s.cameraStack)for(const e of s.cameraStack._items)e&&this.renderCamera(e.handle)}}getCameras(){return this.scene._urpBaseCameras}renderMeshInstance(e,t,i,s,r){const o=this.device,d=s.material,h=(s._shaderDefs&n.c.SHADERDEF_LM)>0;if(!d||0===s.mesh.primitive.length||0===s.mesh.primitive[0].count)return;this.getPassesFromMaterial(d);const l=R.length>0,c=v.length>0,g=C.length>0;if(!l&&!c&&!g)return;h&&s.configureLightmap(),this.updateScissor();const u=s.morphInstance&&s.morphInstance._vertexBuffer||s.mesh.vertexBuffer;if(this.device.setVertexBuffer(u,0),this.device.setIndexBuffer(s.mesh.indexBuffer[0]),this.app.counters.recordDrawCall(),s.mesh.meshInstance){const e=s.mesh.meshInstance.instancingData;this.app.counters.recordVertices(e&&e.count>0?u.numVertices*e.count:u.numVertices)}else this.app.counters.recordVertices(u.numVertices);if(this.setSkinning(this.device,s),this.setMaterial(this.device,s.material),this.pushUniforms(this.device,s.parameters),this.setDrawCall(this.device,s),o.setDepthRange((s._shaderDefs&n.c.SHADERDEF_RENDERTYPE_BACKGROUND)>0?1:0,1),e.merge(d.keywords),e.merge(U),h&&e.enableKeywordId(a.b.LIGHTMAP_ON),(s._shaderDefs&n.c.SHADERDEF_DIRLM)>0&&e.enableKeywordId(a.b.DIRLIGHTMAP_COMBINED),!g||l||c||this.renderMeshInstancePasses(C,e,s),!l&&!c)return this.popUniforms(this.device,s.parameters),void this.setDrawCall(this.device,null);l&&(P[0]=R[0],this.drawUrpForwardLitPass(P,s,r,e,h,t,i)),c&&this.renderMeshInstancePasses(v,e,s),this.restoreScissorTest(),this.popUniforms(o,s.parameters),this.setDrawCall(o,null)}setupGlobalKeywordsForCamera(e,t){let i=!1,s=!1;for(let e=0;e<t.length;e++){if(t[e]._type===n.c.LIGHTTYPE_POINT||t[e]._type===n.c.LIGHTTYPE_DIRECTIONAL&&i){s=!0;break}t[e]._type===n.c.LIGHTTYPE_DIRECTIONAL&&(i=!0)}this.additionalLightsRenderingMode!==UnityEngi