惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
U
Unit 42
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
小众软件
小众软件
V
Visual Studio Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
GbyAI
GbyAI
爱范儿
爱范儿
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
博客园_首页
D
Docker
A
About on SuperTechFans
G
Google Developers Blog
I
InfoQ
T
The Blog of Author Tim Ferriss
V
V2EX
博客园 - Franky

博客园 - 安徽飞雪游戏工作室

贴几张我们用irrlicht做的游戏截图 jpg图片效果有点差,看起来是不是有点像劲舞团? 3dmax导出为my3d教程 从内存中加载图片资源 3dmax文件导出到ms3d文件. irrlicht1.3中文支持 Audiere PK OpenAL 【原创】IrrLicht中ms3D模型不支持多个贴图问题的解决 【引】[翻译]Irrlicht引擎里的冲突检测与响应 [原创]IrrLicht中MS3D模型骨骼动画支持bug的排除 MS3D model 的 Frame count - 安徽飞雪游戏工作室 材质动画 Irrlicht 论坛好贴 精选(不断补充中...) [转]Scrolling Credits Code [转](C++) How to animate and move an entity [原创]为Irrlicht中的人物添加武器 [原创]IrrLicht的GUI使用 [原创]IrrLicht-1.0中文支持 [原创]一个在Irrlicht中会常用的字符串转换函数 [转]宽字符标量L"xx"在VC6.0/7.0和GNU g++中的不同实现。
[原创]Irrlicht中的Texture透明色(colorkey)
安徽飞雪游戏工作室 · 2006-07-23 · via 博客园 - 安徽飞雪游戏工作室

假设我们要使某一24位色的Texture(不带Alpha)对应的特定颜色在render时透明,可以先调用makeColorKeyTexture创建一个 1 bit alpha channel of the texture,然后把MaterialType设为EMT_TRANSPARENT_ALPHA_CHANNEL就搞定了。废话不多说了, 请看代码:

 scene::IAnimatedMesh* meshRabbit = smgr->getMesh("../../media/mouse22.ms3d");
 scene::IAnimatedMeshSceneNode* anodeRabbit = smgr->addAnimatedMeshSceneNode(meshRabbit);
 if(anodeRabbit)
 {
  driver->setTextureCreationFlag(video::ETCF_ALWAYS_16_BIT ,true);
  irr::video::ITexture* pTexture = driver->getTexture("../../media/wenli.jpg");
  driver->makeColorKeyTexture(pTexture,  core::position2d< s32 >(300,30));
 
  anodeRabbit->setMaterialTexture(0, pTexture);
  anodeRabbit->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL  );
  anodeRabbit->setPosition(core::vector3df(70,20,-60));
  anodeRabbit->setMaterialFlag(video::EMF_LIGHTING, false);
  anodeRabbit->setRotation(core::vector3df(0,180.0f,0));
  anodeRabbit->setAnimationSpeed(25*30);
 }

当然如果Texture本身就带alpha channel的话就不需要再makeColorKeyTexture了,另外还有两种模式可以尝试: EMT_TRANSPARENT_ADD_COLOR 和  EMT_TRANSPARENT_ALPHA_CHANNEL_REF。