Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

CubeMapper: Parallax reflection demo

Discussion in 'Assets and Asset Store' started by GameArt, Feb 24, 2014.

  1. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    PROJECT RENAMED: Reflection Manager


    CubeMapper: parallax reflection demo

    CubeMapper is a new plugin for unity, designed to allow for simple creation, and use, of high quality reflection probes. The plugin is being packaged up and should hit the asset store in a matter of weeks. In the meantime I have just put the finishing touches on the first demo- parallax correction.

    Check out the demo
    Web Demo
    WASD movement, Space bar to fire dynamic objects, P to toggle parallax. Hold left mouse button to look.



    About the demo
    Parallax correction is a cheap technique designed to make the most out of cubemaps/reflection probes. The technique can run on ipad level hardware.


    Proper gloss handling allows for metallic surfaces


    CubeMapper handles dynamic reflections using this same technique


    CubeMapper automatically links dynamic objects to the nearest valid reflection probe, and efficiently and seamlessly switches reflection probes as the objects move around the world. Additional 'room' geometry ensures dynamic objects link to the most appropriate cubemap, not just the closest.


    Preview reflection probes as you generate them in editor, tweak settings and rebake all, or just one, in a single click.


    What is parallax correction?
    Standard cubemap reflection math assumes the reflections are infinitely far away. By supplying additional convex data (a cuboid in this case) we are able to accurately project planer reflections.

    Standard cubemap projection:


    Parallax corrected cubemap projection:


    Credits
    Textures provided by: GameTextures.com
    Door Model provided by: GameArt.me
    Additional content re-purposed from Unity samples.
     
    Last edited: Mar 26, 2014
  2. Deleted User

    Deleted User

    Guest

    The performance on that web player demo is really poor for me. Is it just me? I'm running it on a brand new iMac.
     
  3. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Nice looking. Would like to see it super high res at 60hz?
     
  4. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    The performance of the reflections should be solid at higher resolutions. This reflection math shipped on PS3's Remember Me, and framebunker gave a presentation on using this technique on ipads (with lower resolution cubemaps).

    ALLCAPS, the last time I exported the demo ran at 30 fps on a netbook- it's very possible I enabled something power hungry by mistake since then :) I'll take a look into this right away!
     
  5. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    Nope, I was getting bad performance as well. It was hitting about 2-5 fps.

    That said, it looks pretty. :)
     
  6. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I updated the web sample- the framerates should be massively improved now.

    SSAO was eating 95% of the frame.

    Thanks for finding that mistake :) !

    EDIT: Tonzie, ALLCAPS, do you mind re-testing to confirm I fixed the framerate issue for you?
     
    Last edited: Feb 25, 2014
  7. deram_scholzara

    deram_scholzara

    Joined:
    Aug 26, 2005
    Posts:
    1,043
  8. MrSkiz

    MrSkiz

    Joined:
    Jul 4, 2012
    Posts:
    4
    As it's about cubemap and so baking cubemap is necessary, I presume this plugin will be Pro only.
     
  9. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    So it is box-projected cubemaps, does it have some kind of requirement that rooms be squares or something?
     
  10. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    It ships with three methods to generate cubemaps, 2 of which will work in Unity Free :)

    Yes and no.

    The rooms currently have to be convex to receive correct parallax, any concave portion cannot receive correct reflections because the cubemap cannot render 'it'.

    My cubemaps automatically link to static geometry, and in the next version will allow you to generate a complex convex shape (think physics hull) from those linked surfaces. Currently this demo features hand drawn reflection volumes.

    After I release the initial version I intend to add a mixing pass that will allow you to create more complex concave shapes by adding multiple cubemap sampling points.
     
    Last edited: Feb 25, 2014
  11. LeagueOfMonkeys

    LeagueOfMonkeys

    Joined:
    Aug 13, 2012
    Posts:
    33
    This looks awesome. We are interested in using this on Mobile - tell me will you include the ability to alter optimization settings (less samples etc) to squeeze out the best performance possible ?.
     
  12. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    The performance will be fully tweak-able.

    I haven't tested on mobile yet, but FrameBunker gave a presentation on using this technique on ipad 1 hardware, with 64x64 sized cubemaps.
     
  13. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    Looks great but I thought I would give you a heads up. there is already an asset called cubemapper on the asset store

    https://www.assetstore.unity3d.com/#/content/3041

    And a question. Can this be applied to any material that excepts a cube map?

    Thanks
     
  14. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Looks absolutely perfect, exactly like my favorite environment probing implementation from CryENGINE. Few questions:

    1. Can you detail your implementation? How flexible it is? Is it reliant on custom shaders or achieved through script-supported post-processing? Can I use it with my own custom shaders, and if modifications to them are required, what is the scope of them (for example, how many texture samplers do I have to keep reserved to avoid hitting the SM3 limits).

    2. Are cubemaps baked in the HDR space or in LDR? CryENGINE utilized a pretty clever trick for storing HDR environment maps without the typically associated expenses of 32-bit files: it used just one RGBA 8-bit texture that stored bridgtness multiplication map in the alpha, essentially mapping the values from the RGB part of the texture to a broad range without noticeable quality issues. It would be very nice to have an option to do the same in Unity.

    In any case, can't wait to see the release!

    Looks neat, but I think it has no advanced blending or parallax correction.
     
    Last edited: Feb 28, 2014
  15. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I have been contacted by several people regarding the asset with the same name, I'll try my best to come up with an alternative name :)

    Yes. Basic cubemap linking works automatically with Unity shaders. The package comes with additional shaders (seen in the demo) that support blending and parallax correction. The default unity shaders will not support these features.

    Thank you for the support! :)

    The demo shaders use one or two texture slots for cubemaps. You only need the second slot for dynamic objects. The textures utilized a gloss map to get additional quality.

    - Cubemaps can be baked in LDR or HDR
    - Cubemaps can be captured at higher resolution and downsampled to reduce aliasing
    - Cubemaps can use a special mip generation shader to produce better quality mips

    I like the idea of the RGBA implementation you described, I would like to add that.

    Cubemapper links to your shader by the sampler name, and by default uses the same sampler as the unity textures.

    If you want to add CubeMapper to a custom material, all you need to do is:
    You can apply this reflection colour how ever you find it appropriate. In the sample I use surface shaders, so I simply add it to the emissions slots.
    o.Emission = lerp( o.Emission, reflection_colour, spec_sample.r);

    I plan to move this code to a post processing pass so I can blend multiple cubemaps in a more advanced way- but that won't be ready for the initial version.
     
  16. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Update!

    I've been testing on mobile platforms. First pass using simplified gloss/normal math runs really fast in the Windows Phone 8 emulator:

    $parallax_wp8.png

    Clearly this image has lost some of the beauty of my original demonstration, but as I learn more about mobile limitations I should be able to get it back :)
     
  17. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I'm looking for 2-3 unity developers to volunteer to test the first release of this plugin, you will receive a free copy of the final product for your efforts.

    If you are interested please email:
    sales@gameart.me
     
  18. Dabeh

    Dabeh

    Joined:
    Oct 26, 2011
    Posts:
    1,614
    :) Can't wait for this to be released!
     
  19. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Thanks to everyone who volunteered, the first version should land in your email boxes within a week!

    We do not need any additional volunteers at this time.
     
  20. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
  21. bcoyle

    bcoyle

    Joined:
    May 22, 2013
    Posts:
    57
    Any other ways to follow the status of this asset other than the forum thread?
     
  22. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hey BCoyle.

    Right now this is the only place to hear of updates. I will be much more active in updating about the product after it launches.

    I have finished up my changes from the first Beta and the program will be submitted to the Unity store shortly. I will create a new thread with the updated name / information at that time, and will link to it here.

    Thank you for your interest.
     
  23. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
  24. renaissanceCoder1

    renaissanceCoder1

    Joined:
    Apr 8, 2015
    Posts:
    127
    I made it out alive!