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

[RELEASED] Reflection Manager

Discussion in 'Assets and Asset Store' started by GameArt, May 19, 2014.

  1. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Reflection Manager v0.4

    "High Quality, Baked Refections"

    Reflection Manager is a new plugin for Unity, designed to allow for simple creation, and use, of high quality reflection probes.
    These probes can be pre-baked and are more efficient than screen space reflection solutions. Reflection probes are assigned to static and dynamic objects at run-time, allowing for beautiful efficient reflections, even on moving objects. The novel parallax correction technique demonstrated below is so efficient that it runs smoothly on today's mobile devices.

    Purchase Reflection Manager on the Asset Store

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



    Windows Phone Demo

    Download Oculus Demo

    Transparency Demo

    Web Demo

    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





    Coming in version 0.5






    Reflection Manager 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:


    Feature List
    - One click baking of Reflection Probes
    - Parallax corrected volumes, provide amazing, cheap, reflections.
    - Automatic (runtime) linking to static AND dynamic objects. Dynamic objects cross fade between probes.
    - Reflection probe sets can share common settings, and can be mass re-baked.
    - Preview reflection probes are previewed in the editor, adjust mip bias to ensure smooth reflections
    - Two different baking implementations provided
    - Support for dynamic reflection probes

    Credits
    Dozens of production quality, royalty free textures provided by: GameTextures.com
    Door Model provided by: GameArt.me
    Additional content re-purposed from Unity samples.

    Documentation
    Reflection Manager Help
    Quick Start Guide [FIRST DRAFT]

    Change Log
    Code (CSharp):
    1. Version 0.4
    2. ---------------
    3. - Smoothly transition dynamic objects from one parallax volume to another
    4. - Dynamic objects can optionally link to the closest probe ( m_ConsiderLinkingVolumes = false ).  This is useful for outdoor scenes
    5. - Added ability to access alternate parallax volume bounds.  See dynamic objects sample
    6. - Removed incorrect license from the project directory
    7.  
     
    Last edited: Oct 23, 2014
  2. bcoyle

    bcoyle

    Joined:
    May 22, 2013
    Posts:
    57
    I'd love to try this out - I'm just concerned about shader implementation. At the moment I'm using Shader Forge, creating an unlit/texture type shader. I'm definitely in the market for a way to add nice reflections!

    this is the current simple shader I'm using:

    Code (csharp):
    1. // Shader created with Shader Forge Beta 0.33
    2. // Shader Forge (c) Joachim Holmer - http://www.acegikmo.com/shaderforge/
    3. // Note: Manually altering this data may prevent you from opening it in Shader Forge
    4. /*SF_DATA;ver:0.33;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,limd:1,uamb:False,mssp:True,lmpd:False,lprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,rpth:1,hqsc:True,hqlp:False,blpr:0,bsrc:0,bdst:1,culm:0,dpts:2,wrdp:True,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:1,x:32719,y:32712|diff-2-RGB,spec-82-OUT,gloss-272-OUT,amdfl-291-OUT;n:type:ShaderForge.SFN_Tex2d,id:2,x:33154,y:32542,ptlb:MainTex,ptin:_MainTex,tex:59e1e8b0203f6564bb9ae1af71b35908,ntxv:2,isnm:False;n:type:ShaderForge.SFN_Vector1,id:82,x:33154,y:32724,v1:0;n:type:ShaderForge.SFN_Slider,id:272,x:33154,y:32813,ptlb:Gloss slider,ptin:_Glossslider,min:0,cur:0,max:1;n:type:ShaderForge.SFN_Vector1,id:291,x:33154,y:32925,v1:1;proporder:2-272;pass:END;sub:END;*/
    5.  
    6. Shader "Shader Forge/unlit_texture_SF" {
    7.     Properties {
    8.         _MainTex ("MainTex", 2D) = "black" {}
    9.         _Glossslider ("Gloss slider", Range(0, 1)) = 0
    10.     }
    11.     SubShader {
    12.         Tags {
    13.             "RenderType"="Opaque"
    14.         }
    15.         Pass {
    16.             Name "PrePassBase"
    17.             Tags {
    18.                 "LightMode"="PrePassBase"
    19.             }
    20.            
    21.            
    22.             Fog {Mode Off}
    23.             CGPROGRAM
    24.             #pragma vertex vert
    25.             #pragma fragment frag
    26.             #define UNITY_PASS_PREPASSBASE
    27.             #include "UnityCG.cginc"
    28.             #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
    29.             #pragma target 3.0
    30.             uniform float _Glossslider;
    31.             struct VertexInput {
    32.                 float4 vertex : POSITION;
    33.                 float3 normal : NORMAL;
    34.             };
    35.             struct VertexOutput {
    36.                 float4 pos : SV_POSITION;
    37.                 float4 posWorld : TEXCOORD0;
    38.                 float3 normalDir : TEXCOORD1;
    39.             };
    40.             VertexOutput vert (VertexInput v) {
    41.                 VertexOutput o;
    42.                 o.normalDir = mul(float4(v.normal,0), _World2Object).xyz;
    43.                 o.posWorld = mul(_Object2World, v.vertex);
    44.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    45.                 return o;
    46.             }
    47.             fixed4 frag(VertexOutput i) : COLOR {
    48.                 i.normalDir = normalize(i.normalDir);
    49.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    50. /////// Normals:
    51.                 float3 normalDirection =  i.normalDir;
    52.                 return fixed4( normalDirection * 0.5 + 0.5, _Glossslider );
    53.             }
    54.             ENDCG
    55.         }
    56.         Pass {
    57.             Name "PrePassFinal"
    58.             Tags {
    59.                 "LightMode"="PrePassFinal"
    60.             }
    61.             ZWrite Off
    62.            
    63.             Fog {Mode Off}
    64.             CGPROGRAM
    65.             #pragma vertex vert
    66.             #pragma fragment frag
    67.             #define UNITY_PASS_PREPASSFINAL
    68.             #include "UnityCG.cginc"
    69.             #pragma multi_compile_prepassfinal
    70.             #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
    71.             #pragma target 3.0
    72.             uniform sampler2D _LightBuffer;
    73.             #if defined (SHADER_API_XBOX360)  defined (HDR_LIGHT_PREPASS_ON)
    74.                 sampler2D _LightSpecBuffer;
    75.             #endif
    76.             uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
    77.             uniform float _Glossslider;
    78.             struct VertexInput {
    79.                 float4 vertex : POSITION;
    80.                 float3 normal : NORMAL;
    81.                 float2 uv0 : TEXCOORD0;
    82.             };
    83.             struct VertexOutput {
    84.                 float4 pos : SV_POSITION;
    85.                 float2 uv0 : TEXCOORD0;
    86.                 float4 posWorld : TEXCOORD1;
    87.                 float3 normalDir : TEXCOORD2;
    88.                 float4 projPos : TEXCOORD3;
    89.             };
    90.             VertexOutput vert (VertexInput v) {
    91.                 VertexOutput o;
    92.                 o.uv0 = v.uv0;
    93.                 o.normalDir = mul(float4(v.normal,0), _World2Object).xyz;
    94.                 o.posWorld = mul(_Object2World, v.vertex);
    95.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    96.                 o.projPos = ComputeScreenPos (o.pos);
    97.                 COMPUTE_EYEDEPTH(o.projPos.z);
    98.                 return o;
    99.             }
    100.             fixed4 frag(VertexOutput i) : COLOR {
    101.                 i.normalDir = normalize(i.normalDir);
    102.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    103. /////// Normals:
    104.                 float3 normalDirection =  i.normalDir;
    105. ////// Lighting:
    106.                 half4 lightAccumulation = tex2Dproj(_LightBuffer, UNITY_PROJ_COORD(i.projPos));
    107.                 #if defined (SHADER_API_GLES) || defined (SHADER_API_GLES3)
    108.                     lightAccumulation = max(lightAccumulation, half4(0.001));
    109.                 #endif
    110.                 #ifndef HDR_LIGHT_PREPASS_ON
    111.                     lightAccumulation = -log2(lightAccumulation);
    112.                 #endif
    113.                 #if defined (SHADER_API_XBOX360)  defined (HDR_LIGHT_PREPASS_ON)
    114.                     lightAccumulation.w = tex2Dproj (_LightSpecBuffer, UNITY_PROJ_COORD(i.projPos)).r;
    115.                 #endif
    116. /////// Diffuse:
    117.                 float3 diffuse = lightAccumulation.rgb * 0.5;
    118. ////// Specular:
    119.                 float node_82 = 0.0;
    120.                 float3 specularColor = float3(node_82,node_82,node_82);
    121.                 float3 specular = lightAccumulation.rgb*lightAccumulation.a * specularColor;
    122.                 float3 finalColor = 0;
    123.                 float3 diffuseLight = diffuse;
    124.                 float node_291 = 1.0;
    125.                 diffuseLight += float3(node_291,node_291,node_291); // Diffuse Ambient Light
    126.                 float2 node_307 = i.uv0;
    127.                 finalColor += diffuseLight * tex2D(_MainTex,TRANSFORM_TEX(node_307.rg, _MainTex)).rgb;
    128.                 finalColor += specular;
    129. /// Final Color:
    130.                 return fixed4(finalColor,1);
    131.             }
    132.             ENDCG
    133.         }
    134.         Pass {
    135.             Name "ForwardBase"
    136.             Tags {
    137.                 "LightMode"="ForwardBase"
    138.             }
    139.            
    140.            
    141.             CGPROGRAM
    142.             #pragma vertex vert
    143.             #pragma fragment frag
    144.             #define UNITY_PASS_FORWARDBASE
    145.             #include "UnityCG.cginc"
    146.             #include "AutoLight.cginc"
    147.             #pragma multi_compile_fwdbase_fullshadows
    148.             #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
    149.             #pragma target 3.0
    150.             uniform float4 _LightColor0;
    151.             uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
    152.             uniform float _Glossslider;
    153.             struct VertexInput {
    154.                 float4 vertex : POSITION;
    155.                 float3 normal : NORMAL;
    156.                 float2 uv0 : TEXCOORD0;
    157.             };
    158.             struct VertexOutput {
    159.                 float4 pos : SV_POSITION;
    160.                 float2 uv0 : TEXCOORD0;
    161.                 float4 posWorld : TEXCOORD1;
    162.                 float3 normalDir : TEXCOORD2;
    163.                 LIGHTING_COORDS(3,4)
    164.             };
    165.             VertexOutput vert (VertexInput v) {
    166.                 VertexOutput o;
    167.                 o.uv0 = v.uv0;
    168.                 o.normalDir = mul(float4(v.normal,0), _World2Object).xyz;
    169.                 o.posWorld = mul(_Object2World, v.vertex);
    170.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    171.                 TRANSFER_VERTEX_TO_FRAGMENT(o)
    172.                 return o;
    173.             }
    174.             fixed4 frag(VertexOutput i) : COLOR {
    175.                 i.normalDir = normalize(i.normalDir);
    176.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    177. /////// Normals:
    178.                 float3 normalDirection =  i.normalDir;
    179.                 float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
    180.                 float3 halfDirection = normalize(viewDirection+lightDirection);
    181. ////// Lighting:
    182.                 float attenuation = LIGHT_ATTENUATION(i);
    183.                 float3 attenColor = attenuation * _LightColor0.xyz;
    184. /////// Diffuse:
    185.                 float NdotL = dot( normalDirection, lightDirection );
    186.                 float3 diffuse = max( 0.0, NdotL) * attenColor;
    187. ///////// Gloss:
    188.                 float gloss = _Glossslider;
    189.                 float specPow = exp2( gloss * 10.0+1.0);
    190. ////// Specular:
    191.                 NdotL = max(0.0, NdotL);
    192.                 float node_82 = 0.0;
    193.                 float3 specularColor = float3(node_82,node_82,node_82);
    194.                 float3 specular = (floor(attenuation) * _LightColor0.xyz) * pow(max(0,dot(halfDirection,normalDirection)),specPow) * specularColor;
    195.                 float3 finalColor = 0;
    196.                 float3 diffuseLight = diffuse;
    197.                 float node_291 = 1.0;
    198.                 diffuseLight += float3(node_291,node_291,node_291); // Diffuse Ambient Light
    199.                 float2 node_308 = i.uv0;
    200.                 finalColor += diffuseLight * tex2D(_MainTex,TRANSFORM_TEX(node_308.rg, _MainTex)).rgb;
    201.                 finalColor += specular;
    202. /// Final Color:
    203.                 return fixed4(finalColor,1);
    204.             }
    205.             ENDCG
    206.         }
    207.         Pass {
    208.             Name "ForwardAdd"
    209.             Tags {
    210.                 "LightMode"="ForwardAdd"
    211.             }
    212.             Blend One One
    213.            
    214.            
    215.             Fog { Color (0,0,0,0) }
    216.             CGPROGRAM
    217.             #pragma vertex vert
    218.             #pragma fragment frag
    219.             #define UNITY_PASS_FORWARDADD
    220.             #include "UnityCG.cginc"
    221.             #include "AutoLight.cginc"
    222.             #pragma multi_compile_fwdadd_fullshadows
    223.             #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
    224.             #pragma target 3.0
    225.             uniform float4 _LightColor0;
    226.             uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
    227.             uniform float _Glossslider;
    228.             struct VertexInput {
    229.                 float4 vertex : POSITION;
    230.                 float3 normal : NORMAL;
    231.                 float2 uv0 : TEXCOORD0;
    232.             };
    233.             struct VertexOutput {
    234.                 float4 pos : SV_POSITION;
    235.                 float2 uv0 : TEXCOORD0;
    236.                 float4 posWorld : TEXCOORD1;
    237.                 float3 normalDir : TEXCOORD2;
    238.                 LIGHTING_COORDS(3,4)
    239.             };
    240.             VertexOutput vert (VertexInput v) {
    241.                 VertexOutput o;
    242.                 o.uv0 = v.uv0;
    243.                 o.normalDir = mul(float4(v.normal,0), _World2Object).xyz;
    244.                 o.posWorld = mul(_Object2World, v.vertex);
    245.                 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    246.                 TRANSFER_VERTEX_TO_FRAGMENT(o)
    247.                 return o;
    248.             }
    249.             fixed4 frag(VertexOutput i) : COLOR {
    250.                 i.normalDir = normalize(i.normalDir);
    251.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    252. /////// Normals:
    253.                 float3 normalDirection =  i.normalDir;
    254.                 float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
    255.                 float3 halfDirection = normalize(viewDirection+lightDirection);
    256. ////// Lighting:
    257.                 float attenuation = LIGHT_ATTENUATION(i);
    258.                 float3 attenColor = attenuation * _LightColor0.xyz;
    259. /////// Diffuse:
    260.                 float NdotL = dot( normalDirection, lightDirection );
    261.                 float3 diffuse = max( 0.0, NdotL) * attenColor;
    262. ///////// Gloss:
    263.                 float gloss = _Glossslider;
    264.                 float specPow = exp2( gloss * 10.0+1.0);
    265. ////// Specular:
    266.                 NdotL = max(0.0, NdotL);
    267.                 float node_82 = 0.0;
    268.                 float3 specularColor = float3(node_82,node_82,node_82);
    269.                 float3 specular = attenColor * pow(max(0,dot(halfDirection,normalDirection)),specPow) * specularColor;
    270.                 float3 finalColor = 0;
    271.                 float3 diffuseLight = diffuse;
    272.                 float2 node_309 = i.uv0;
    273.                 finalColor += diffuseLight * tex2D(_MainTex,TRANSFORM_TEX(node_309.rg, _MainTex)).rgb;
    274.                 finalColor += specular;
    275. /// Final Color:
    276.                 return fixed4(finalColor * 1,0);
    277.             }
    278.             ENDCG
    279.         }
    280.     }
    281.     FallBack "Diffuse"
    282.     CustomEditor "ShaderForgeMaterialInspector"
    283. }
    284.  
    any tips?
     
  3. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello BCoyle,

    You are the third person to request Shader Forge integration, clearly this is something people want! :)

    Reflection Manager requires some custom shader code in order to function, which needs to be wrapped in the Shader Forge system for you to use.

    I will try to write a custom shader 'node' later this week, that should be easily integrated in your existing Shader Forge material. I will reply to this thread when that is done.

    Reflection Manager comes with documentation on integrating into your own custom shaders, as well as several example shader implementations. Including the "Reflective Lighting" material used in the Parallax Demo.

    Integration is fairly straight forward, but can become more tricky if you have constraints.
    Code (csharp):
    1.  
    2. #include "ReflectionManager.cginc"
    3. float3 reflection_colour = ReflectionManager( _Cubemap, _GlossMap, world_reflection_vector, world_position, uv );
    4.  
    EDIT : See below, I still haven't finished Shader Forge integration.
     
    Last edited: May 25, 2014
  4. PROTOFACTOR_Inc

    PROTOFACTOR_Inc

    Joined:
    Nov 15, 2009
    Posts:
    4,052
    Really interesting stuff. Great job!!
     
  5. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Looks really cool!!

    Will this work with Unity Free and if so are there any limitations?
     
  6. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello Zaddo67,

    Yes! Reflection Manager can be used with Unity Free.

    The built-in Unity generation algorithm does not work in Unity Free, so you have to simply select FRAME_BUNKER as your generation algorithm.

    I just noticed some seaming, weirdness and warnings on the dynamic cubemap (the one in the last room) when running Unity Free, I'll take a look at that ASAP and have a fix in the next build.
     
  7. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Thx GameArt. I have put this on my shopping list.
     
  8. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I have looked at integration with Shader Forge, and had a few problems. I could not finish the integration inside the Shader Forge node editor. I can't get #includes to be added in the correct place from the node editor. I'll ask the Shader Forge people about this, and will include an example material in the next release.

    But... Reflection Manager comes with an array of really great materials out of the box, so I encourage you to not wait! :)
     
  9. CaseJnr

    CaseJnr

    Joined:
    May 14, 2014
    Posts:
    43
    Could you give an example of a shaderforge shader with the parallax refection code manually added.
     
  10. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hey CaseJnr,

    The problem I ran into was that when I opened the shader with my manual changes, it would be erased. I looked at restructuring my code to work inside a shader forge node but it was becoming a big mess. So this example is not really that useful.

    I'm not at the computer I tried this at tonight, so 'll post the shader example tomorrow. You can use it to put the 'final' touches on your shader forge shader. But be warned you won't be able to use Shader forge functionality after the fact!
     
  11. CaseJnr

    CaseJnr

    Joined:
    May 14, 2014
    Posts:
    43
    It's all good. I already sorted it out. Thanks anyway.
     
  12. Deleted User

    Deleted User

    Guest

    Is it possible to have reflective glass (reflective + semi-transparent + diffuse map) using Reflection Manager?

    EDIT: Sorry, never mind :) I used this as a template and integrated reflection manager as instructed in manual.
     
    Last edited by a moderator: Jul 17, 2014
  13. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Awesome to hear the instructions helped you integrate the shader easily!

    In the next version of ReflectionManager I will include a nice glass shader so others don't need to do this.
     
  14. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Hi GameArt

    I have a problem when i enable "force parallax" the cross fade between cubemaps bug, it disable force parallax during the cross fade, do you know how to fix it ?

    ( sorry if my english is bad i'm french )
     
    Last edited: Aug 19, 2014
  15. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello al3d,

    I see that in the demo, when I push a sphere through two rooms with parallax forced on, I get a noticeable pop when entering the 2nd room. I believe this is because we are not considering the 2nd parallax volume when blending. I will address this issue in the next maintenance release.

    All we need to do to fix this is to supply our shader with information for the 2nd parallax volume.

    I will supply a fixed version of this shader later this week.
     
  16. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Thanks for the answer ! can't wait for the next release :)
     
    GameArt likes this.
  17. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Just wondering, how many probes do you have set up in this scene? Is it one per room or more than that? And what resolution? Are there options for changing the resolution?
     
  18. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    The sample scene features one probe per room. The static probes are 512. The last room features a dynamic probe, which is at a lower resolution.

    Generation is customizable, allowing you to select static targets, automatically generate targets and dynamic targets.
    Resolution is also configurable, and several generation and smoothing methods are available.
    Fine grain controls are also available, for doing things like enabling and disabling rendering layers, backgrounds and runtime linking options.
     
  19. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    do you managed to fix the shader? thx
     
  20. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Version 0.4 was just sent for review, it includes your requested change.
     
  21. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Thanks man ! ;)
     
  22. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    No problem! I'll post back here when that version goes live.
     
  23. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    This looks really interesting. I was wondering, how easy would it be to integrate into a custom surface shader that currently doesn't use cubemaps? I have a shader that blends between two different diffuse texture atlases and normal atlases, ideally, I'd like to add support for cubemaps so that the cubemaps are swapped in the shader based on which room/area of the level the player is in.

    Does this sound like something this asset can handle? How's support for procedurally generated levels?
     
  24. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello Rico,

    This is exactly the case the shader integration is optimized for!

    For a dynamic object that changed cubemaps as your character moved about rooms, you would add some code to your surface shader that looks like this:

    Code (CSharp):
    1. // At the start of the surface shader cg section
    2. #include "ReflectionManager.cginc"
    3.  
    4. // In the surface shader code portion
    5. float3 reflection_colour_primary = ReflectionManager( _Cubemap, _GlossMap,world_reflection_vector, world_position, uv );
    6. float3 reflection_colour_secondary = ReflectionManagerAlternate( _CubemapAlternate, _GlossMap, world_reflection_vector, world_position, uv );
    7. float3 reflection_colour = lerp( reflection_colour_primary, reflection_colour_secondary, _CubemapAlternateMix );
    And then you would simply add the included dynamic linking component to your objects.

    An example of this integration is included in the asset package.

    ---

    Runtime cubemap generation is very do-able. The tech supports generating cubemaps at runtime. Right now the run-time generation is designed for dynamic scenes, but it would be trivial to limit updates to a single pass when loading/generating the level
     
  25. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Version 0.4 is now live on the asset store.

    Version 0.5 is underway. It will include alpha cutoff and transparent material examples, as well as a host of usability improvements! A new demo scene and a video tutorial is well underway.




     
  26. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Here is a sneak peak of the new demo level I'm working on:

    Transparent reflections + Alpha cutout reflections (chainlink behind window).


    Per pixel distortion with parallax corrected reflections. (Ice Example).
     
  27. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    The ice shader is tweakable. Here is a more 'transparent' looking version:
     
  28. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Added interactive transparency demo link, and youtube video.
    I also updated the parallax reflection demo to include improvements found in version 0.4
     
  29. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Added links to included documentation,
    The detailed ReflectionManagerHelp reference document and an early draft of the new high level QuickStartGuide.
     
  30. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Added Oculus Rift parallax correction demo.
     
  31. angelodelvecchio

    angelodelvecchio

    Joined:
    Nov 15, 2012
    Posts:
    170
    Sorry my noobyness but i dont understand how this works.

    This good tool will work with other shaders? like alloy? or it must to be replaced?

    Man ythanks
     
  32. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello Angelodelvecchi,

    To get the parallax effect you must use custom shaders, or integrate our simple shader script into your existing shaders. We include many shaders and examples for this.

    Any shader that uses the standard cubemap naming that the built-in Unity shaders use, will automatically get linked against the reflection probes- but will not get the parallax correction.

    Hope that helps explain your question!
     
  33. e3di

    e3di

    Joined:
    Nov 15, 2013
    Posts:
    14
    Hi,

    I have a couple of question re Reflection Manager, which I have to say looks very cool.

    Firstly will it work with Unity 5 beta?

    Secondly, I am looking for way to get nice reflections of chairs, tables etc in a floor, will this do that?

    Thanks
     
  34. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Thank you for your kind words.
    I suspect Reflection Manager will be depreciated in Unity 5 by the new built in probe system. But I will take a look and confirm.
    Reflection Manager is best for things on the edges of rooms. So it provides great reflections on the chairs, but not of them. If you just need floor reflections, look up "planer reflections"

    Cheers!
     
  35. probesys

    probesys

    Joined:
    Aug 26, 2013
    Posts:
    56
    Great demo! I tried it with the oculus rift, I don't know if it's just me, but it feels like you are looking through glass into an other room, instead of a reflection. I don't know what causes it, but the brain interprets it that way. Did you experienced the same thing? Do you know what causes it?
     
  36. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I have not experienced this, but I will dive in and check out what you mean soon.

    I suspect it could be caused by the roughness of my sample materials. The surfaces in the demo are overly reflective/clear, they should appear more roughed up and less mirror like- but for the purposes of the demo I was aiming for a crisp reflection that could not be achieved by reasonable screen space solutions.
     
  37. probesys

    probesys

    Joined:
    Aug 26, 2013
    Posts:
    56
    The effect is not apparent on the floor, only on the walls. Maybe it has something to do with roughness indeed. I'll let you know if I put the finger on it. Keep up the good work, it's an awesome product, thanks for bringing this to Unity!
     
  38. The_Domaginarium

    The_Domaginarium

    Joined:
    Dec 11, 2012
    Posts:
    20
    Hello! I saw you have SM2.0 support for lower end mobile devices, but I was wondering if that means you can use this on DirectX 9 rendering and its OpenGL equivalent? I like to target broad hardware configurations and it'd be a shame if this was limited to mid-to-high end videocards!


    Thanks!
     
  39. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hi Magnolia_Fan!

    We do indeed support SM2.0. In the current build we have rotations enabled which blows the SM2.0 instruction limit, but that will be fixed in the next patch- and rotations can be disabled in the mean-time to get back under the SM2.0 restriction. The 'gloss' sampling has to be dumbed down a bit for SM2.0, because it does not support SampleLOD, but other than that you can get full reflections on low end mobile :)

    All shaders are written in CG and are portable. I have tested on Windows Phone, Vita, Oculus, Web and PC.
     
  40. Keyjin

    Keyjin

    Joined:
    Nov 28, 2013
    Posts:
    16
    Hey,

    is it possible to let gameobjects be reflected too, like your balls you are shooting in the video.

    -Keyjin
     
  41. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Hello Keyjin,

    You could use dynamic reflection probes to add those kind of reflections, but they are more expensive. The final room (with the rotating lights) is an example of a dynamic probe. The parallax effect is best when reflecting things at the ends of the volume, so objects inside the rooms won't reflect as nicely.

    Dynamic game objects can show world reflections (like the balls) by attaching a Dynamic Linker component to them.
     
    Keyjin likes this.
  42. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    So does this work with Marmoset's Skyshop or is it an alternative or?
     
  43. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Alternative. Basic functionality works with most built in Unity shaders, but advanced parallax reflections, and proper glossy reflections require you to use Reflection Manager shaders (or integrate the little snippet of code into your own).
     
  44. The_Domaginarium

    The_Domaginarium

    Joined:
    Dec 11, 2012
    Posts:
    20
    I just bought it and tried it, it's pretty amazing.
    By the way I am testing it on a Playstation 3 devkit, so you know it works on a 11 year old console just fine.

    I have to try the dynamic reflections to see how it works, and to see how much t affects performance.
     
  45. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    That's an awesome endorsement :) I wish I could see it running.

    I'll try to get the updates to the SM2 version submitted for cert this weekend.
     
  46. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Great plugin.
    Is this working with Unity 5 ?
     
  47. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    I haven't tried it with Unity 5, so it will likely need a few tweaks.

    If your willing to use physically based shaders, Unity 5 has a similar parallax / gloss feature built in.

    Reflection Manager will still be useful in Unity 5 for those who aren't ready to make the switch to physically based (all your art needs to be tweaked and converted to make the new Unity shaders look good). But again, I haven't tested it in Unity 5 yet. I'll report back here after I try it.
     
  48. broesby

    broesby

    Joined:
    Oct 14, 2012
    Posts:
    118
    Can it be used for water/ocean reflections in Unity Free or would that be too heavy on performance??
     
  49. GameArt

    GameArt

    Joined:
    Feb 24, 2013
    Posts:
    86
    Reflection probes are great for high performance water/ocean reflections, as long as you aren't concerned with getting close up detail (i.e. the players reflection in the water). If you want players and dynamic objects in your scene, something like the built in Unity water, which uses a secondary camera for reflections, makes more sense.

    Reflection Manager was made to work with 'a' version of Unity Free, but that doesn't mean it will work with every version. I would recommend against buying Reflection Manager at this time, if you require Unity Free support.
     
  50. PiotrW

    PiotrW

    Joined:
    Nov 2, 2014
    Posts:
    20
    Hello. My name is Peter. I bought your extension and it is not working for me at unity 4.6.

    I can't make working cubemaps. Even when I open your sample projects and click generate on reflection probes I got much different results than before. On all my shader and projects I got reflections from wrong side. On two sides of box I see the same scene what is behind box not in front of it when should be reflection. Any ideas?

    Sometimes generated cubemap is just grey and I got error in console error - trying to read pixels out of bounds. Maybe this information can help you to debug it.
     
    Last edited: Dec 3, 2014