OGRE 手动LOD(Levels of Detail)多层次细节

OGRE为我们提供了自动生成LOD模型的工具,请参看我的另外一篇文章。但有时候由于该工具生成的自动LOD模型有问题(其原理就是模型简化,比如树模型有很多叶子面片,基本上无论如何简化,面片数都不会有明显的减少,而且将枝干简化后模型会严重形变),针对这种情况,我们可以在建模的时候手工进行模型简化,即导出多个不同精细度模型,然后通过下面的代码加入到OGRE里,程序在判断你指定的摄像机距离的时候就会自动将模型替换。


出处:http://blog.sina.com.cn/s/blog_6250d5a101015yrh.html

Levels ofDetail,意为多细节层次,LOD技术指根据物体模型的节点在显示环境中所处的位置和重要度,决定物体渲染的资源分配,降低非重要物体的面数和细节度,从而获得高效率的渲染运算。

Ogre的网格可以在建模软件中设置LOD,也可以在程序中自定义,注意如果一个mesh文件的LOD等级大于1的话就不能被自定义LOD

在Ogre中可以通过Mesh接口来自定义LOD级别,Ogre会根据用户定义的LOD级别以及摄像机与模型的距离自动给出相应的LOD模型

//载入初始网格

MeshPtrmesh=MeshManager::getSingleton().load("athene.mesh",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

//创建LOD模型,第一个参数是和摄像机的距离,第二个是LOD模型资源

mesh->createManualLodLevel(250,"athene_LOD1.mesh");

mesh->createManualLodLevel(500,"athene_LOD2.mesh");

//创建实体

m_entity=render->m_sm->createEntity(mesh->getName());

m_node=render->m_sm->getRootSceneNode()->createChildSceneNode();

m_node->attachObject(m_entity);

m_node->scale(0.1f,0.1f,0.1f);

m_node->setPosition(0.0f,500.0f,0.0f);



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Level of Detail for 3D Graphics作者: David Luebke , Martin Reddy , Jonathan D. Cohen , Amitabh Varshney , Benjamin Watson , Robert Huebner 出版:Morgan Kaufmann The Morgan Kaufmann Series in Computer Graphics and Geometric ModelingSeries Editor: Brian A. Barsky, University of California, BerkeleyLevel of detail (LOD) techniques are increasingly used by professional real-time developers to strike the balance between breathtaking virtual worlds and smooth, flowing animation. Level of Detail for 3D Graphics brings together, for the first time, the mechanisms, principles, practices, and theory needed by every graphics developer seeking to apply LOD methods.Continuing advances in level of detail management have brought this powerful technology to the forefront of 3D graphics optimization research. This book, written by the very researchers and developers who have built LOD technology, is both a state-of-the-art chronicle of LOD advances and a practical sourcebook, which will enable graphics developers from all disciplines to apply these formidable techniques to their own work.This Book:* Is a complete, practical resource for programmers wishing to incorporate LOD technology into their own systems.* Is an important reference for professionals in game development, computer animation, information visualization, real-time graphics and simulation, data capture and preview, CAD display, and virtual worlds.* Is accessible to anyone familiar with the essentials of computer science and interactive computer graphics.* Covers the full range of LOD methods from mesh simplification to error metrics, as well as advanced issues of human perception, temporal detail, and visual fidelity measurement.* Includes an accompanying Web site rich in supplementary material including source code, tools, 3D models, public domain software, documentation, LOD updates, and more.http://pixhost

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值