当前位置: 首页 > news >正文

Nebula3的渲染流程

在说流程之前, 有必要先看一下N3的Frame子系统:

每帧的渲染过程都写进了配置文件, 默认使用的是"frame\win32\dx9default.xml", 阴影还有另外一套.

<?xml version="1.0" encoding="UTF-8"?> <Nebula3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../schemas/frame.xsd"> <!-- Test frame shader for the Win32 platform. Renders a dedicated depth pass first, then renders the solid and alpha geometry to a (possibly multisampled) color buffer, and finally resolves the result through a post-effect into the backbuffer. --> <FrameShader name="DX9Default"> <!-- declare render targets --> <DeclareRenderTarget name="ColorBuffer" format="A8R8G8B8" depth="true" relWidth="1.0" relHeight="1.0" msaa="true"/> <!-- render the world to the BackBuffer render target --> <Pass name="Color" renderTarget="ColorBuffer" shader="p_color" clearColor="0.2,0.2,0.2,1.0" clearDepth="1.0" clearStencil="0"> <Batch shader="b_depth" type="Depth" shdFeatures="Depth" nodeFilter="Solid" sorting="FrontToBack" lighting="None"/> <Batch shader="b_solid" type="Solid" shdFeatures="Solid" nodeFilter="Solid" sorting="None" lighting="SinglePass"/> <Batch shader="b_alpha" type="Alpha" shdFeatures="Alpha" nodeFilter="Alpha" sorting="None" lighting="None"/> </Pass> <!-- apply a post effect with color correction, renders directly to the presentation buffer --> <PostEffect name="Compose" shader="pe_compose"> <ApplyShaderVariable sem="ColorBuffer" value="ColorBuffer"/> <!-- render debug stuff on top of complete frame --> <Batch shader="b_shape" type="Shapes"/> <Batch shader="b_empty" type="Text"/> </PostEffect> </FrameShader> </Nebula3>

在FrameShader的配置文件里, 声明了一些RenderTarget, 还有FramePass和FramePostEffect.

FramePass包装了所有要渲染到RenderTarget的所有3D渲染相关的东西, 由FrameBatch组成.

FrameBatch代表一个批次的ModelNodeInstance, 比如深度批次, 非透明批次和透明批次等等(相当于OGRE中的RenderGroup), 而ModelNodeInstance就做为最小的渲染单位了.

FramePostEffect就是后处理, 各种效果如HDR, Bloom, Depth of Field, Motion Blur等等都是在这里完成. Shadow Mapping有降采样也可以放到这里, 因为那也是图像空间的操作.

具体的流程就由流程图来说明吧:

InternalGraphicsServer代表就是图形世界, 在图形库外部对应前面提过的Stage/View.

一个Graphics View的作用就是把一个Stage通过CameraEntity渲染到RenderTarget上. 一个Stage可以有多个View, 而一个View也可以依赖另一个.

相关文章:

  • jquery 小记
  • 使用asx3m与xstream配合解决flex与java利用httpservice传递xml数据问题
  • 你必须知道的最好的开源WEB 资源
  • 四种流行的AJAX框架jQuery,Mootools,Dojo,ExtJS的对比
  • 平衡二叉查找树(AVL)
  • 数据结构之链栈 C++实现
  • C#中用NamedPipe进程间通信
  • C++类四个默认函数---构造函数、析构函数、拷贝函数、赋值函数
  • 实现两个DataTable的联合查询
  • 数学之美:GOOGLE新闻归类算法与余弦定理
  • 数据中心面临IT绩效管理的更高挑战
  • 如何确定网页和查询的相关性
  • 使用线性探测法构造哈希表
  • AjaxGWT
  • jquery获得radio选中项
  • [译] React v16.8: 含有Hooks的版本
  • JAVA_NIO系列——Channel和Buffer详解
  • PAT A1050
  • select2 取值 遍历 设置默认值
  • Spring Boot MyBatis配置多种数据库
  • SpringCloud(第 039 篇)链接Mysql数据库,通过JpaRepository编写数据库访问
  • vue总结
  • 闭包--闭包之tab栏切换(四)
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 仿天猫超市收藏抛物线动画工具库
  • 官方新出的 Kotlin 扩展库 KTX,到底帮你干了什么?
  • 机器人定位导航技术 激光SLAM与视觉SLAM谁更胜一筹?
  • 利用阿里云 OSS 搭建私有 Docker 仓库
  • 聊聊redis的数据结构的应用
  • 批量截取pdf文件
  • 区块链将重新定义世界
  • 使用前端开发工具包WijmoJS - 创建自定义DropDownTree控件(包含源代码)
  • 双管齐下,VMware的容器新战略
  • 说说动画卡顿的解决方案
  • 它承受着该等级不该有的简单, leetcode 564 寻找最近的回文数
  • 腾讯优测优分享 | 你是否体验过Android手机插入耳机后仍外放的尴尬?
  • 我是如何设计 Upload 上传组件的
  • 想晋级高级工程师只知道表面是不够的!Git内部原理介绍
  • 学习ES6 变量的解构赋值
  • !! 2.对十份论文和报告中的关于OpenCV和Android NDK开发的总结
  • #每日一题合集#牛客JZ23-JZ33
  • (PHP)设置修改 Apache 文件根目录 (Document Root)(转帖)
  • (Repost) Getting Genode with TrustZone on the i.MX
  • (SpringBoot)第二章:Spring创建和使用
  • (翻译)Entity Framework技巧系列之七 - Tip 26 – 28
  • (附源码)spring boot网络空间安全实验教学示范中心网站 毕业设计 111454
  • (转)EXC_BREAKPOINT僵尸错误
  • .bat批处理(二):%0 %1——给批处理脚本传递参数
  • .NET 简介:跨平台、开源、高性能的开发平台
  • .NET 中 GetProcess 相关方法的性能
  • .NET 中创建支持集合初始化器的类型
  • .Net下C#针对Excel开发控件汇总(ClosedXML,EPPlus,NPOI)
  • // an array of int
  • @Builder用法
  • @SpringBootApplication 包含的三个注解及其含义