Axiom3D学习日记 3.Cameras, Lights, and Shadows
Camera 相机:
相机基础知识不写了,需要注意的是:axiom目前不支持同时操作多个相机.
创建,设置位置基本操作.
_camera = _scene.CreateCamera("MainCamera");
_camera.Position = new Vector3(, , );
_camera.LookAt(Vector3.Zero);
_camera.Near = 5;决定了相机可视范围.
ViewPort(视口)
当要显示多个窗口时候用,这个我不怎么需要,就不写了.
Shadows in Axiom(重点来了)
Axiom有3种不同阴影.
- 纹理阴影:计算成本最低的一种.
- Modulative Stencil Shadows:较第三种没那么密集
- Additive Stencil Shadows:会叠加计算每个灯光的阴影,对GPU来说是比较大的负担.
遗憾的是:Axiom不支持软阴影,如果需要软阴影,需要自己写顶点和片段程序.
使用阴影非常容易:
scene.AmbientLight = ColorEx.Black;
scene.ShadowTechnique = ShadowTechnique.StencilAdditive; Entity ent = scene.CreateEntity("ninja", "ninja.mesh");
ent.CastShadows = true;
scene.RootSceneNode.CreateChildSceneNode().AttachObject(ent);
灯光:
灯光类型:
- Point (LightType.Point) - 点光源,各个方向.
- Spotlight (LightType.Spotlight) - 聚光灯
- Directional (LightType.Directional) - 平行光
创建灯:
Light pointLight = scene.CreateLight("pointLight");
pointLight.Type = LightType.Point;
pointLight.Position = new Vector3(, , );
pointLight.DiffuseColor = ColorEx.Red;
pointLight.SpecularColor = ColorEx.Red;
Light spotLight = scene.CreateLight("spotLight");
spotLight.Type = LightType.SpotLight;
spotLight.DiffuseColor = ColorEx.Blue;
spotLight.SpecularColor = ColorEx.Blue;
spotLight.Direction = new Vector3(-, -, );
spotLight.Position = new Vector3(, , );
Axiom3D学习日记 3.Cameras, Lights, and Shadows的更多相关文章
- Axiom3D学习日记 5.Frame Listeners, and Input Handling
Frame Listeners In Ogre's C++, we would register a class to receive notification before and after a ...
- Axiom3D学习日记 4.地形,天空,雾
首先需要引用Axiom.SceneManagers.Octree.dll. 地形: 载入地形配置,从一个文件中. scene.LoadWorldGeometry( "Terrain.xml& ...
- Axiom3D学习日记 0.Axiom基础知识
Axiom 3D Engine An open-source, cross-platform, managed 3D rendering engine for DirectX, XNA and Ope ...
- Axiom3D学习日记 2.介绍SceneManager,SceneNode,Entity
SceneManager(场景管理类) 所有出现在屏幕里的东西都受SceneManager管理(最好是这样),当你放置对象在场景里,SceneManager就会跟踪他们的位置,当你为场景创建一个相机, ...
- Axiom3D学习日记 1.程序配置
1.需要引用的库 Axiom Axiom.Framework Axiom.Platforms.Win32 Axiom.Plugins.FreeImageCodecs Axiom.Plugins.Par ...
- Linux学习日记-使用EF6 Code First(四)
一.在linux上使用EF 开发环境 VS2013+mono 3.10.0 +EF 6.1.0 先检测一下EF是不是6的 如果不是 请参阅 Linux学习日记-EF6的安装升级(三) 由于我的数据库 ...
- android学习日记05--Activity间的跳转Intent实现
Activity间的跳转 Android中的Activity就是Android应用与用户的接口,所以了解Activity间的跳转还是必要的.在 Android 中,不同的 Activity 实例可能运 ...
- android学习日记03--常用控件Dialog
常用控件 9.Dialog 我们经常会需要在Android界面上弹出一些对话框,比如询问用户或者让用户选择.这些功能我们叫它Android Dialog对话框 对话框,要创建对话框之前首先要创建Bui ...
- android学习日记03--常用控件checkbox/radiobutton
常用控件3.checkbox 复选框,确定是否勾选,点击一下勾选,点击第二下取消,当有一系列备选项时适合用checkbox控件,方便用户提交数据. 贴上例子Activity的java代码 packag ...
随机推荐
- 【UVA10537】The Toll! Revisited (逆推最短路)
题目: Sample Input1a Z19 a Z5A DD XA bb cc X39 A X-1Sample OutputCase 1:20a-ZCase 2:44A-b-c-X 题意: 有两种节 ...
- EAFP和LBYL 两种防御性编程风格
EAFP:Easier to ask for forgiveness than permission 获得事后原理总是比事先得到许可要容易的多. 这个EAFP在python中表现的比较多.EAFP,T ...
- Invitation Cards(邻接表+逆向建图+SPFA)
Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 17538 Accepted: 5721 Description In ...
- removeTask
SystemUI中,Home键调出小刷子杀最近任务,整个流程从其RecentsPanelView.java开始: public void handleSwipe(View view) { ... // ...
- C_FORCE_ROOT linux环境变量设置
nano /etc/profile gedit 也可以 结尾追加 export C_FORCE_ROOT="true"
- Bzoj 3809: Gty的二逼妹子序列 莫队,分块
3809: Gty的二逼妹子序列 Time Limit: 35 Sec Memory Limit: 28 MBSubmit: 868 Solved: 234[Submit][Status][Dis ...
- TCP协议状态简介
原文出自:Vimer的程序世界 1.建立连接协议(三次握手)(1)客户端发送一个带SYN标志的TCP报文到服务器.这是三次握手过程中的报文1.(2) 服务器端回应客户端的,这是三次握手中的第2个报文, ...
- snatch
https://www.imququ.com/post/use-berserkjs-in-mac.html http://www.one-lab.net/ http://www.oschina.net ...
- Jquery 进度条集锦
http://sc.chinaz.com/tag_jiaoben/JinDuTiao.html?qq-pf-to=pcqq.group
- xen credit scheduler and policy
最近在研究xen的vcpu 调度和cpu qos策略,现在默认的scheduler是credit, 对应的代码是sched_credit.c xen支持好几种控制策略,效果最好的当选pin, 灵活性最 ...