当前位置:网站首页>SampleCameraFilter
SampleCameraFilter
2022-04-23 07:46:00 【老少年】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Camera))/*,ExecuteInEditMode*/]
public class SampleCameraFilter : MonoBehaviour {
public RenderTexture rt;
//src和des是引擎創建的對象,我們只能使用,但是不要自己引用到本地。
private void OnRenderImage(RenderTexture src, RenderTexture des)
{
Graphics.Blit(src, des);//這一句一定要有,保證畫面傳遞下去。不然會中斷camera畫面,別的濾鏡會失效。
//這裏要拷貝渲染出一張rt
if (rt == null)
{
rt = RenderTexture.GetTemporary(src.width, src.height);//unity自己在維護一個RenderTexture池,我們從緩存中取就行。
}
Graphics.Blit(src,rt);//拷貝圖像
}
private void OnDestroy()
{
if (rt != null)
{
RenderTexture.ReleaseTemporary(rt);//記得釋放引用
}
}
}
版权声明
本文为[老少年]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230626191528.html
边栏推荐
- FSM finite state machine
- Design optimization of MySQL database
- js之DOM学习获取元素
- js之作用域、作用域链、全局变量和局部变量
- 系统与软件安全研究(四)
- Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
- 如何判断点是否在多边形内(包含复杂多边形或者多边形数量很多的情况)
- 11. Table and library management
- 8. Paging query
- 2022.3.14 Ali written examination
猜你喜欢

ABAP 从CDS VIEW 发布OData Service示例

SAP 导出Excel文件打开显示:“xxx“的文件格式和扩展名不匹配。文件可能已损坏或不安全。除非您信任其来源,否则请勿打开。是否仍要打开它?

反思 | Android 音视频缓存机制的系统性设计

js之节点操作,为什么要学习节点操作

SAP ECC连接SAP PI系统配置

SAP PI/PO Soap2Proxy 消费外部ws示例

SAP PI/PO rfc2RESTful 發布rfc接口為RESTful示例(Proxy間接法)

How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)

H5 local storage data sessionstorage, localstorage

js之排他思想及案例
随机推荐
js之什么是事件?事件三要素以及操作元素
给定区段范围内字符串自生成代码
根据某一指定的表名、列名及列值来向前或向后N条查相关列值的SQL自定义标量值函数
SAP ECC连接SAP PI系统配置
事件管理之一
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
MySQL8.0 安装/卸载 教程【Window10版】
Date object (JS built-in object)
ABAP CDS VIEW WITH ASSOCIATION示例
Authorization server (simple construction of authorization server)
Hot change scheme and dynamic update strategy of mobile game
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
取得所有点列表中的最大值GetMaxPoint
MySQL storage engine
Super classic & Programming Guide (red and blue book) - Reading Notes
基于NLP的软件安全研究(一)
反思 | Android 音视频缓存机制的系统性设计
C# 多个矩形围成的多边形标注位置的问题
8. Paging query
keytool: command not found