three.js: THREE.Points: shader error with receiveShadow = true

In r73 (I don’t know in previous versions):

var points = new THREE.Points( geometry, material );
points.receiveShadow = true;

Throws “THREE.WebGLShader: gl.getShaderInfoLog() vertex ERROR: 0:234: ‘transformed’ : undeclared identifier”. I can see the ‘transformed’ in THREE.ShaderChunk[ “worldpos_vertex” ], but THREE.ShaderChunk[ ‘begin_vertex’] is not listed in THREE.ShaderLib.points.vertexShader

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

However, it’s going to be difficult to match the shadowed particle size with the visible particle size as each camera (shadow and user) has different dimensions.

Correct. Same for linewidth.

For that reason, I am not sure it makes sense to support shadows for points and lines. The only way it could ever properly work is if point size and line width were in world units (not pixels) – and could be attenuated in world units.

Also, I am not sure it makes sense for materials that do not respond to lights to cast shadows. That includes, MeshBasicMaterial, LineBasicMaterial, and PointsMaterial.

What features would you like to support? Then we can figure what materials we need, and their names.

Adding gl_PointSize = 10.0; to depthRGBA’s vertex shaders gets something going.

screen shot 2015-12-09 at 16 07 47

However, it’s going to be difficult to match the shadowed particle size with the visible particle size as each camera (shadow and user) has different dimensions.