Popular Post aaronsmith93 Posted September 10, 2020 Popular Post Share Posted September 10, 2020 Hello everyone! Every Monday at 12am for the last 3 weeks I have been uploading VEX snippets as mini-tutorials on my website: https://aaronsmith.tv/1-Minute-VEX Here, through '1 Minute VEX', I'll try to walk you through some of the more obscure and advanced functions that exist, and add as much explanation as possible to accompany the images in text based form. These are not for Houdini beginners! I also intend on all of my website's educational content being free - permanently. No donations, no subscriptions, no coupons. Below is 1 Minute VEX III as an example; Let me know if anyone has any suggestions for improvement! - 1 Minute VEX III - Ray-Cast Ambient Occlusion Quote In this example, we begin by creating a variable for position - offsetting it from the surface very slightly to avoid unintended ray intersections. Once we have assigned how many samples we want, and the hemispherical radius of our ambient occlusion (which determines how close geometry has to be to occlude), we use a for loop to iterate over each sample. We then generate a random hemispherical direction using our point normal, and use that directional vector as the ray. If our ray hits geometry, its distance from initial position is fit within a 1-0 range - 1 being the closest a ray could possibly be, and 0 being the furthest. This value is added and accumulated through the ‘ao’ variable, and then divided by the total number of samples added to the variable. We finally return the complement, in order to make close intersections dark, and distant rays / non intersections bright. 15 1 Quote Link to comment Share on other sites More sharing options...
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.