Only show MASH objects within a camera's frustum?


#1

I have this MASH network where I want to control the visibility of the individual points by whether they’re visible to a camera or not.

How would I go about doing this?

This is an example of kind of what I need to do: https://www.youtube.com/watch?v=BrfRSx7ObL0

Though I would also like MASH network objects that are behind other objects to be hidden.

Edit:

So I figured out a solution for this which worked in our case.
What I basically did was attach a VRay rect light with 1.0 Directional and turned off all other light. I then combined all the geometry the MASH objects where to be scattered on, did an automatic UV mapping and then baked out the lighting for every single frame we were doing, saving those maps and naming them after which frame they represented.
I then used that image sequence as the texture mask for the MASH distribution.
Potentially there’s a better way to do this, but this worked at least!


#2

Here is a quick example on how to do that with Mash

file
https://ufile.io/a40vv


#3

Thanks for the help and the very nice demonstration ^^

Unfortunately this is about as far as I’ve gotten as well, using the frustum setting in the MASH visibility node. However, this doesn’t solve the problem that I need other objects in the scene to block the camera’s view and not show anything behind it.


#4

Is there a way to make a material that’s completely transparent when no light is hitting it, but completely lights up when a light shines on it? That way you could potentially solve it by parenting a light to the camera…


#5

if you have Soup, you can do more there is a vdb that you have a camera frustrum as well which will work in non Mash objects.


#6

Oh, cool! Does that mean that there is a way to use Soup to hide all objects not visible from a camera view?


#7

just making sure that we are talking the same, you want same thing that Mash is doing but with non mash objs right?


#8

That is not what I want to do.

Using MASH I have covered the surfaces of a room with small cubes to visualise a pointcloud.

I want to use a certain camera to control the visibility of these cubes, only showing the cubes visible through that particular camera.
In other words, all cubes who aren’t within the frustum OR are inside the frustum but hidden behind another object should be invisible.

Sorry if I was a bit unclear! After having spent a day trying to solve this my brain is in a bit of a mushy state.


#9

So I figured out a solution for this which worked in our case.
What I basically did was attach a VRay rect light with 1.0 Directional and turned off all other light. I then combined all the geometry the MASH objects where to be scattered on, did an automatic UV mapping and then baked out the lighting for every single frame we were doing, saving those maps and naming them after which frame they represented.
I then used that image sequence as the texture mask for the MASH distribution.
Potentially there’s a better way to do this, but this worked at least!