Main Page/test and Unity Products:Amplify Impostors/Lightmap Baking: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
ampwiki>AmplifyWiki
No edit summary
 
ampwiki>Kebrus
 
Line 1: Line 1:
<span style="font-size: 120%;">[http://amplify.pt/unity/amplify-shader-editor Product Page] - [http://amplify.pt/unity/amplify-shader-editor/samples/ Included Shaders] - [[Unity_Products:Amplify_Shader_Editor/Manual| Manual]] - [[Unity_Products:Amplify_Shader_Editor/Manual#Shader_Functions| Shader Functions]] - [[Unity_Products:Amplify_Shader_Editor/Tutorials| Tutorials]] - [[Unity_Products:Amplify_Shader_Editor/API| API]] - [[Unity_Products:Amplify_Shader_Editor/Templates| Shader Templates]] - [[Unity_Products:Amplify_Shader_Editor/Nodes| Nodes]] - [[Unity_Products:Amplify_Shader_Editor/Community_Nodes| Community Nodes]]</span>
<span style="font-size: 120%;">[http://amplify.pt/unity/amplify-impostors Product Page] - [[Unity_Products:Amplify_Impostors/Manual| Manual]] - [[Unity_Products:Amplify_Impostors/Custom_Baking| Custom Baking]] - [[Unity_Products:Amplify_Impostors/Lightmap_Baking| Lightmap Baking]] - [[Unity_Products:Amplify_Impostors/Roadmap| Roadmap]]</span>
{| style="width: 920px; horizontal-align: left;"
|
== Standard Surface Output ==


Portions of this section have been acquired directly from the Unity Material Parameters Reference documentation.
== Introduction ==


Learn more: [https://docs.unity3d.com/Manual/StandardShaderMaterialParameters.html Unity Material Parameters Reference]
Due to high demand, as of version 0.9.5, you can now bake and render impostors with static Lightmap information. Be advise that, due to the static nature of lightmaps, doing this means all impostors sharing the same texture will also share the same light information. Making that light information different between similar impostor means baking different lightmaps to different objects which in turn increase the texture footprint of your application. If you use this feature it means you accept that trade-off when using multiple lightmapped impostors. This feature has some special uses cases, for instance, you might only want a impostor of a single static object that has baked lighting, or your multiple baked impostors might be sharing very similar lighting conditions in which case the different of objects would be neglectable.


The standard shader presents you with a list of material parameters. These parameters vary slightly depending on whether you have chosen to work in the Metallic workflow mode or the Specular workflow mode. Most of the parameters are the same across both modes, and this page covers all of them.
This is also a somewhat advance feature that uses custom baking to bake and render the lightmap information so we highly recommend you to first read the [[Unity_Products:Amplify_Impostors/Custom_Baking| custom baking tutorial here]] to understand the underlying concept.


== Description ==


 
You'll be creating a bake shader that outputs the lightmap in to a single RGBA texture and another that reads it. Because the light information can use higher values that single colors allow, unity packs the lightmap color RGB into a RGBM format where the M is a multiplier of RGB, this only means you'll need all four channels of a single texture and not just 3. You'll then need to create the runtime shader that reads that RGBA texture file and unpacks it into the original RGB information. While this might sound confusing at first its actually a matter of just adding an extra texture output and use it. We provide a shader function that automatically does the packing and the shader already unpacks the result without extra work.
{| cellpadding="10"
|http://wiki.amplify.pt/images/Nodes/OutputNode2.jpg
|
'''Standard Shader Inputs'''
 
* Albedo: The Albedo parameter controls the base color of the shader surface, accepting either color values or texture maps.
* Normal: Normal maps are a special kind of texture that allow the addition of surface details, such as shading information transferred from highpoly meshes, bumps, grooves and scratches. You may connect normal maps or custom normal vectors here.
* Emission: Emission controls the colour and intensity of light emitted from the surface, regardless of the lighting conditions; accepts full RGB values.
* Metallic ( Metallic workflow only ): When working in the Metallic workflow, the reflectivity and light response of the surface are modified by both Metallic and Smoothness levels; both greyscale inputs. You may use a range of values from 0 to 1, affecting the whole surface, or even connect a texture, which will control the Metallic values while providing different values for different areas of the surface; 0 being dielectric ( non-metallic ) and 1 full Metal.
* Specular ( Specular workflow only ): When working in Specular mode, the RGB colour in the Specular parameter controls the strength and colour tint of the specular reflectivity.
* Smoothness ( Both workflows ): The concept of Smoothness applies to both Specular and Metallic workflows, and works very much the same way in both; also greyscale. A completely smooth surface at value 1 provides clear reflections, while a rough surface set to 0 creates a diffuse color with no clear reflections; It's also referred to as "Roughness" in some engines.
* Ambient Occlusion: The Occlusion input accepts an occlusion texture map, or custom value, that's used to provide information about which areas of the model should display high or low indirect lighting, which comes from ambient lighting and reflections. The occlusion map is a greyscale image where white indicates areas that should receive full indirect lighting, while black indicates no indirect lighting.
* Transmission: The Transmission is a highly optimized way of approximating light scattering. In other words, it defines how much light passes through a surface when lit from behind, which is ideal for less detailed assets such as leaves, cloth, or even wax objects; accepts full RGB inputs.
* Translucency: The Translucency input allows you to approximate SSS (Sub-Surface Scattering) effects in a simple and optimized manner by controlling the light-normal angle falloff offset. It is usually used for skin effects but flexible enough for other uses; accepts full RGB inputs.
* Refraction ( Transparent Render Type ): The refraction input requires a shader with its Render Type set to Transparent and is used to simulate the deformation effect of objects seen through a medium such as glass or water, which is achieved by a screen-space UV offset that refracts the background pixels; accepts full RGB inputs. This technique is a simple approximation to a light phenomenon that often occurs when waves travel from a medium with a given refractive index to a medium with another at an oblique angle.
* Opacity ( Transparent Render Type ): The Opacity input requires a shader with its Render Type set to Transparent, being responsible for setting the transparency of a surface as a whole, using a range of values between 0 and 1, from completely transparent to fully opaque respectively; accepts full RGB inputs.
* Opacity Mask ( Transparent Render Type ): The Opacity Mask requires a shader with its Render Type set to Transparent or a Masked Blend Mode, and works similarly to Opacity in the sense that it takes in a value between 0 and 1, from complete transparency to full opacity, but without considering the values in-between, resulting in either completely visible or completely invisible surfaces in specific areas. It is the perfect solution for materials that define complex solid surfaces such as wire mesh or chain link, as the opaque portions will still respect lighting; accepts greyscale inputs.
* Local Vertex Offset ( Relative Vertex Output ): The Local Vertex Offset input may be used to alter the shape of a surface through vertex manipulation, where a XYZ coordinate will define how each vertex will offset from its relative position.
* Local Vertex Position ( Absolute Vertex Output ): The Local Vertex Position works similarly to the Local Vertex Offset input, however, instead of offsetting each vertex from its relative position it will instead offset the vertices in absolute world space direction.
* Local Vertex Normal: The Local Vertex Normal allows the adjustment of the normal direction of any offset surfaces as Mesh Normals are not computed in real-time. This process is usually referred to as Normal Reconstruction.
* Tessellation: The Tessellation input allows the subdivision of a mesh's triangles, splitting them into smaller triangles at runtime in order to increase the surface detail of any given mesh.
* Debug: The Debug input generates a preview shader that overrides all other active inputs, drawing only what is plugged in to its input port. Please note that not all nodes, or specific combinations, can be previewed in the debug mode.
|}
 
|}

Revision as of 15:58, 26 March 2019

Product Page - Manual - Custom Baking - Lightmap Baking - Roadmap

Introduction

Due to high demand, as of version 0.9.5, you can now bake and render impostors with static Lightmap information. Be advise that, due to the static nature of lightmaps, doing this means all impostors sharing the same texture will also share the same light information. Making that light information different between similar impostor means baking different lightmaps to different objects which in turn increase the texture footprint of your application. If you use this feature it means you accept that trade-off when using multiple lightmapped impostors. This feature has some special uses cases, for instance, you might only want a impostor of a single static object that has baked lighting, or your multiple baked impostors might be sharing very similar lighting conditions in which case the different of objects would be neglectable.

This is also a somewhat advance feature that uses custom baking to bake and render the lightmap information so we highly recommend you to first read the custom baking tutorial here to understand the underlying concept.

Description

You'll be creating a bake shader that outputs the lightmap in to a single RGBA texture and another that reads it. Because the light information can use higher values that single colors allow, unity packs the lightmap color RGB into a RGBM format where the M is a multiplier of RGB, this only means you'll need all four channels of a single texture and not just 3. You'll then need to create the runtime shader that reads that RGBA texture file and unpacks it into the original RGB information. While this might sound confusing at first its actually a matter of just adding an extra texture output and use it. We provide a shader function that automatically does the packing and the shader already unpacks the result without extra work.