国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁(yè) > news >正文

做信息網(wǎng)站怎么賺錢網(wǎng)絡(luò)營(yíng)銷廣告策劃

做信息網(wǎng)站怎么賺錢,網(wǎng)絡(luò)營(yíng)銷廣告策劃,WordPress推廣返傭插件,html5 手機(jī) 手機(jī)網(wǎng)站接著上一個(gè)討論的話題,關(guān)于3.8.x的后效,今天來(lái)分享自定義后效來(lái)制作模糊效果,并將他應(yīng)用到彈窗中做背景,話不多說(shuō)開整。 一:最終效果 首先咱們來(lái)看官網(wǎng)自定義后效怎么搞的,從它的實(shí)例開始:自定義后效 二:定義PostProcessSettings給節(jié)點(diǎn)提供資源(通過(guò)編輯器修改參數(shù)的…

接著上一個(gè)討論的話題,關(guān)于3.8.x的后效,今天來(lái)分享自定義后效來(lái)制作模糊效果,并將他應(yīng)用到彈窗中做背景,話不多說(shuō)開整。

一:最終效果

首先咱們來(lái)看官網(wǎng)自定義后效怎么搞的,從它的實(shí)例開始:自定義后效

二:定義PostProcessSettings給節(jié)點(diǎn)提供資源(通過(guò)編輯器修改參數(shù)的方式) 

首先自定義后效pass,需要一個(gè)組件用來(lái)我們可以修改具體的參數(shù),傳入具體的數(shù)據(jù),就要用到postProcess.PostProcessSetting這個(gè)類:

import { _decorator, gfx, postProcess, Material, EffectAsset, renderer, rendering, Vec4, Camera, CachedArray, Sprite } from 'cc';
const { Format } = gfxconst { ccclass, property, menu, executeInEditMode } = _decorator;/*** * 就是一個(gè)普通的組件 自定義后處理節(jié)點(diǎn)的資源和行為* */
@ccclass('GaussianBlur')
@menu('PostProcess/GaussianBlur')
@executeInEditMode
export class GaussianBlur extends postProcess.PostProcessSetting {/** 3d場(chǎng)景的攝像機(jī) */@property(Camera)mainCamera: Camera = null;/* 需要把后效產(chǎn)生的圖片輸出到特定的Sprite上 */@property(Sprite)preview: Sprite = null;/** 模糊材質(zhì) */@property(EffectAsset)_effectAsset: EffectAsset | undefined@property(EffectAsset)get effect() {return this._effectAsset;}set effect(v) {/** 根據(jù)傳入的模糊效果shader創(chuàng)建一個(gè)材質(zhì) 當(dāng)然你也可以在編輯器中拖入一個(gè)已經(jīng)綁定模糊shader的材質(zhì) */this._effectAsset = v;if (this._effectAsset == null) {this._material = null;}else {if (this._material == null) {this._material = new Material();}this._material.reset({ effectAsset: this._effectAsset });}this.updateMaterial();}@propertyiterations = 3;@propertyget blurRadius() {return this._blurParams.x;}set blurRadius(v) {this._blurParams.x = v;this.updateMaterial();}private _material: Material;public get material(): Material {return this._material;}@propertyprivate _blurParams: Vec4 = new Vec4(1.0, 0.0, 0.0, 0.0);public get blurParams(): Vec4 {return this._blurParams;}updateMaterial() {/** 設(shè)置材質(zhì)屬性 */if (!this._material) {return;}this._material.setProperty('blurParams', this.blurParams);}protected start(): void {if (this._effectAsset) {this._material = new Material();this._material.initialize({ effectAsset: this._effectAsset });this._material.setProperty('blurParams', this.blurParams);}}
}

 三:定義接收輸入定向輸出的節(jié)點(diǎn) SettingPass

既然是自定義管線,你做的效果總得有一個(gè)流入流出的節(jié)點(diǎn)吧,就相當(dāng)于blender里面的材質(zhì)節(jié)點(diǎn),虛幻的藍(lán)圖,你當(dāng)前的效果是需要依賴上一個(gè)流程中的輸入才可以正常工作的,當(dāng)然你處理完了還要將處理的結(jié)果返回到渲染管線當(dāng)中去利用,再處理等等操作。所以現(xiàn)在需要定義一個(gè)這樣一個(gè)節(jié)點(diǎn),反應(yīng)在cocos中就是SettingPass類:我們定義自己的SettingPass類

import { Camera, RenderTexture, SpriteFrame, Texture2D, UITransform, Vec2, Vec3, gfx, postProcess, renderer, rendering } from "cc";
import { GaussianBlur } from "./GaussianBlur";export class GaussianBlurPass extends postProcess.SettingPass {get setting() {return this.getSetting(GaussianBlur);}checkEnable(camera: renderer.scene.Camera) {// 判斷次后效是否開啟let enable = super.checkEnable(camera);if (postProcess.disablePostProcessForDebugView()) {enable = false;}return enable && this.setting.material != null;}name = 'GaussianBlurPass';outputNames = ['GaussianBlurMap'];private _blurPreview(camera: renderer.scene.Camera) {const setting = this.setting;let w, h;[w, h] = [camera.window.width, camera.window.height];let frame = new SpriteFrame();let texture = new RenderTexture();texture.initialize({name: "s",w
http://m.aloenet.com.cn/news/43780.html

相關(guān)文章:

  • 杭州灣新區(qū)建設(shè)局網(wǎng)站營(yíng)銷咨詢師
  • 解決做網(wǎng)站問題上海最新新聞
  • 網(wǎng)站bbs備案龍崗網(wǎng)站設(shè)計(jì)
  • 做網(wǎng)站備案湯陰縣seo快速排名有哪家好
  • 財(cái)務(wù)咨詢網(wǎng)站模板長(zhǎng)沙縣網(wǎng)絡(luò)營(yíng)銷咨詢
  • 個(gè)人網(wǎng)站做淘寶客犯法嗎寫軟文怎么接單子
  • 網(wǎng)站開發(fā)的主要特點(diǎn)網(wǎng)絡(luò)推廣公司網(wǎng)站
  • 汕頭住房與城鄉(xiāng)建設(shè)網(wǎng)站實(shí)體店引流推廣方法
  • 阿米納網(wǎng)站建設(shè)網(wǎng)上互聯(lián)網(wǎng)推廣
  • 做淘寶聯(lián)盟網(wǎng)站要多少錢百度高級(jí)搜索技巧
  • 阿里巴巴網(wǎng)站分類板塊做全屏全網(wǎng)營(yíng)銷推廣方案
  • 成都房地產(chǎn)最新政策seo是哪個(gè)英文的縮寫
  • 做外貿(mào)網(wǎng)站選美國(guó)服務(wù)器的費(fèi)用百度愛采購(gòu)優(yōu)化
  • 電子商務(wù)網(wǎng)站建設(shè)與實(shí)踐上機(jī)指導(dǎo)教程網(wǎng)絡(luò)營(yíng)銷最火的案例
  • 網(wǎng)站建站發(fā)布平臺(tái)企業(yè)網(wǎng)站建設(shè)推廣
  • 網(wǎng)站建設(shè)和維護(hù)公司百度怎么收錄自己的網(wǎng)站
  • window2003iis建好的網(wǎng)站上海網(wǎng)站排名優(yōu)化怎么做
  • 鎮(zhèn)海官方網(wǎng)站建設(shè)網(wǎng)絡(luò)銷售怎么做才能有業(yè)務(wù)
  • 做網(wǎng)站北京培訓(xùn)網(wǎng)絡(luò)營(yíng)銷的機(jī)構(gòu)
  • 裝修廣告做哪個(gè)網(wǎng)站最好看百度站長(zhǎng)平臺(tái)網(wǎng)頁(yè)版
  • 鹽城企業(yè)做網(wǎng)站多少錢網(wǎng)絡(luò)營(yíng)銷研究背景及意義
  • 國(guó)內(nèi)知名互聯(lián)網(wǎng)公司泉州seo按天計(jì)費(fèi)
  • 專業(yè)做展會(huì)網(wǎng)站網(wǎng)絡(luò)營(yíng)銷成功的品牌
  • 新鄉(xiāng)網(wǎng)站制作手機(jī)怎么做網(wǎng)站免費(fèi)的
  • WordPress短碼生成器廣州seo顧問seocnm
  • 網(wǎng)站音樂播放器插件衡水網(wǎng)站優(yōu)化推廣
  • 可以看所有網(wǎng)站的瀏覽器線在成都網(wǎng)站推廣公司
  • 石家莊做家教網(wǎng)站win10優(yōu)化大師有用嗎
  • 網(wǎng)頁(yè)兼容性站點(diǎn)app注冊(cè)推廣拉人
  • 做網(wǎng)站的工資無(wú)限制訪問國(guó)外的瀏覽器