游戏开发论坛

 找回密码
 立即注册
搜索
查看: 5208|回复: 6

关于SetClipPlane的一点疑惑

[复制链接]

17

主题

51

帖子

51

积分

注册会员

Rank: 2

积分
51
发表于 2006-12-16 21:09:00 | 显示全部楼层 |阅读模式
最近在做折射效果,需要用到SetClipPlane以免水面的以上的东西被画入RefractMap中。
但是SDK里面的解释是在剪裁面固定管道下是WorlD中,而在可编程管道是在Clip状态下。

现在可编程管道的情况下:我把剪裁面设置成 <0,1,0,0>这个时候是正确的,是把可视面的下半截Clip掉了,但是我想在World的<0,1,0,0>也就是只显示Y轴的正半轴,我把这个<0,1,0,0>跟ViewProjMatrix已经相乘,但是却得不到我想要的结果。显示的是没有把完全把Y轴的负半轴Clip掉。我想请问一下为什么,是我哪里出错了么?

不知道我说清楚没有,请高手指点。谢谢。

35

主题

1735

帖子

1739

积分

金牌会员

Rank: 6Rank: 6

积分
1739
QQ
发表于 2006-12-17 22:26:00 | 显示全部楼层

Re:关于SetClipPlane的一点疑惑

知不道啊

34

主题

443

帖子

478

积分

中级会员

Rank: 3Rank: 3

积分
478
发表于 2010-1-17 19:46:00 | 显示全部楼层

Re:关于SetClipPlane的一点疑惑

同问

63

主题

181

帖子

181

积分

注册会员

Rank: 2

积分
181
发表于 2010-1-18 07:50:00 | 显示全部楼层

Re:关于SetClipPlane的一点疑惑

最好把渲染的图贴下,不太明白什么意思。不过感觉你可以试下吧plane设置成<0,-1,0,0>,可以截取水下部分。

34

主题

443

帖子

478

积分

中级会员

Rank: 3Rank: 3

积分
478
发表于 2010-1-18 15:17:00 | 显示全部楼层

Re:关于SetClipPlane的一点疑惑

发现用Oblique Near-Plane Clipping就可以了,
http://www.terathon.com/code/oblique.html

59

主题

984

帖子

1200

积分

金牌会员

Rank: 6Rank: 6

积分
1200
发表于 2010-1-19 19:07:00 | 显示全部楼层

Re:关于SetClipPlane的一点疑惑

When using the fixed function pipeline these planes are defined in world space

When you are using the programmable pipeline (HLSL) however, the planes are assumed to be in clip space (which is typically just your eye/camera space). So to come up with the proper planes, we'll need to transform them from world space into clip space before we set them on the device.

34

主题

443

帖子

478

积分

中级会员

Rank: 3Rank: 3

积分
478
发表于 2010-1-20 09:00:00 | 显示全部楼层

Re: Re:关于SetClipPlane的一点疑惑

clayman: Re:关于SetClipPlane的一点疑惑

When using the fixed function pipeline these planes are defined in world space

When you are usin...

thx
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-15 23:54

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表