Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Assets [WIP]Final Coat - Custom Physically Based Rendering Shader with realtime GI

Discussion in 'Works In Progress - Archive' started by Ravel, Jan 9, 2015.

?

Do you like it?

  1. Not my cup of tea...

    0 vote(s)
    0.0%
  2. It's OK.

    10.0%
  3. Looking good.

    42.5%
  4. Wow really nice!

    47.5%
  1. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    [Update]
    This shader provides an alternative to the built in universal sahder.
    Its main function is to provide the full functionality of a IBL pipeline with the support of several new features.

    Current state:
    - Multiple shader modes (Default, CarPaint with clear coat layer, Anisotrophy, Foliage, Deformable tires, Skin and many more)
    - Multiple UV sets for channels (required in some modeling workflows, imported lightmaping etc.)
    - Transmissive and Translucent materials (Foliage & Skin)
    - Multilayer Detail Splating;
    - Blending Decals
    - Fully supports the default Lighting pipeline in unity(Reflection probes, Realtime GI, Lightmaping)

    Here are some screens with a scene that only uses one shader:
    MoDyEn_2017_1.jpg
    MoDyEn_2017_2.jpg

    [Update]
    So I got the car paint now looking as good as it should, with metalic flakes, flip, candy and perlacent tinting! The variations are endless!
    New Car Paint 3.PNG New Car Paint 4.PNG


    Old Post:
    I really liked the IBL approach on everything and I decided to write my own. My shaders were allready half IBL, but they didnt quite compete with true AAA shaders, so I did some research on them and fixed the missing links. Now it looks alot better and I'd like to know what's the communitys opinnion on it?





    The shaders overall are heavily optimized, and its actually a single shader, I'm following U5 approach where you have an universal shader and I think that the outcome sofar it's quite cool. On this shader, the original ambient light is disabled. It may look simmilar to marmoset, because I'm using the same reflection texture at the moment. But dont be mistaken, this is a single 6kb shader file.

    The file size will grow, because at the moment there is no transparency & box projection support.


    Edit.
    Latest result:

     
    Last edited: Oct 14, 2017
    Razputin, FBTH, John-G and 3 others like this.
  2. Andy-Touch

    Andy-Touch

    A Moon Shaped Bool Unity Legend

    Joined:
    May 5, 2014
    Posts:
    1,486
    Looking ace! Do you have a build we can see it in? :)
     
    Ravel likes this.
  3. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    I dont have a build yet, and I'd like to have a build once I get the shaders atleast 50% finished, currently it's too soon for a build :)
     
  4. Neoku

    Neoku

    Joined:
    Oct 27, 2014
    Posts:
    261
    I think that the new PBS of unity 5 use a IBL model, i am wrong?
     
  5. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Yes it does use an IBL model. But there are things that I do differently. Atleast the beta I tryed, was not the result I wanted. It was good to a specific range and for some reason really hardware hungry.
     
  6. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Small update:


    The shader currently supports 4 selectable blending modes, Opaque, Cutout, Transparent and Glass.
    It also suports AO maps & Illumination maps. Everything except the sky & projector, uses this shader.
    Going to add a global reflection manager and Box projection system. I'm going to make this shader as perfect as possible, because I'm goign to use this shader for every 3D project I make.

    And ofcourse I'm going to add car paint specific features aswell. But overall I really like the fact that I can now use one single shader for everything.
     
    IcyPeak and BrandyStarbrite like this.
  7. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Nice! :D

    Nice ground texture too, in the bluey car pic!
     
    Ravel likes this.
  8. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Looking good!
    Will this shader include normal map, detail map etc?
    Also would it be compatible with mobile?
     
    BrandyStarbrite and Ravel like this.
  9. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thanks!
    This shader allready supports normal maps and I'm adding detail maps aswell yes.

    Havent tried its mobile capabilities yet, but I can easly modify the shader to work on mobile. But with mobile there are 2 possible scenarios, I have to limit the shader or the shader would require higher end devices.

    Thanks!
    The ground texture, if I remember correctly is the same as used in shader forge.
     
    sowatnow likes this.
  10. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    More work on the shaders done, Seems like everything goes in the right direction.



    shidome_stairs HDR map used in this scene.
     
    Last edited: Jan 10, 2015
    John-G, sowatnow and IcyPeak like this.
  11. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Wow! Ya better release these. I bought your first pack a long time ago. :)
     
    BrandyStarbrite likes this.
  12. Imre

    Imre

    Joined:
    Sep 27, 2012
    Posts:
    73
    sorry, but tires look kinda crappy?
     
  13. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thanks, I'm thinking of maybe releasing the shader as a whole system once the features are in and box projection working. Basically when one of my sim demos works with the shaders, then I might release the system if there is a need for it.

    No problem, I didnt focus on tires, they basically have ambient only, I can apply the specularity and normals for the next screens. Afterall I'm using this media for testing only. Once the system is finished I can show screens with proper media from my partner. And possibly a demo aswell.
     
  14. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Did minor fixes on the shader. Ambient (I think I can call it radiance?) Is now alot better, did some changes to the specular model aswell. As pointed out the tires were crappy, now they should have proper settings. Only thing bothering me visually, is that the reflections seem to need some antialiasing...


     
    Last edited: Jan 11, 2015
  15. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    lookin shiney!
     
  16. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Very shiny, polished by the karate kid himself.
     
    BrandyStarbrite and Ravel like this.
  17. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    I think that the shaders IBL feature is finished, everything is now controleld by exposure. And at 0 exposure everything is black. Car paint feature also added.


     
    Deon-Cadme likes this.
  18. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Looking great, is this shader mobile friendly at all?
     
  19. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thanks!
    I havent tried it on mobile yet, but in theory it should work on mobile, and if the mobile is highend it should work exactly like on the pictures. I've developed this shader on a laptop that has 4gb of ram and on i3. Right after the box projection is in and user friendly I can compile a playable demo and after that I can do tests on mobile, but mobile is currently not my aim.
     
  20. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    Looks really good, some tweaking and the scene will be AAA.
    Some details to the grass, less reflective road and a detailed background and your game can market itself :)
     
    Ravel likes this.
  21. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thank you!

    And this is a picture of the shader in a game environment, everything in this scene is using this shader.


    I'm currently using a local cubemap on the car aswell and its a bit dulled to get a slightly "lit up" effect.
    Will also try a realtime reflections on the car soon.
     
    Last edited: Jan 14, 2015
    Deon-Cadme likes this.
  22. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    The environment still need a lot of work but fun to see that it all is coming together *thumb up*

    Just make sure in the end to fake the world so that it looks like the cars and the surroundings seem to have the same detail level. Just saying it for safety because some devs tend to love their cars so much that they forget the rest ;)
     
    Ravel likes this.
  23. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thats the truth, this is just a plug and play example :)

    And to be honest you dont have to fake the environment, with this shader you just need the correct mapping, will try to do a good example soon.

    Also the bigest issue currently for visual fidelity is the reflection mapping. Need to figure out the best way or a combined methdo to get the best baked reflections of a scene, box projection simply would'nt cut the deal for racing games. A global cubemap will basically do the trick in most cases, I'm sure the same method is used in CryEngine3 and Unreal Engine. But I think a road/track surface to reflect properly needs some trickery. Maybe a realtime cubemap with a suitable projection method (but that would be CPU hungry)
     
    Last edited: Jan 14, 2015
    Deon-Cadme likes this.
  24. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Heres a bit better image of the shaders in a game environment.
    The car has a realtime reflecting cubemap script with RGBM encoding.
    99% of this scene uses my single shader. Only the particle material has a seprate shader.

    HdrShadersInGame.JPG
     
    John-G likes this.
  25. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Care to share a web player for fun to see it in action?
     
  26. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    My hands are full of work at the moment so at this time I cant do a web player. But if I get some spare time I can record a video, or maybe upgrade MoDyEn's public demo to use the new shader

    Heres another shot in game:
    Metallic Caterham Racing 2.JPG

    For some reason ingame shots dont look as good as hdri hemispherical light probes found on the net. I suspect it's because the textures are not saved in RGBM. Or they need to be saved correctly... Iwish I had proper media to fully test this new shader.
     
    John-G likes this.
  27. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Shader is looking amazing so far, will this be included with MoDyEn Lite or is it a completely separate product?
     
    Ravel likes this.
  28. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Thanks!
    MoDyEn Lite will have simmilar shaders for car parts only (I'll update the old MoDyEn shaders soon and include them with MoDyEn Lite). Visually the only notable difference will be HDR support. But this shader will be a seprate backage and I'm thinking of naming it as MoDyEn IBL. And for a price tag of 80€ should be quite ok. Also am thinking of including these shaders to the pro version of MoDyEn, but pro version is far from finished.
     
    John-G likes this.
  29. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    ShadersAtWork.jpg Heres a picture of the shaders in agame environment once more, Tho I noticed that the car paint variation needs some tweaking to be fully universal.
     
    John-G likes this.
  30. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Nice - Please show a bumped surface.
     
  31. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Sorry for a late reply, I totally forgot this thread. Anyway heres a car paint with some normals.
    Unity 2015-02-05 13-35-25-02.jpg
    I can add some more later pics to show how the shader works in game. I got rid of some bugs now aswell, so I think its ready to be released :)
    Unity 2015-02-05 02-19-20-53.jpg
     
  32. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Unity 2015-02-05 01-31-51-56.jpg JZX 30 Shaders 2.jpg Huayra Shader.jpg
     
    ludiares and John-G like this.
  33. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    I'm trying out shifts track and car with my shaders and oh boy how well it's designed for IBL environment!
    game 2015-02-07 21-22-50-11.jpg game 2015-02-07 21-08-10-92.jpg game 2015-02-07 21-04-21-60.jpg game 2015-02-07 21-12-50-45.jpg game 2015-02-07 21-05-30-01.jpg
     
    John-G likes this.
  34. mantekkerz

    mantekkerz

    Joined:
    Dec 24, 2013
    Posts:
    111
    Did you ever release this @Ravel ? Also, are these screens from a scene using Linear colour space?
     
  35. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    I didnt have time to finish/release them, and these are in gamma space if I rememer correctly. Once I have more free time, I'll release these.
     
  36. IAmCraigSnedeker

    IAmCraigSnedeker

    Joined:
    Jul 20, 2014
    Posts:
    117
    Looks beautiful! :eek:
     
    Ravel likes this.
  37. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Decided to continue on the shaders, since I managed to successfully write some critical effect based shaders for my main package (MoDyEn). Now I turend my shader into a Universal sahder that can be used to replace the unity one. And it contains multiple sub shaders. And it also works 100% with the Unity's Reflection probe system and realtime GI.
    Here are some test images:
    Desktop 10.09.2017 - 13.22.29.02.png Desktop 10.09.2017 - 13.22.47.03.png Desktop 10.09.2017 - 13.22.59.04.png Desktop 10.09.2017 - 13.23.14.05.png Desktop 10.09.2017 - 13.23.22.06.png
     
  38. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Finally getting the shader together as a fully working unit. Added foliage rendering and UV sets.
    And here's a car lit with the shader. The scene is also lit with the same shader! MoDyEn_2017_3.jpg MoDyEn_2017_4.jpg MoDyEn_2017_5.jpg MoDyEn_2017_6.jpg