随笔 - 505  文章 - 1034  trackbacks - 0
<2007年11月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678


子曾经曰过:编程无他,唯手熟尔!

常用链接

留言簿(94)

随笔分类(649)

随笔档案(505)

相册

BCB

Crytek

  • crymod
  • Crytek's Offical Modding Portal

Game Industry

OGRE

other

Programmers

Qt

WOW Stuff

搜索

  •  

积分与排名

  • 积分 - 893947
  • 排名 - 14

最新随笔

最新评论

阅读排行榜

评论排行榜

在游戏里面鼠标与某个npc相交了后,就让npc的边缘高亮显示或者怎么处理下,让玩家很明确地知道他点下去就能选中此npc。《卓越之剑》有这效果。google了下没找到相关资料。

我在gamedev上的提问
when the cursor is over an entity, I want to highlight it's edge so that a player can immediately know he can pick this
entity after he click the mouse left button.for example, there are many monsters around the main character in the game,
 it is not easy to pick one monster.I googled this,but found nothing.who can give me some suggestion?

老外的回答:
The simplest method is to draw the object colored in the highlight color, with some scaling to make it larger than the

original object. Do this drawing with depth writes turned off. Then, after this, draw the object as usual, with depth

writes on again.There are more complex methods, depending on your application - depending on what is your bottleneck,

depending on complexity of your monster models etc etc. but the method above is simple to implement and should work
for most cases.



 

逍遥剑客对此问题的解决办法

2009-7-3
学习了这么久,也自己试试


遇到的问题:
Pass 0  Render State设为D3DCULL_CW,
Pass 1 Render Staete要设为D3DCULL_None
http://msdn.microsoft.com/en-us/library/ee416459(VS.85).aspx
D3DCULL_CW
Cull back faces with clockwise vertices.
D3DCULL_CCW
Cull back faces with counterclockwise vertices.

下一步在目前的项目里实现下。
posted on 2007-11-18 20:30 七星重剑 阅读(1998) 评论(6)  编辑 收藏 引用 所属分类: Game Graphics

FeedBack:
# re: 物件的边缘高亮(Entity edge highlight)[未登录] 2007-11-19 00:02 flyman
:-),这样确实很妙,有遮挡了,其不是出来一个圈,呵呵  回复  更多评论
  
# re: 物件的边缘高亮(Entity edge highlight) 2007-11-19 03:31 逍遥剑客
我解决了这个方法的缺点了,呵呵
放缩模型时用法线方向上的放缩,这样就不会错位了
然后放大的模型用D3DCULL_CW来渲染,这样也就不用关闭Depth-Write了
明天看看咋加到游戏里去  回复  更多评论
  
# re: 物件的边缘高亮(Entity edge highlight) 2007-11-19 12:18 重剑
@逍遥剑客
good work  回复  更多评论
  
# re: 物件的边缘高亮(Entity edge highlight) 2007-11-19 12:18 重剑
@flyman
gamedev上高手多啊  回复  更多评论
  
# re: 物件的边缘高亮(Entity edge highlight)[未登录] 2007-11-19 17:22 flyman
@逍遥剑客
你想的太妙了,这种方法确实不错。  回复  更多评论
  
# re: 物件的边缘高亮(Entity edge highlight) 2012-10-08 11:15 键盘
还是有问题把,如果遇到半透的或者中间是镂空的npc,不就穿帮了么?  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理