提交 b8a7afa0 编写于 作者: W WestLangley

SizeAttenuation is for perspective camera only

上级 7e752948
......@@ -88,7 +88,8 @@ scene.add( starField );
<p>Sets the size of the points. Default is 1.0.</p>
<h3>[property:Boolean sizeAttenuation]</h3>
<p>Specify whether points' size will get smaller with the distance. Default is true.</p>
<p>Specify whether points' size is attenuated by the camera depth. (Perspective camera only.) Default is true.</p>
<h2>Methods</h2>
......
......@@ -15,10 +15,14 @@ void main() {
#include <morphtarget_vertex>
#include <project_vertex>
gl_PointSize = size;
#ifdef USE_SIZEATTENUATION
gl_PointSize = size * ( scale / - mvPosition.z );
#else
gl_PointSize = size;
bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
#endif
#include <logdepthbuf_vertex>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册