Camera & Render

1、void Render();

Description

  Render the camera manually.

This will render the camera. It will use the camera‘s clear flags, target texture and all other settings.

  The camera will send OnPreCullOnPreRender & OnPostRender to any scripts attached, and render any eventual image filters.

  This is used for taking precise control of render order. To make use of this feature, create a camera and disable it. Then call Render on it.

  You are not able to call the Render function from a camera that is currently rendering. If you wish to do this create a copy of the camera, and make it match the original one using CopyFrom.

2、void CopyFrom(Cameraother);

Description

  Makes this camera‘s settings match other camera.

  This will copy all camera‘s variables (field of view, clear flags, culling mask, ...) from the other camera. It will also set this camera‘s transform to match the other camera, as well as this camera‘s layer to match the layer of the other camera.

  

3、static Camera main;

Description

  The first enabled camera tagged "MainCamera" (Read Only).

  Returns null if there is no such camera in the scene.

  This can be useful if you want one camera to match the other camera‘s setup, when doing custom rendering effects. For example when usingRenderWithShader.

4、void RenderWithShader(Shadershader, string replacementTag);

Description

  Render the camera with shader replacement.

  This will render the camera. It will use the camera‘s clear flags, target texture and all other settings.

  The camera will not send OnPreCullOnPreRender or OnPostRender to attached scripts. Image filters will not be rendered either.

  This is used for special effects, e.g. rendering screenspace normal buffer of the whole scene, heat vision and so on. To make use of this feature, usually you create a camera and disable it. Then call RenderWithShader on it.

  

You are not able to call the Render function from a camera that is currently rendering. If you wish to do this create a copy of the camera, and make it match the original one using CopyFrom.

5、ResetReplacementShader(): void;

Description

  Remove shader replacement from camera.

  Call this to end the effect of setting SetReplacementShader.

6、SetReplacementShader(shader: Shader, replacementTag: string): void;

Description

  Make the camera render with shader replacement.

  After calling this function, camera will render its view with shader replacement. Call ResetReplacementShader to reset it back to normal rendering.

时间: 2024-10-10 12:22:42

Camera & Render的相关文章

如何手动刷新camera摄像的数据

很简单 camera.Render (); 他就会刷新图像更新camera.targetTexture.

265行JavaScript代码的第一人称3D H5游戏Demo【个人总结1】

本文目的是分解前面的代码.其实,它得逻辑很清楚,只是对于我这种只是用过 Canvas 画线的人来说,这个还是很复杂的.我研究这个背景天空也是搞了一天,下面就是只加载天空的代码. 在线效果点击:http://1.codemo2.sinaapp.com/3d_demo_265line/index.html   [可以用键盘“左右”键控制][手机浏览器触控有些异常] 原理大概就是: 1. 创建主循环 一个无限循环 2. 主循环内重复调用绘制方法 3. 绘制方法: 针对 Player 的位置和方向,绘制

Unity API - C

废话不多说,一针见血,go! 一起来看 API Caching 缓存 Camera 摄像机 CapsuleCollider 胶囊碰撞器 CharacterController 角色控制器 CharacterJoint 角色关节 Cloth 布料 ClothRenderer 布料渲染器 ClothSkinningCoefficient 布料蒙皮系数 Collider 碰撞器 Collision 碰撞 Color 颜色 CombineInstance 合并实例 Caching 缓存 Caching.

Screen position out of view frustum

Screen position out of view frustum (screen pos 512.000000, 0.000000, 100.000000) (Camera rect 0 0 512 512) UnityEngine.Camera:Render() MirrorReflection2:OnWillRenderObject() (at Assets/UnityChanStage/Visualizer/MirrorReflection2.cs:118) 在用unity3d调优时

HTML学习总结(四)【canvas绘图、WebGL、SVG】

一.Canvas canvas是HTML5中新增一个HTML5标签与操作canvas的javascript API,它可以实现在网页中完成动态的2D与3D图像技术.<canvas> 标记和 SVG以及 VML 之间的一个重要的不同是,<canvas> 有一个基于 JavaScript 的绘图 API,而 SVG 和 VML 使用一个 XML 文档来描述绘图.SVG 绘图很容易编辑与生成,但功能明显要弱一些. canvas可以完成动画.游戏.图表.图像处理等原来需要Flash完成的一

Unity3d之截图

1.Application.CaptureScreenshot("Screenshot.png", 0); 2. exture2D CaptureScreenshot2(Rect rect) { // 先创建一个的空纹理,大小可根据实现需要来设置 Texture2D screenShot = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.RGB24,false); // 读取屏幕像素信息并存储为纹理数据,

(转)Unity3d的3种截图方法

下面是我总结的.在u3d中的,三种截屏方法: 1.使用Application类下的CaptureScreenshot方法. void CaptureScreen() { Application.CaptureScreenshot("Screenshot.png", 0); } 这个方法,截取的是某一帧时整个游戏的画面,或者说是全屏截图吧. a.不能针对某一个相机(camera)的画面,进行截图. b.对局部画面截图,实现起来不方便,效率也低,不建议在项目中使用: 虽然CaptureSc

Unity技巧集合

这篇文章将收集unity的相关技巧,会不断地更新内容. 1)保存运行中的状态 unity在运行状态时是不能够保存的.但在运行时编辑的时候,有时会发现比较好的效果想保存.这时可以在 "Hierarchy"中复制相关对象树,暂停游戏后替换原来的,就可以了. 2)Layer的用法 LayerMask.NameToLayer("Ground");  // 通过名字获取layer[狗刨学习网] 3D Raycast [csharp] view plaincopy Raycas

unity3d游戏开发之我见

游戏引擎想必大家都有所耳闻吧,比如当你在喝着可乐,盯着电脑屏幕,看到游戏场景内的角色在自己键盘鼠标的控制之下,享受着这种游戏的操作感,这种感觉之所以爽快,是因为他满足了你自己的思维(我想干什么就可以干什么),慢着,今天我们不谈论游戏心理,我们今天谈的是到底是什么让我们如此吸引而引人入胜呢?--游戏引擎 众所周知,游戏引擎对于游戏来说,那真的像跑车的引擎一样,是游戏表现的核心,现在为止,一些大型的游戏公司都有自己开发或收购的游戏引擎,比如Unreal(虚幻),暴雪自家的魔兽引擎,还有保守争议的显卡