Page 1 of 12 12311 ... LastLast
Results 1 to 20 of 240
  1. #1
    Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    338

    Experimental Cycles light portals

    Hi!

    Today, I tried out to implement light portals in Cycles, and it worked out really cool!

    For those who don't know about light portals (like me two days ago ): Essentially, they are guides placed in indoor scenes that help the renderer to "find" environment lighting. For a forward path tracer like Cycles, they are only useful for environment light, not for sunlight (that needs bidirectional transport, as in Lux).

    A quick example here:
    An example scene, just diffuse materials, lit by a single-color background light, 16 samples: http://www.pasteall.org/pic/83488
    The same scene, just with two portals in the wall gaps: http://www.pasteall.org/pic/83487
    And for reference, an equal-time comparison (no portals, same rendertime as the image with portals): http://www.pasteall.org/pic/83489

    It also works well with HDRI maps, not just with a single-colored background:
    Same scene, now with an environment texture: http://www.pasteall.org/pic/83496
    Same scene, with Multiple Importance sampling enabled (so, essentially the best you can get with "regular" Cycles):http://www.pasteall.org/pic/83497
    Same scene, now with both MIS and light portals: http://www.pasteall.org/pic/83498
    Same scene, only Portals now, no MIS: http://www.pasteall.org/pic/83499
    And, of course also an equal-time comparison (no portals or MIS): http://www.pasteall.org/pic/83500

    You can get a build for testing here (Win64): https://dl.orangedox.com/CqmcYSd7e5X...M3_P1_CUDA.zip

    To add a portal, add an area lamp that covers a light entry and check "is portal" in the lamp settings. Other types of lamps won't work. This setting also makes Cycles ignore the lamp for rendering, so the rest of the settings is actually completely useless if portal is activated. That's only a temporary solution, I'm not so sure how to improve this.
    As for the placing: You don't need to cover every single entry, but uncovered ones will still contribute noise. Also, one bigger portal is better that tons of small ones. Too many portals can produce a significant slowdown.

    So, if you're interested, try it out! Please post feedback, bugs, problems etc. here, I need it to create a "perfect" version for review

    PS: If you're interested in technical details, the sampling uses the area-preserving code for area lamps that was introduced in 2.73, which produces significantly better quality than the regular uniform surface sampling. That's the main reason for using area lamps ATM.



  2. #2
    Great job, that's an extremely useful feature for many scenes. I hope we can see it in trunk soon.

    Looks like there's an artifact when the portal is close to a surface (division by zero somewhere?):
    rendered.pngsolid.png
    (this scene only has a grey environment, no other lights)

    This setting also makes Cycles ignore the lamp for rendering, so the rest of the settings is actually completely useless if portal is activated. That's only a temporary solution, I'm not so sure how to improve this.
    You can just no draw the rest of the settings in that case, that's how Blender usually deals with it. (Objects have tons of redundant type-specific information anyway). However, it would be best if there was just a "Portal" light type.



  3. #3
    Member Hadriscus's Avatar
    Join Date
    Apr 2012
    Location
    Massilia, France
    Posts
    1,293
    That's great. It's like a user-defined MIS. Could be implemented as a shader maybe ? "Portal BSDF".



  4. #4
    lukasstockner97 You are my hero <3

    Also CUDA doesnt work on GTX 970 (IDK if Cuda is supposed to work at all lol)
    Last edited by LordOdin; 08-Feb-15 at 07:46.



  5. #5



  6. #6
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,442
    Great Lukas!
    This one could be a very handy new feature to cycles!
    In the end, only blender will surrender
    i7 4770 - 2x GTX 780 ti- 32GB



  7. #7
    Member
    Join Date
    Mar 2012
    Location
    Italy
    Posts
    2,060
    Great! Can't wait to get home and test it!
    Thanks a lot for your efforts, you'd be a great addition to cycles official developers team
    Testing: Vray for Blender // Old projects: #1 - Eames chaise lounge #2 - Chester Interior



  8. #8
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,442
    Any Patch Lukas? Or a Mac Build?! Please
    In the end, only blender will surrender
    i7 4770 - 2x GTX 780 ti- 32GB



  9. #9
    Originally Posted by LordOdin View Post
    lukasstockner97 You are my hero <3

    Also CUDA doesnt work on GTX 970 (IDK if Cuda is supposed to work at all lol)
    On my GTX 560 CUDA works, but on the GTX 970 it gives an error.
    My personal portfolio at marekmoravec.cz



  10. #10
    I'd also like a patch if possible, would love to test. I'm on Linux. Images looks very interesting, thanks for your work!
    Competition is great and fun for things like sports and games. For more serious matters cooperation might be a better approach.

    It is time - ecogood.org



  11. #11
    After very quick testing it looks quite impressive. The speed/noise seems to be almost same as when using plane as an emiter but it's much easier to setup more believable light with the portals. The only limitation is the use of area lamps - It would be much better if we could use meshes as portals. Imagine circle walls with openings - it would be difficult to cover the shape easily with rectangular lamps.
    The only strange behaviour that I noticed is that when I add a Sun lamp into scene, while using the portal, the ambient light gets noticeably darker..
    I hope I will manage to do some more serious test later.
    Last edited by maraCZ; 08-Feb-15 at 11:55.
    My personal portfolio at marekmoravec.cz



  12. #12
    Member m9105826's Avatar
    Join Date
    Dec 2007
    Location
    Fairfax, VA
    Posts
    4,171
    As far as I know, portals have to be rectangular. At least to not cause a huge hit to render time tracing against tri primitives. Tracing against an analytical primitive like a plane is many times faster.
    Long time 3D artist and member of the official Cycles Artists Module
    https://www.youtube.com/user/m9105826 - Training, other stuff. Like and subscribe for more!
    Follow me on Twitter: @mattheimlich or on my blog



  13. #13
    Light portals 38 seconds




    No light portals 39 seconds





    And here is a area light just for fun 38 seconds





  14. #14
    Great work. I hope to see this in master ASAP.



  15. #15
    Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    338
    Oops, I forgot to build the sm_52 kernel, that's why the GTX9xx won't work. Just go to 2.73/scripts/addons/cycles/lib , copy the sm_50 files and rename them to sm_52.

    Patch is here, but as I said, it's quite experimental and stuff will probably change in the future: http://www.pasteall.org/56581. Just run "git am <file>" and it should build.

    Regarding portal meshes: In theory, it's possible. In practise, however, not so much. As m9105826 already said, multiple primitives cause a huge slowdown. Covering a circular hole in a square portal will most likely be way faster. My favourite option is to add a portal object, in theory, it could support multiple shapes like squares, rectangles, circles, ellipses, polygons etc.

    As for the two problems (sunlamp and close-up artifacts): Thanks for the report, I'll have a look.



  16. #16
    "Oops, I forgot to build the sm_52 kernel, that's why the GTX9xx won't work. Just go to 2.73/scripts/addons/cycles/lib , copy the sm_50 files and rename them to sm_52."

    I came here just to say that exact thing xD your fast :P
    Anyways more tests now with GPU

    33 Seconds with portals 3 bounces max/min branched pathtracing



    33 Seconds no portals 3 bounces max/min branched pathtracing



    I have been noticing a lot (1 or 2) of random unexplainable fireflies with the portals though could that be the ol cycles casting light though geo trick you see when moving your camera in to an objects that has no lights on the inside but bright lights on the outside
    Last edited by LordOdin; 08-Feb-15 at 14:17.



  17. #17
    Member Craig Jones's Avatar
    Join Date
    Apr 2006
    Location
    Yoakum, TX
    Posts
    6,187
    That is interesting results, LordOdin, I imagine that coul dsimplify lighting for animation in a big way - have you tested anything with textures yet?



  18. #18
    Member
    Join Date
    Mar 2012
    Location
    Italy
    Posts
    2,060
    @LordOdin great results.

    I'm noticing same as maraCZ, when there are other lamps in the scene (sun or even spot inside the "interior") there is a difference in overall light. Haven't images yet, will post when i can.

    Also with Sun it seems the improvement given by portal alone is almost cancelled. Needs more testing, nothing sure atm.
    Testing: Vray for Blender // Old projects: #1 - Eames chaise lounge #2 - Chester Interior



  19. #19
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,442
    How does glossy and Glass materials inteact with this?
    In the end, only blender will surrender
    i7 4770 - 2x GTX 780 ti- 32GB



  20. #20
    Here is a pretty hard scene for pathtracing which the light portals were actually worse

    The light is coming through transparent material which may be causing this


    50 Seconds no portals 3 bounces max/min branched pathtracing



    50 Seconds portals 3 bounces max/min branched pathtracing

    Last edited by LordOdin; 08-Feb-15 at 16:24.



Page 1 of 12 12311 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •