zjie Posted October 17, 2019 Share Posted October 17, 2019 (edited) Hi guys, I am rendering points scatter on a geometry but is there a way to render only the points that are facing the camera? So as to prevent xray of the inside or the other side of the geometry. Or maybe it can be like a ramp, where the points near the camera is white, ramping to black at the other side, and multiply it to the pscale. pointsFacingCamera.hip Edited October 17, 2019 by zjie Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 17, 2019 Share Posted October 17, 2019 (edited) Hey, the simplest solution I see is to tag the faces that have normal direction away from the camera, and make the scattered points inherit that attribute / group, to delete these points later. You can compute a vector that goes from the position of the face toward camera position, and calculate the dot product between this vector and the normal of the face : if positive it is facing the camera, if negative it is oriented away, and you can tag the face. Use a primitive Wrangle to do that. Then scatter the points, let them inherit the proper attribute or group, and delete the ones that were spawn on the faces looking away. Edited October 17, 2019 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 17, 2019 Share Posted October 17, 2019 Another solution if you just have a point cloud with no geometry on which points are scattered : http://www.weizmann.ac.il/math/ronen/sites/math.ronen/files/uploads/katz_tal_basri_-_direct_visibility_of_point_sets.pdf The algo is quite easy to implement. 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted October 17, 2019 Share Posted October 17, 2019 You need to ray each point through your original mesh, and see if that occludes. Because you can have normals pointing towards you that are occluded. pigray.hip 1 Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 17, 2019 Share Posted October 17, 2019 You will have a nice video. And I am pretty sure I saw another one, probably from Entagma, but can't find it on Google, nor Patreon. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.