Search Unity

Antonov Suit - Physically Based Shader - First Release

Discussion in 'Works In Progress - Archive' started by Charkes, Apr 24, 2013.

  1. e_Glyde

    e_Glyde

    Joined:
    Apr 20, 2013
    Posts:
    42
  2. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
    @rea Well I may be wrong but transparent object are not rendered into the depth buffer, except CutOut shader. Maybe some trick with render texture and layer with second camera could work.

    @EpicLilg Currently not easy as I used standard shader as a base but I'm currently rewritting my shader to use surface shaders (instead of fragment) and I've added the cross/dither fade effect and it works pretty well.
     
    e_Glyde and Reanimate_L like this.
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah right, i forgot about the depth pass, hmm replacement shader might help here. . .
     
  4. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
    Was looking into the builting shaders and found this : "Internal-DeferredReflections.shader"

    Means that I can now blend cubemap with SSR :).
     
    Last edited: Jul 4, 2015
    e_Glyde likes this.
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yep that one, it was made for SSR too i guess. but i don't think we have a proper reflection buffer at the moment, they said it gonna be implemented in 5.2
     
  6. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
    Yeah, looks like it is not used yet sadly.
     
  7. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    btw 5.2 beta is out with the new deferred reflection
     
  9. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
    Yeah but I can't use it, I'm not using pro anymore, I guess I'll just have to wait...
     
  10. theprotonfactor

    theprotonfactor

    Joined:
    Oct 10, 2014
    Posts:
    140
    Hey @Charkes I'm currently modifying Unity 5's internal shading system (from Blinn-Phong to GGX) and I've now gotten to the stage where I need to change the IBL and the only proper convolution for GGX I've found is from Antonov Suit, but I'm having some problems. There's some serious color banding going on and the colors themselves change quite a bit when I convolve a cubemap. I know this is because of the rgbm encoding but I'm not sure if this is normal behaviour because I didn't use it with unity 4. Also I'm feeding them to reflection probes and even though unity is suppose to decode them the banding and colors remain pretty much the same. So I'm basically asking if your method of GGX cubemap convolution still works as it should in unity 5?
     
  11. Charkes

    Charkes

    Joined:
    Apr 17, 2013
    Posts:
    228
    Hi @theprotonfactor,

    Just to be sure, are you in linear color space ?

    It was working fine in U4 afak but in U5 things has changed a bit. The rgbm decoding is not exactly the same as mine in U5.

    If I'm correct U5 expect to use an .exr format (for HDR cubemap) and not .cubemap as I did on U4. Maybe if you can save the capture cubemap in .exr it will solve your issue but I'm not sure if it is even possible.
     
  12. theprotonfactor

    theprotonfactor

    Joined:
    Oct 10, 2014
    Posts:
    140
    Hi @Charkes I am indeed in Linear color space, but I think you may be correct with the .cubemap file format issue. I've even replaced your rgbm encoding with unity's but no luck.

    I remember reading that unity simply uses RenderToCubemap with phong convolution under the hood for reflection probes. Thus, it must be possible to somehow generate hdr cubemaps without actually creating .exr files.

    I'm going to try RenderToCubemap into a half float render texture with its isCubemap flag set to true and pass that to your shader. I'll report back if it works and maybe share the modifications needed if people are interested?
     
  13. aryssa

    aryssa

    Joined:
    Aug 14, 2015
    Posts:
    1
    Hi, unity 5.2 are release... but how to access in refflection pass ?
     
  14. K-E-I

    K-E-I

    Joined:
    Oct 6, 2012
    Posts:
    17
    You can call it from "_CameraReflectionsTexture" in shader.