点精灵的缩放 (Direc3D 9)
请告诉我应该为 D3DRS_POINTSCALE_A、D3DRS_POINTSCALE_B、D3DRS_POINTSCALE_С 设置什么值,以像场景中的其他对象一样缩放点精灵。参数 A = 0 B = 0 和 C = 1(由 FD Luna 提出)不合适,因为比例不够准确,并且粒子(点精灵)之间的距离可能大于应有的距离。如果我将点精灵替换为广告牌,粒子的比例是正确的,但渲染速度要慢得多。请帮助我,因为渲染粒子的速度对于我的任务非常重要,但其比例的精确度也非常重要。
Direct3D 根据以下公式计算屏幕空间点大小: MSDN - 点精灵 我不明白应该为 A、B、C 设置什么值才能正确
缩放对不起我的英语我来自俄罗斯
Tell me please what values should I set for D3DRS_POINTSCALE_A, D3DRS_POINTSCALE_B, D3DRS_POINTSCALE_С to point sprites scaled just like other objects in the scene. The parameters A = 0 B = 0 and C = 1 (proposed by F. D. Luna) not suitable because the scale is not accurate enough and the distance between the particles (point sprites) can be greater than it should be. If I replace the point sprites to billboards, the scale of the particles is correct, but the rendering is much slower. Help me please because the speed of rendering particles for my task is very important but the precise of their scale is very important too.
Direct3D computes the screen-space point size according to the following formula:
MSDN - Point Sprites I can not understand what values should be set for A, B, C to scaling was correct
P.S. Sorry for my english I'm from Russia
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Directx 使用此函数来确定点的缩放大小:
eye_distance 的生成方式为:
所以回答您的问题:
D3DRS_POINTSCALE_A 是常量
D3DRS_POINTSCALE_B 是线性元素(缩放 eye_distance),
D3DRS_POINTSCALE_C 是二次元素(缩放 eye_distance 平方)。
Directx uses this function to determine scaled size of a point:
eye_distance is generated by:
So to answer your question:
D3DRS_POINTSCALE_A is the constant
D3DRS_POINTSCALE_B is the Linear element (scales eye_distance) and
D3DRS_POINTSCALE_C is the quadratic element (scales eye_distance squared).