Search Unity

Assets [Released] BOCS Shot V2 - Blender Cycles Integration

Discussion in 'Works In Progress - Archive' started by bocs, Jul 16, 2016.

  1. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Scroll down to Test a Public release or Click Here....
    https://forum.unity3d.com/threads/w...ender-cycles-integration.416345/#post-2854299


    I'm working on a free update to my asset...

    New Features Planned:
    Blender Cycles Integration - done
    Node Editor - done
    Complete set of Cycles nodes - 95% done
    Cuda acceleration - done
    Live Update of Materials, Lights, Object Transforms - done
    Convert Unity Shaders to Cycles nodes - 90% done
    Terrain - WIP





    Here is a video of me playing around for the image above....

     
    Last edited: Nov 16, 2016
    LiZHAO and Arkade like this.
  2. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hey
    Sounds intriguing but video doesn't play. Is it private?
     
  3. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    sorry, yes it was private while uploading/processing...should work now
     
  4. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Tested: adding fresnel and displacement to the auto converter.

    Keep in mind...
    1. None of the original models were designed for PBR (They used legacy shaders)
    2. Renders took less then 20 sec on an old GTX 690 @ 100 samples
    3. I'm not an artist

    *Need to find a good PBR model



     
    mgear and Arkade like this.
  5. vrpostcard

    vrpostcard

    Joined:
    Feb 24, 2013
    Posts:
    33
    Looking good. Can't wait for the update.
     
  6. LiZHAO

    LiZHAO

    Joined:
    Apr 26, 2013
    Posts:
    7
    it's really nice . But current version is a bit slow for reandering . hope i can enjoy cuda performance soon.
    Thank you for your nice work!
     
  7. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    no, thank you for the support.
    I really think you will like the new version, and I hope to have it submitted this month.
     
  8. David-Shaw542

    David-Shaw542

    Joined:
    Feb 11, 2015
    Posts:
    5
    Hi @bocs. Any update on this system?
     
  9. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I ran into major issues updating to the latest codebase..
    Posted my finding to the devs here:
    https://developer.blender.org/T49904

    obviously cycles standalone is low priority and not tested much, since a code commit broke it 3 months ago! which should have been very obvious since their example scene does not work.

    Why not just use the codebase that is working?
    1. Missing 3 months of speed fixes and features added.
    2. Cuda for 10xx cards

    I'm trying to fix the updated code...hell they don't even support normal maps yet!
    Cycles standalone was not designed to handle realtime updating, only read a .xml and render.

    First i'm just trying to get cycles standalone working again unmodified...then add my realtime updating, render buffer transfer to unity, etc
    Honestly, I can't bitch at them, it's free opensource software and i'm using something that almost nobody else uses so completely understand how they it overlooked it in testing.

    Second, I can't progress on the Unity side until i've fixed the cycles standalone side.
    *kinda...can still use the old code and CPU render
     
  10. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Good news, I think I fixed the bug in their code so I can now work with an updated code base and support cuda for 10xx cards.
     
  11. David-Shaw542

    David-Shaw542

    Joined:
    Feb 11, 2015
    Posts:
    5
    Excellent work @bocs. Looking forward to the new system!
     
  12. Petha

    Petha

    Joined:
    Dec 4, 2015
    Posts:
    26
    Any chance for an early beta release for loyal customers?
     
  13. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    of course, I'll post here when it's ready and how to get it hopefully soon.
    I may even post a demo version that has limited samples and output size (after I get some feedback from current customers).

    I'm in the process of recoding the interface again lol...but it's turning out so much nicer then what you see in the video.

    Have something really cool that i'm trying to integrate, will save it as a surprise ;)





    side note to everyone:
    If you want me to see a post, either quote one of my posts or use the "@bocs" in your post
    this is the only way these forums will alert me to new posts.
     
  14. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    ok, here is the "cool surprise" I was talking about.
    I've integrated the Disney BSDF branch, which is currently not in blender (release/master)

    This has a PBR "Uber Shader" node that will handle 90%+ of everything you will need!

    Just a quick example of some shaders, (subsurface, Anisotropic metal, glass)


    hoping this will make auto converting unity shaders to cycles nodes much easier.


    so the last issue I need to solve is normal maps...
    blender uses mikktspace to compute tangent space, which is no where to be found in cycles standalone.






    More links on the Disney shader:
    https://renderman.pixar.com/resources/current/RenderMan/PxrDisney.html
    https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf


    credits:
    Pascal Schön for Disney implementation
     
  15. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Maybe we can test it without normal map support? Normal maps don't work particularly well with ray tracing anyway. Maybe you could add displacement based of a height-maps instead?
     
  16. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I'm close to a public test, just adjusting the shader conversion code to use the disney node.
    Going to put the normal map on the todo list, but I don't plan to submit it to the store until it's working.

    Here is an example of how important normal maps are, look how bad it is without them! so much detail lost
    *also I know texture tiling is not right, was just trying to find an example for normal maps :)
    *displacement maps already work i think
     
  17. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Normal map's are fine on flat surfaces, organic shapes however need a high polycount so that rays are actually occluded.
     
  18. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Test Release - This is NOT a Demo of the final product!!
    *Output is limited to 256 x 256 @ 128 samples

    This is just a version you can play around with and let me know what you think so far.

    Download Here: http://bocs.site/bst7.unitypackage

    No manual yet, but I made a quick video to show how you can test:

     
  19. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Yes, something I found out after fixing the normal map code :) (Shadow Terminator Errors)
     
  20. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Worked some on the interface some...like color coding the slots, preview options etc.
    The goal is to make it a simple click and everything should just look "good", but that comes down to how well I convert unity shaders to nodes.

    Unity released some of the adam demo models, which gives me some good spec shaders to figure out converting.
     
  21. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Working on shader conversions....found I needed to invert "smoothness" and added fresnel to conversion, it seems to add to the quality (http://filmicgames.com/archives/557)

    quick test:
     
  22. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I'm working on the Doc's, then going to submit to Asset Store....
    Here are a few example scenes included...









    Here is a quick video of the dragon image:
     
  23. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Added some new features in the last few days...really wanted to get them included before I submitted.

    *Runtime support!
    *Tool to cache textures, copy plugin and cuda files for simple intergration
    *Image Filters - Denoise and B&W
    *cleaned up API, hope it's easy to use

    Filters
    You can use these after the render has completed..simple 1 click to enhance


    Runtime Support
    Simple API to render to a texture



    Runtime Example
    Help a coder out...Download and see how this runs or if it runs!
    *It should use cuda if you have an nvidia card, otherwise pure CPU
    *See the code in the image above....That is this example, so easy right?


     
    Last edited: May 2, 2017
  24. dahuilang

    dahuilang

    Joined:
    Jun 5, 2014
    Posts:
    32
    nice work! when the Runtime version can appear on the assetstore ? and dose it support webgl(website) runtime? i think it can support webgl from a technical perspective.
     
  25. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I plan to submit on monday (May 1st), so could be a week or two depending on unity to show up on the asset store.
    *Anyone who wants it early, can message me with their invoice #

    WebGL, this version no...I just haven't looked into native code for WebGL, since Unity and Unreal can run their engines in WebGL I would agree that's it "technically" possible.

    Currenlty I run cycles as a separate process by design for the following reasons:
    1. if it crashes...it won't crash unity
    2. unity editor runs much "smoother", I tested using cycles as a .dll and it worked but since it almost used 100% cpu..the editor would lag bad
     
  26. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
  27. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    This was lost on forum roll back...

    Stylized Shader Conversion for some interesting effects:
     
  28. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Wow i'm impressed, they approved it in 1 day!!!

    Version 2 Now available on the asset store

    http://u3d.as/ny7
     
  29. dahuilang

    dahuilang

    Joined:
    Jun 5, 2014
    Posts:
    32
    can Bocs shot make a realtime interior effect like this?

    006.png
     
    Last edited: May 11, 2017
  30. dahuilang

    dahuilang

    Joined:
    Jun 5, 2014
    Posts:
    32
    for now the example you show is single model effect, if you make a demo like above , i will buy bocs shot immediately
     
  31. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    It looks promising! Is there any chance that it'll support realtime rendering in future, like this one? :
     
    Osher likes this.
  32. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    .......that is why it is integrated into Unity............what?
     
  33. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    I only hope that I was mistaken. But it's my understanding that this asset is not intended to be used as a renderer replacement for realtime games, as the description says "Create stunning photo realistic screenshots of your game assets in just a few clicks", and the tutorial video shows it requires at least a few seconds before noise is cleared as is typical for the original Cycles engine.
     
  34. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    You should use a real-time rendered for real-time graphics. Something like http://armory3d.org or https://unity3d.com/. Neither of which are ray-tracing engines (Apart from pseudo ray-traced screen-space reflections which both do). Both of them rely on deferred or forward rasterized rendering.
     
  35. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    Yes, and that is why I asked if the author has any plans to make it capable of rendering in realtime :cool:
     
  36. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    I hate to derail a thread but I highly recommend you use the Unity rendering engine for real-time applications. Why would bocs want to create another real-time rendering application on top of Unity? That doesn't make any sense.
     
  37. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    I have no idea where such negativity is coming from. I didn't say anything bad about the product, nor even urged the author to support realtime rendering.

    All I did was asking if he has any plan to support it in future, and that was because I already saw another game engine (Amory 3D) utilizes Blender Cycles for that purpose.
     
    Last edited: May 11, 2017
  38. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I think we are still years away from Realtime path tracing.
    Armory even says "mimick the output of Cycles", but it's still just rasterized using "tricks".

    This is Runtime enabled, by request for mostly non game apps where they needed a good final output of a product.
    I did include a link to a Runtime example above...and that is only using CPU, forgot to include the GPU libs in that build.

    I'm currenlty working on speeding it up, in fact I already have 2.1 ready which has some good speed ups.

    The main purpose of this asset is just an easy way to make a nice screenshot of your levels in unity.
    In fact I used to make the camera image used on the asset store page.

    tl;dr - no it's not designed to replace or be a Realtime renderer replacement.
     
  39. mysticfall

    mysticfall

    Joined:
    Aug 9, 2016
    Posts:
    649
    @bocs Ok, thanks for the clarification!
     
  40. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    I've been working alot on the shader and light conversion...

    Top row of spheres are Spec Shader, Bottom are Metallic Shader based...

    Top and bottom row "should" look the same...in 2.1 they are much closer


    BOCS Shot 2.0 - Spec shader conversion = not so good


    BOCS Shot 2.1 - conversion is now almost 1 to 1



    Updated Material:
    *Added Buttons for Presets
    *Cache Mesh for speed - Uncheck for skinmesh if needed


    Updated Camera:
    *Added Buttons for some default enviroments
    *Sky, Soft White Light, HDR


    Updated Light:
    *Added Auto Sync to mirror Unitys light updates
    *Uncheck to manually modify light shader



    Experimental Feature - Scene View Render
    *Maybe an option instead of new progressive lightmapper?





    TL;DR; 2.1 should be faster, and more have more accurate shader conversions.

    Final Testing, and hope to submit 2.1 update soon.
     
  41. dahuilang

    dahuilang

    Joined:
    Jun 5, 2014
    Posts:
    32
    can it support realtime GI?
     
  42. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    This asset allows you to create high quality ray-traced images inside Unity or Windows standalone applications.
    It uses the Blender Cycles engine to render. (you do not need to have blender installed, it's all standalone)

    simple answer, No...this is not a real-time GI solution or even a real-time rendering solution.
     
    InfixStudios likes this.
  43. dahuilang

    dahuilang

    Joined:
    Jun 5, 2014
    Posts:
    32
    is there any interior effect example or screenshot?