Skip to content

Commit

Permalink
Fix alphaTest for Particles.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirVer committed Feb 8, 2017
1 parent 20b92d1 commit 2f783a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion build/ros3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -3499,6 +3499,9 @@ ROS3D.Particles = function(options) {
'varying float falpha;',
'void main() ',
'{',
' // THREE.Material.alphaTest is not evaluated for ShaderMaterial, so we',
' // have to take care of this ourselves.',
' if (falpha < 0.5) discard;',
' // calculates a color for the particle',
' gl_FragColor = vec4( vColor, falpha );',
' // sets particle texture to desired color',
Expand Down Expand Up @@ -3528,7 +3531,7 @@ ROS3D.Particles = function(options) {
attributes: this.attribs,
vertexShader: this.vertex_shader,
fragmentShader: this.fragment_shader,
transparent: true, alphaTest: 0.5
transparent: true,
});

this.ps = new THREE.ParticleSystem( this.geom, this.shaderMaterial );
Expand Down
Loading

0 comments on commit 2f783a8

Please sign in to comment.