Jump to content

Rendering only points that are facing camera


zjie

Recommended Posts

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. 

 

 

2019-10-17_1435.thumb.png.254b4fd31163144e1063c983b6555aa2.png

 

pointsFacingCamera.hip

 

Edited by zjie
Link to comment
Share on other sites

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 by StepbyStepVFX
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...