@script ExecuteInEditMode class EdgeDetectEffectNormals extends ImageEffectBase { var renderSceneShader : Shader; private var renderTexture : RenderTexture; private var shaderCamera : GameObject; function OnDisable() { super.OnDisable(); DestroyImmediate (shaderCamera); if (renderTexture != null) { RenderTexture.ReleaseTemporary (renderTexture); renderTexture = null; } //Unity3D教程手冊(cè):www.unitymanual.com } function OnPreRender() { if (!enabled || !gameObject.active) return; if (renderTexture != null) { RenderTexture.ReleaseTemporary (renderTexture); renderTexture = null; } renderTexture = RenderTexture.GetTemporary (camera.pixelWidth, camera.pixelHeight, 16); if (!shaderCamera) { shaderCamera = new GameObject("ShaderCamera", Camera); shaderCamera.camera.enabled = false; shaderCamera.hideFlags = HideFlags.HideAndDontSave; } //Unity3D腳本:www.unitymanual.com var cam = shaderCamera.camera; cam.CopyFrom (camera); cam.backgroundColor = Color(1,1,1,1); cam.clearFlags = CameraClearFlags.SolidColor; cam.targetTexture = renderTexture; cam.RenderWithShader (renderSceneShader, "RenderType"); } function OnRenderImage (source : RenderTexture, destination : RenderTexture) { var mat = material; mat.SetTexture("_NormalsTexture", renderTexture); ImageEffects.BlitWithMaterial (mat, source, destination); if (renderTexture != null) { RenderTexture.ReleaseTemporary (renderTexture); renderTexture = null; } } }站在用戶的角度思考問題,與客戶深入溝通,找到懷遠(yuǎn)網(wǎng)站設(shè)計(jì)與懷遠(yuǎn)網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、申請(qǐng)域名、雅安服務(wù)器托管、企業(yè)郵箱。業(yè)務(wù)覆蓋懷遠(yuǎn)地區(qū)。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。