Wednesday, 2 May 2012

Blender-Cycles Ray Length node output

As I promised I'll try to code new features for Blender, to warm up with the source code base, lets start with some small features first, like this one:


Ray length output for LightPathNode:




-What?
For every ray that hits a surface, Cycles executes shader graph of the surface material hit point. The ray length output will correspond with the ray indicated in the other outputs (is xxxx ray). So in short, it is the length of the ray being shaded. 


-For what?
For example to create glass absorption/filtering based on the distance traveled by the transmission ray. Currently in Cycles with glass BSDF shader when you select the glass color, you are actually setting the way and the amount of the light is filtered by the glass, if you select bright green it means the tiny Impurity  particles in the glass are more likely to reflect the green color and absorb/transmit the red and blue colors,  the more darker the color the more light it is absorbed, the more bright the color the more light is transmitted (escapes) from the object:


As you can see in the above picture, the absorbed light Rays gets lost inside the material, and the reflected/transmitted rays can escape, the more reflected/transmitted rays the more transparent is the material, the more absorbed Rays the more darker is the surface.


What was missing in Cycles was the ability to reproduce the absorption based on the distance that light rays travel inside the surface, as you may guess the final absorption effect will be based on the density of those tiny impurity particles and how wide is the object. 


Now, the ray distance output actually gives you the distance of the light traveled, thus you can create a cool node setup to recreate, for example the absorption of the glass based on how wide the object it is:
Cycles tests:


As you can see, the more thick the objects parts, the more light is transmitted and not absorbed.






This is the node setup using the ray length output, what it does is with the first two math nodes convert the distance to a simpler exponential fallof/attenuation magnitude (the output distance is in blender units, so the exponential fallof maps it between 0 and 1 in an exponential way). then we add this value to the is ray camera, why? because we want to exclude this filtering effect from the camera ray so when Is Cam Ray is 1 it choose the white color, showing to the camera ray a clear glass, this is important because we only want to apply this attenuation only for the transmission and the other rays (again, except the camera)


The Backfacing parameter from Geometry node will tell not take into account the transmission rays that are outside of the object, so it doesn't get attenuated by the shader( this problem was discover by the BlenderArtist niabot, thanks! )


...But If you don't have time to understand that node setup, no problem!  
lets bundle them in a simple node group which you can consider an upgrade of the current glass BSDF:


Absorption parameter goes from 0 to -inf ( minus infinity ) the more negative the number the more absorption.




...But this doesn't stop here, now because you can know how far ray light traveled, you can create/fake many other materials, for example to recreate a pseudo sub-surface scattering effect using the length of the translucent ray:








This is an proximate ice material, if you watch closely you can see we are not even computing a single scattering event here, but with making the translucent shader taking into account the distance of the transmission rays, we can make more translucent the thicker parts and more opaque the wider parts of the objects


The cool thing about this very fake sss and translucent deep based material it is very fast shader setup to render and may be okay for several renders you want to do.


More test renders: (Click for enlarge)
















.blend file used for these test renders: 
 .Blend file (Fixed and updated)


Windows builds (I don't compile with Cuda but i'll try soon):
Win x64
Win x32
UPDATE: This patch(functionality) was committed to trunk! so you can go to graphicall.org or blender build bot to get a version supporting this feature.
Make sure it is at least the revision rev 46200


SVN Patch:
Cycles_LightPathLength_0.9.patch




Useful link:
Cycles Light Paths manual

Cheers!
Agus





