3

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

4

1 回答 1

0

Directx 使用此函数来确定点的缩放大小:

out_scale = viewport_height * in_scale * sqrt( 1/( A + B * eye_distance + C * (eye_distance^2) ) )

eye_distance 由以下方式生成:

eye_position = sqrt(X^2 + Y^2 + Z^2)

所以回答你的问题:

D3DRS_POINTSCALE_A 是常数

D3DRS_POINTSCALE_B 是线性元素(缩放 eye_distance)和

D3DRS_POINTSCALE_C 是二次元(缩放 eye_distance 的平方)。

于 2018-04-30T17:22:47.660 回答