| Render Tree Usage
             Category: Light
            
             Shader Family: Light
            
             Output: Color
            
              mia_portal_light 
            
            The Portal Light shader is most often applied to a rectangular area light which is placed in the window of a room scene. The
               shader obtains its proper intensity and color from the sky outside the window (for example, an environment shader such as
               the Physical Sky (mia) shader or similar) and how much of that sky can be seen.
            
            When used with final gathering, the Portal Light acts as a final gathering concentrator, so that instead of having to send
               thousands of final gather rays around the scene to "find" the window, the portal light actually blocks final gather rays,
               and instead converts light from beyond the window to direct light, including high-quality area shadows.
            
            Final gathering will now see a well lit room rather than a black room, and can use much lower final gather ray counts. Furthermore,
               since the light from the window is now direct, you gain one extra light bounce for "free".
            
            
               
                  
                     
                     
                  
                  
                     |   
                         | Enables or disables the light. | 
               
             
             
               Color
               
 
               
                  
                     
                        
                        
                     
                     
                        |   
                            | A multiplier for the intensity of the light. | 
                     
                        |   
                            | Modifies the light color. When Tint is white, and the Intensity is 1.0, the light emitted is equal in intensity and color to the environment light that
                              final gathering would have seen if allowed to send many thousands of (unfiltered) final gather rays.
                            | 
                     
                        |   
                            | Specifies whether or not the light emitting surface is visible. When off, eye rays, reflection rays, etc. go straight through so that the portal light itself remains unseen and you can still
                              "see" out the window.
                            When on, the actual light emitting surface becomes visible to eye rays, reflection rays, etc. and you cannot "see" out the
                              window anymore, although you can still "see" the environment shaders result. This is useful when using the Portal Light as
                              a light card shader (see Portal Light (mia) option).
                            | 
                     
                        |   
                            | Portal Transparency has two functions: 
                               
                                 When Visible in Render is on, Portal Transparency is a multiplier for the "visible color" of the area light. When set to white,
                                    the directly "visible" color is the one dictated by the laws of physics for a surface that emits that amount of light.
                                  Modifying the parameter values away from white allows you to artificially change the balance between the visible result (which
                                    is changed by changing this parameter) and the intensity of the emitted light (which is not affected by this parameter). This
                                    can be useful to avoid noise
                                  
                                 When Visible in Render is off, Portal Transparency defines the transparency of the area light. This allows the Portal Light
                                    shader to double as a "gel" on the window, to subdue the intensity of what is seen outdoors, which otherwise tends to appear
                                    overexposed and blown out. The actual emitted light intensity is not affected by this, nor does this affect the intensity
                                    of other light rays travelling through the window, it only affects what is visible to the eye, in refractions or reflections.
                                  | 
                  
                 
             
             
               Shadows
               
 
               
                  
                     
                        
                        
                     
                     
                        |   
                            | Turns shadows on or off. | 
                     
                        |   
                            | If Shadow Offset is 0.0, the Portal Light shader begins tracing shadow rays at the light. When positive, the shadow rays actually
                              start at that distance "outdoors". So if there is a large object just outside the window, its shadow will be taken into account.
                              Conversely, a negative value allows the shadow rays to begin at that distance inside the window, which allows the shadow generation
                              to skip over troublesome geometry near the window (such as flowers, curtains, etc.) that would otherwise just introduce noise
                              into the shadows.
                            | 
                  
                 
             
             
               Environment
               
 
               
                  
                     
                        
                        
                     
                     
                        |   
                            | When Use Custom Environment Shader is off, the Portal Light shader gets the color of the light from the global environment
                              shader define for the scene.
                            When Use Custom Environment Shader is on, the Portal Light shader calls the shader that is connected to its custom_environment
                              input port in order to get the color of the light.
                              While this shader is intended to be a portal to an environment, you can also use it as a "light card" by connecting a shader
                              that returns a solid background color into its custom_environment input port. If Use Custom Environment Shader is on, and
                              no custom environment is actually passed, the shader behaves like a white light card.
                            | 
                     
                        |   
                            | When Sample Environment Using FG is off, a ray is cast into the environment and the environment shader is called to compute
                              the color of the light.
                            However, some shaders behave differently if they are called by a final gather ray or by another ray (for example, the mia
                              physical sky shader does not show the "image" of the visible sun to final gather rays). Since the main purpose of the Portal
                              Light shader is to act as a final gather concentrator, it should therefore follow that behavior. So when Sample Environment
                              Using FG is on, it calls the environment with the final gather ray type, so that shaders that switch their behavior based
                              on this can return the color appropriate for a final gather ray.
                            | 
                  
                 
             
             
               Additional Options
               
 
               
                  
                     
                        
                        
                     
                     
                        |   
                            | This is a performance optimization option. Any light below this level is ignored, and no shadow rays are traced (which is
                              what consumes the bulk of the render time of an area light). Of course, this makes the scene slightly darker since light is
                              ignored, but can save a lot of excess render time.
                            | 
                     
                        |   
                            | The light normally shines in the positive Z direction of the light object's coordinate space. If Reverse Light Direction is
                              on, it shines in the negative Z direction.
                            | 
                     
                        |   
                            | If Emit Photons Only is on, the light only shoots photons and does not actually emit any direct light at all. | 
                  
                 
             
             
               Render Tree Usage
               
 
               The Portal Light shader should be connected to both the  input and the  input of a rectangular (assuming a standard window setup) area light.
               
 
               By default, the Portal Light shader gets the color of the light from the global environment shader define for the scene. Alternatively
                  (as shown in the render tree setup below), the Portal Light shader can call another environment shader (that is connected
                  to its custom_environment input port) in order to get the color of the light.