Skip to content

Commit

Permalink
Merge pull request RobotWebTools#164 from SirVer/00_fix_alpha_test
Browse files Browse the repository at this point in the history
Fix alphaTest for Particles.
  • Loading branch information
T045T authored Feb 13, 2017
2 parents 5d6994f + 2f783a8 commit 791eef5
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 791eef5

Please sign in to comment.