- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Ogre中级教程7 翻译by CatDTable of contents目录Introduction先决条件Setting Up the Scene创建场景Creating a Texture创建纹理Writing Our Texture to a File写出我们的纹理到文件Implementing the Miniscreen实现迷你场景Creating a Material From Scratch从头创建一个材质Using a RenderTargetListener使用一个渲染目标监听器Render to Texture and Shaders渲染到纹理和阴影Exercises练习Easy简单Intermediate中级Difficult困难Advanced地狱(括弧笑)Conclusion总结Full Source全部代码Next下一节Introduction先决条件This tutorial covers the basics of rendering a scene to a texture. This technique is used for a variety of effects. It is particularly useful in combination with shaders. Motion blur effects can be created in this way.本教程涵盖了渲染纹理到一个场景,这个技术用于制作出各种效果,它在结合着色器时格外的有用,可以用这种方法创建动态模糊效果。The basic idea is rather simple. Instead of just sending render information strictly to our render window, we will also send the information to be rendered directly to a texture in our scene. This texture will then be used like a texture loaded from the hard drive.基本的想法非常简单,咱在咱的场景里发送直接渲染的信息到纹理来代替咱发送严格的渲染信息,这种结构将用起来像是使用一个已经被硬盘加载的纹理。The full source for this tutorial is?here.本教程的完整代码链接。Note:?There is also source available for the BaseApplication framework and Ogre 1.7?here.注意:我们同时也准备了Baseapplication框架和Ogre1.7的资源链接。Setting Up the Scene建立场景First, as usual, we are going to set up a basic scene. Add the following variables to your project.首先,和往常一样,咱准备建立一个基本的场景,为你的工程添加下面的代码:BasicApp.hOgre::MovablePlane* mPlane;Ogre::Entity* mPlaneEntity;Ogre::SceneNode* mPlaneNode;Ogre::Rectangle2D* mMiniscreen;Remember to initalize them all in the constructor.记得在构造器里面注册这些:BasicApp.cppmPlane(0),mPlaneEntity(0),mPlaneNode(0),mMiniscreen(0)Finally, well set up the basic scene elements we need. Add the following to?createScene:终于,咱准备好了咱创建基本场景所需要的所有元素辣,将下面的代码扔进咱的createScene()创建场景函数里:mSceneMgr-setAmbientLight(Ogre::ColourValue(0.2,0.2,0.2));?//设置环境灯光颜色为0.2,0.2,0.2最大值为1Ogre::Light* light = mSceneMgr-createLight(MainLight);light-setPosition(20,80,50);?//创建MainLight这里没有设置灯光的类型,采取了默认的设置mCamera-setPosition(60,200,70);mCamera-lookAt(0,0,0
文档评论(0)