Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is this Raycast normal behavior?

3 REPLIES 3
Reply
Message 1 of 4
brandaosa
196 Views, 3 Replies

Is this Raycast normal behavior?

I have an irregular surface (mountains) where I will scatter points.
The goal was just to cull points display behind each other along camera line. So I thought about the raycast node. But it was a bit costly to make the setup to work so I am here to double check.

I have to first remove points where normals were facing out the camera.
But the problem is that for the mountain surface, some faces will still face the camera even if they were culled a surface nearer the camera.
I tried to raycast from the camera to the remaining points. It works by clearing the points culled by nearer surfaces but instead of deleting these points, the node reproject it on the nearer surface (on the video, you can see the "dancing/sliding" blue circles) So to get the effect I needed, I had to compare the points original positions with the points after raycast (dancing) and remove those which distance were > 0.

 

GRAY POINTS displays the intended result

 

complicated raycast.png

 

Notice points will not overlap on camera. Below, the holes on the mesh can be see more clearly.



Why raycast is reprojecting points back?

Labels (4)
3 REPLIES 3
Message 2 of 4
sepu6
in reply to: brandaosa

Without looking at a file, difficult to help. It could be also the method that you are projecting or a bug. Also, worth having a look at these threads.  


https://discord.com/channels/872260298508222534/1065636496637435924

https://discord.com/channels/872260298508222534/1067839241331150889

Message 3 of 4
brandaosa
in reply to: brandaosa

by the way the file, except for the montain = a plane with two wave modifiers - can be replicated by looking at the graph. I will check if this is the behaviour in a different version. THanks

Message 4 of 4
jason-t-brown
in reply to: brandaosa

The "dancing circles" you are seeing are the results of the location scope - it's showing you where the rays are hitting on the surface closest to the camera.  If you turn off "circles at sample" on the location scope, they will disappear.

The method I use for doing this still uses a raycast, but is simpler - what I do is set everything up so that the rays are being cast at the camera, then look for any rays that register a hit.  You have to be careful that you have `min_distance` on the raycast compound set to a number above zero, or the hits will happen at the very start of the raycast.

Hope this helps

jasontbrown_0-1718890725716.png

 



Jason Brown
Software Developer, Bifrost

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report