The illuminated point cloud is not on the side of the light source #1055
-
Hello. I found that point light sources can work properly on solid objects, but there is a slight issue with point clouds. I want the light source and the normal of the point cloud to be on the same side, thus illuminating the point cloud. But in reality, the point cloud that is always not on the side of the light source is illuminated. In this scene, there are two point clouds with opposite normals. Normally, there would be a point cloud illuminated on the same side as the light source, but the expected result does not occur. The illuminated point cloud is always not on the side of the light source. Do you know where the problem is? Is this normal? Although one point cloud is bright, it does not have the color of a purple light source There is a purple point cloud above, but the illuminated point cloud surface and light source are not on the same side |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
The green box represents the location of the point light source |
Beta Was this translation helpful? Give feedback.
-
In the case of the first image, the camera is facing the point cloud, and the surface of the point cloud is white. As the camera slowly tilts to view the point cloud, it gradually turns purple。 In the case of the first image, the light source is in front of the point cloud, the camera is facing the point cloud, and the surface of the point cloud is white. As the camera slowly tilts to view the point cloud, it gradually turns purple. |
Beta Was this translation helpful? Give feedback.
-
You haven't explain how the scene is constructed, or provided any details on the shaders used so there isn't anything we can suggest at this point. The best we can do is ask questions.
|
Beta Was this translation helpful? Give feedback.
Perhaps it's just that the specular highlight is not what you want.
As general comment if some points are lit and others black then it'll usually be just done to normals pointing towards the light resulting in lit points, while normals pointing away results in ones only light be an ambient light if you have one assigned.
In the vsgPoints/data/shaders/brick_phong.frag that vsgPoints uses by default has a VSG_TWO_SIDED_LIGHTING #define that you can assign to switch on the flipping of normal's that are facing away so both sides are lit. You should be able to assign your own ShaderSet and enable this by default, though in the future it would be nice to have the ability to inherit the defines …