111 comments:

  1. This is brilliant! I hope that you bug the Blender devs to get this included. I would love to be using this almost every day :)

    ReplyDelete
  2. Is already in Trunk... Well done.

    ReplyDelete
  3. Me encanta este desarrollo muy buen trabajo.

    Saludos

    ReplyDelete
  4. This is an awesome little feature, well done and congrats to get your first patch included THIS quickly.

    On a sidenote, there seems to be a bug with your blog for showing images.
    If I click on an image to enlarge it, the site will jump to the top of the page and the images will end up being shown behind the header. Furthermore, they aren't enlarged at all. Some even get shown smaller than they are when directly included into the page.

    I'm using this version of Firefox, if that helps:

    Build-Identifikator: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0

    ReplyDelete
  5. great feature!

    ReplyDelete
  6. Thanks guys!

    Hi @kram1032, i think it is how blogger works, as far as i know i can control the layout/color content, but i am not sure if i can control when you exit the image viewing mode where to jump or do that at all, also the images are actually small, only the wider gets shrink in the post, so those are the only worth to zoom.
    cheers,

    ReplyDelete
  7. Excellent. This is very useful. This should hold me until we get real sss. Although this is useful beyond only sss.

    ReplyDelete
  8. Agustin, you are doing some really good work on Cycles.

    Thank you very much.

    I notice you don't keep your blog very up to date with your developments, is there anywhere else where I can keep up to date with the work you are doing on Cycles.

    I am very excited about your mist and render time bevel. I think it is excellent to have a faster mist with volume light. I am still to try it out.

    Why don't you give us BSSRDF in Cycles, lol.

    Thanks again Agustin!!

    ReplyDelete
  9. Hello! Is there any way you can share Mist Patch + Quick Volume Shadows with us? I'd really appreciate it!

    ReplyDelete
  10. Hi. First off, thanks for this great patch. It's definitely a step in the right direction.

    Now, as for the demonstration, while it works as expected at object sizes in the demo, it doesn't work well for very small object in real-life scale, such as a glass of wine.

    Suzane scaled to 0.05 needs 2718 (1,000x) to 27180 (10,000x) in the power node in order to work. Now I have objects that are 5cm across in 1:1 scale, so this node gorup has no noticeable effect even when multiplying the power base by 1 million. Do you have any suggestions on how to deal with super-small objects (other than scaling them up, obviously).

    ReplyDelete
  11. In addition to my last comment, I've done some further testing, and the appearance is OK with 1,000,000x2.718 in power node, but only if normals are facing outwards. That is not the case in liquid-inside-glass-container scenario, where I also have flipped normals (or negative IOR). How can I adjust this node group for that scenario?

    ReplyDelete
  12. WAPEXP the best internet marketing company
    providing all solutions regarding web designing, development and search engine optimization with maximum of the quality of the work and time management and cost effective solutions for your business. All these quality services may take your business to another height on internet.

    ReplyDelete
  13. Belive me this is one of the best renders i have seen from Blender....Artists

    Cherrs
    Inks ...inka Blog

    ReplyDelete
  14. This post has shared the information about the unique creature. I really like this post and I used to see these types of creatures on TV. Thanks for updating the information like this. uk best essays

    ReplyDelete
  15. Wow, that is fantastic! Beautiful render!

    I also really liked your cycles island you did awhile back. I have learned so much by looking at the .blend file you shared.

    If you don't mind, I was wondering if I could find out where the sky texture from the cycles island scene is from initially. Did you make it yourself? Are there more like it where that came from?

    Anyway, thank you for sharing your expertise with the Blender community.

    ReplyDelete
  16. I am really enjoying reading your well written articles. I think you spend numerous effort and time updating your blog. I have bookmarked it and I am taking a look ahead to reading new articles. Please keep up the good articles!credit card online

    ReplyDelete
  17. This post has distributed the data about the exclusive creäture. I actually like this post and I utilised to see these kinds of animals on TV. Thanks for updating the data like this.

    For more visit-http://www.fieryescorts.co.uk/.

    ReplyDelete
  18. Easton Bell Electrical are your Melbourne based electricians, and it is our priority that
    we provide you with a friendly and courteous service while being professional and well presented.
    We pride ourselves on being on time and discussing with you what work suits you best. And best of all, We Clean Up!Caulfield Electrician

    ReplyDelete
  19. For example to create glass absorption/filtering based on the distance traveled by ... 2glassblender.blogspot.com

    ReplyDelete
  20. As I promised I'll try to code new features for Blender, to warm up with ... 2redblender.blogspot.com

    ReplyDelete
  21. This post has imparted the data about the remarkable animal. I truly like this post and I used to see these sorts of animals on TV. Much obliged concerning upgrading the data like this. Click Here

    ReplyDelete
  22. Now you can design by our online service of company logo designer. You watch closely you can see we are not even computing a single scattering event.

    ReplyDelete
  23. Nice post you have done here. I am really very happy to read this. This is a very informative topic that you are chosen. keep it upCustomer Contact Page

    ReplyDelete
  24. Students have magic in their hands as their hardwork pays them in shape of the best outcomes of their sculptures which they design and give them their inner thoughts through which they can talk tot he world and can tell the world the solution of assignment writer what wrong is happening in our society.

    ReplyDelete
  25. Thanks a lot for letting me a chance to visit your any pointers. Your article about web design is really impressed me very much.Communicator Plugin

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Buy Electronic Components in Online for affordable prices at Component Buy. Get 25% discount on Semiconductor micro controller relays Connectors and many more

    ReplyDelete
  28. Outer glass I really like that information. Now need to all over the world. So I like to your suggest webpage..Thank you

    ReplyDelete
  29. Thanks for sharing such informative article. Know about Know about English to Tamil from techfizy.

    ReplyDelete
  30. very usefull blog It was useful.thanks for sharing

    ReplyDelete
  31. Thank you for useful information. It is exactly what I needed. I managed to get here everything that I need for my article.

    light booth measurements

    ReplyDelete
  32. This is the great information. Thanks for providing.
    BEST JAVA TRAINING IN DELHI

    ReplyDelete
  33. Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.

    java training in marathahalli | java training in btm layout

    java training in jayanagar | java training in electronic city

    java training in chennai | java training in USA

    selenium training in chennai

    ReplyDelete
  34. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    python training in pune
    python online training
    python training in OMR

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Devops training in tambaram
    DevOps online Training
    DevOps Training in USA

    ReplyDelete
  37. Good Post, I am a big believer in posting comments on sites to let the blog writers know that they ve added something advantageous to the world wide web.
    Blueprism training institute in Chennai

    Blueprism online training

    ReplyDelete
  38. I have been meaning to write something like this on my website and you have given me an idea. Cheers.
    Blueprism training institute in Chennai

    Blueprism online training

    ReplyDelete
  39. UiPath Training in Bangalore by myTectra is one the best UiPath Training. myTectra is the market leader in providing Robotic Process Automation on UiPath
    robotic process automation training in bangalore

    ReplyDelete
  40. myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

    ReplyDelete

  41. It's Amazing! Am exceptionally Glad to peruse your blog. Numerous Will Get Good Knowledge After Reading Your Blog With The Good Stuff. Continue Sharing This Type Of Blogs For Further Uses.
    data science online training in Hyderabad
    best data science online training in Hyderabad
    data science training in Hyderabad

    ReplyDelete
  42. Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
    Selenium Training in Chennai | Selenium Training in Bangalore | Selenium Training in Pune | Selenium online Training

    ReplyDelete
  43. I am really enjoying reading your well-written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
    AWS Solution Architect
    AWS Certified Solutions Architect
    AWS Certification Training in Bangalore
    AWS Training in Mogappair
    AWS Training Institutes in Vadapalani

    ReplyDelete
  44. This is a nice post in an interesting line of content.Thanks for sharing this article, great way of bring this topic to discussion.
    angularjs Training in chennai
    angularjs-Training in pune

    angularjs-Training in chennai

    angularjs Training in chennai

    angularjs-Training in tambaram

    ReplyDelete
  45. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us. Do check Six Sigma Training in Bangalore | Six Sigma Training in Dubai & Get trained by an expert who will enrich you with the latest trends.

    ReplyDelete
  46. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us. Do check Six Sigma Training in Bangalore | Six Sigma Training in Dubai & Get trained by an expert who will enrich you with the latest trends.

    ReplyDelete
  47. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us. Do check Six Sigma Training in Bangalore | Six Sigma Training in Dubai & Get trained by an expert who will enrich you with the latest trends.

    ReplyDelete
  48. Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.
    Selenium Interview Questions and Answers

    ReplyDelete
  49. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    occupational health and safety course in chennai

    ReplyDelete
  50. I’m planning to start my blog soon, but I’m a little lost on everything. Would you suggest starting with a free platform like Word Press or go for a paid option? There are so many choices out there that I’m completely confused. Any suggestions? Thanks a lot.
    Best AWS Training in Marathahalli | AWS Training in Marathahalli
    Amazon Web Services Training in Anna Nagar, Chennai |Best AWS Training in Anna Nagar, Chennai
    AWS Training in Velachery | Best AWS Course in Velachery,Chennai
    Best AWS Training in Chennai | AWS Training Institutes |Chennai,Velachery

    ReplyDelete
  51. I’m planning to start my blog soon, but I’m a little lost on everything. Would you suggest starting with a free platform like Word Press or go for a paid option? There are so many choices out there that I’m completely confused. Any suggestions? Thanks a lot.
    Best AWS Training in Marathahalli | AWS Training in Marathahalli
    Amazon Web Services Training in Anna Nagar, Chennai |Best AWS Training in Anna Nagar, Chennai
    AWS Training in Velachery | Best AWS Course in Velachery,Chennai
    Best AWS Training in Chennai | AWS Training Institutes |Chennai,Velachery

    ReplyDelete
  52. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.industrial safety course in chennai

    ReplyDelete
  53. Great posting with useful topics.Thank you.
    http://eminentitinfo.com/course/data-science-training-in-bangalore ">data science course in bangalore

    ReplyDelete
  54. myTectra a global learning solutions company helps transform people and organization to gain real, lasting benefits.Join Today.Ready to Unlock your Learning Potential !Read More

    ReplyDelete
  55. myTectra offers corporate training services in Bangalore for range of courses on various domain including Information Technology, Digital Marketing and Business courses like Financial Accounting, Human Resource Management, Health and Safety, Soft Skill Development, Quality & Auditing, Food Safety & Hygiene. myTectra is one of the leading corporate training companies in bangalore offers training on more than 500+ courses
    corporate training in bangalore
    top 10 corporate training companies in india
    corporate training
    corporate training companies
    along these we are going to help the professionals and students to crack their interview with interview questions and answers look a head into sites you might be like....
    spring interview questions and answers for experienced
    salesforce interview questions

    ReplyDelete
  56. your post is the very organized way and easily understandable. Doing a good job. Thank you for sharing this content.
    rpa training in chennai | rpa training in velachery | rpa training in chennai omr


    ReplyDelete
  57. Thanks for you blog on Blueprism. the blog is very informative and full of knowledge on Blueprism.
    Thanks and regards,
    blue prism training cost in chennai

    ReplyDelete
  58. Thanks for your great and helpful presentation I like your good service.I always appreciate your post.That is very interesting I love reading and I am always searching for informative information like this Please keep Sharing For More info on blender please follow our android article.android device manager location history | android interview questions and answers |
    android best practices pdf

    ReplyDelete
  59. Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.

    Selenium Interview Questions and Answers
    Javascript Interview Questions
    Human Resource (HR) Interview Questions

    ReplyDelete
  60. If you need any kind of help regarding your assignment, please contact us. We will provide premium quality assignment at cheaper price with free plagiarism report and unlimited revision. Place order for 3 assignments and get your 4th assignment done for no cost. So hurry up, grab the offer now and score excellent grades in your exams. Our key features are given below-



    Ø On-Time Delivery

    Ø Plagiarism-Free Guarantee

    Ø Best Price Guarantee

    Ø Services For All Subjects

    Ø 100% Money Back Guarantee

    Ø Top Quality Work

    Ø Unlimited Revision

    Ø Safe Payment Options

    Ø 100% Privacy Guaranteed


    Kind Regards

    Oz Paper Help

    WhatsApp:- +61451746695, +447958580065

    Mail ID:- ozpaperhelp@gmail.com

    Website- https://www.ozpaperhelp.com

    ReplyDelete
  61. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.
    Data Science Training in chennai at Credo Systemz | data science course fees in chennai | data science course in chennai quora | data science with python training in chennai

    ReplyDelete
  62. Thanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up. 
    Data Science course in rajaji nagar
    Data Science with Python course in chenni
    Data Science course in electronic city
    Data Science course in USA
    Data science course in pune | Data Science Training institute in Pune

    ReplyDelete
  63. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.
    Data Science Training in chennai at Credo Systemz | data science course fees in chennai | data science course in chennai quora | data science with python training in chennai

    ReplyDelete
  64. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in velachery| rpa training in tambaram |rpa training in sholinganallur | rpa training in annanagar| rpa training in kalyannagar

    ReplyDelete
  65. A universal message I suppose, not giving up is the formula for success I think. Some things take longer than others to accomplish, so people must understand that they should have their eyes on the goal, and that should keep them motivated to see it out til the end.
    online Python training
    python training in chennai

    ReplyDelete
  66. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.Trending Software Technologies in 2018 | Hadoop Training in Chennai | big data Hadoop training and certification in Chennai

    ReplyDelete
  67. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.
    Data Science Training in chennai at Credo Systemz | data science course fees in chennai | data science course in chennai quora | data science with python training in chennai

    ReplyDelete
  68. Nice blog..! I really loved reading through this article. Thanks for sharing such
    a amazing post with us and keep blogging...
    Please keep Sharing For More info on data science please follow our article android interview coding test | android architecture best practices | android development guide

    ReplyDelete
  69. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    angularjs interview questions and answers

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs online Training

    angularjs Training in marathahalli

    ReplyDelete
  70. Thanks for such a great article here. I was searching for something like this for quite a long time and at last, I’ve found it on your blog. It was definitely interesting for me to read about their market situation nowadays. Well written article.Thank You for Sharing with Us angular 7 training in velachery | Best angular training institute in chennai

    ReplyDelete
  71. Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

    DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

    Good to learn about DevOps at this time.

    devops training in chennai | devops training in chennai with placement | devops training institutes in chennai | devops institutes in chennai | devops training in velachery | devops training in chennai omr | best devops training in chennai quora | devops online training in chennai

    ReplyDelete
  72. This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority.
    Java J2ee Training in Chennai
    German Training Institute in Chennai
    german language coaching centres in chennai
    Java Coaching Center in Chennai
    Best Java Training in Chennai
    German Training Centers in Chennai

    ReplyDelete
  73. Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Website. Please feel free to visit our site. Thank you for sharing.Well written article Thank You Sharing with Us project management certfication in chennai | project management training institute in chennai | pmp training fee | pmp certification course in chennai | best pmp training institute in chennai| | pmp training class in chennai \ pmp training fee

    ReplyDelete