当前位置:网站首页>URP - shaders and materials - light shader lit
URP - shaders and materials - light shader lit
2022-07-07 07:23:00 【Programmer base camp】
Lit Shader
Light shaders let you render real-world surfaces like stones , Wood , glass , plastic , The quality of metal in the reality of photos . Your light levels and reflections look lifelike , And react correctly under various light conditions , For example, bright sunshine , Or a dark cave . This shader is in the general rendering pipeline (URP) The most computationally intensive shading model .
Using the Lit Shader in the Editor
Select and use this shader :
- In your project , Create or find the material you want to use the shader . Select material . A material inspection window will open .
- Click shader , choice Universal Render Pipeline > Lit.
UI overview
The inspector window of this shader contains the following elements :
Surface Options
Surface Options control URP How to render materials on the screen .
Surface Options
Surface Options control URP How to render materials on the screen .
Property | Description |
---|---|
Workflow Mode | Use this drop-down menu to choose a workflow that fits your Textures, either Metallic and Specular. Use this drop-down menu to select a workflow , Suitable for your texture , Metal and highlights . When you make your choice , The main texture options are in the rest of the checker now according to the workflow you choose . Display information about metal or highlight workflow , see also Unity Man pages for standard shaders built into . |
Surface Type | Use this drop-down to apply an Opaque or Transparent surface type to the Material. This determines which render pass URP renders the material in. Opaque surface types are always fully visible, regardless of what’s behind them. URP renders opaque Materials first. Transparent surface types are affected by their background, and they can vary according to which type of transparent surface type you choose. URP renders transparent Materials in a separate pass after opaque objects. If you select Transparent, the Blending Mode drop-down appears. Use this drop-down menu to apply an opaque or transparent surface type to the material . To determine the URP The rendering path of . Opaque surface types are always completely visible , No matter what's behind them .URP First render opaque materials . The type of transparent surface is affected by its background , They can vary according to the type of transparent surface you choose .URP Render transparent materials separately after opaque objects . If you choose transparency , The mixed mode drop-down menu will appear . |
Blending Mode | Use this drop-down to determine how URP calculates the color of each pixel of the transparent Material by blending the Material with the background pixels. Use this drop-down list to determine URP How to calculate the color of each pixel of transparent materials by mixing materials and background pixels . Alpha Using materials Alpha Value to change the transparency of the object .0 It's completely transparent .1 The display is completely opaque , But the material is still rendered during transparent rendering . This is for those images that you want to be completely visible but want to fade away over time , Such as cloud , It's very useful . Premultiply Similar materials are applied Alpha The effect of , But it retains reflections and highlights , Even if your surface is transparent . This means that only reflected light is visible . for example , Imagine transparent glass . Add an additional layer on another surface of the material . This is very useful for holograms . Multiply Superimpose the color of the material with the color behind the surface . This will produce a darker effect , Just like you see things through stained glass . |
Render Face | Use this drop-down to determine which sides of your geometry to render. Use this drop-down menu to determine which side of the geometry to render . Front Face Render the front of the geometry and weed out the back . This is the default setting . Back Face Render the front of the geometry and weed out the front . Both Both make URP Render both sides of the geometry . This is useful for small, flat objects , Like leaves , You may want it to be visible on both sides . |
Alpha Clipping | Makes your Material act like a Cutout Shader. Use this to create a transparent effect with hard edges between the opaque and transparent areas. For example, to create blades of grass. To achieve this effect, URP does not render alpha values below the specified Threshold, which appears when you enable Alpha Clipping. You can set the Threshold by moving the slider, which accepts values from 0 to 1. All values above your threshold are fully opaque, and all values below your threshold are invisible. For example, a threshold of 0.1 means that URP doesn't render alpha values below 0.1. The default value is 0.5. Make your material behave like a clipping shader . Use this to create a transparent effect with hard edges between opaque and transparent areas . for example , Create leaves of grass . To achieve this effect ,URP Do not render below the specified threshold alpha value , Threshold is enabled alpha Appears when cutting . You can set the threshold by moving the slider , The slider accepts from 0 To 1 Value . All values above the threshold are opaque , All values below the threshold are invisible . for example , The threshold for 0.1 signify URP Do not render below 0.1 Of alpha value . The default value is 0.5. |
Receive Shadows | Tick this box to enable your GameObject to have shadows cast upon it by other objects. If you untick this box, the GameObject will not have shadows on it. Check this box to make your game object cast shadows by other objects . If you cancel this box , Game objects will not have shadows . |
Surface Inputs
Surface input describes the surface itself . for example , You can use these attributes to make your surface look wet 、 dry 、 Rough or smooth .
Be careful : If you are used to built-in Unity Rendering pipeline Standard shaders , These options are similar to Material editor Main map settings in .
Property | Description |
---|---|
Base Map | Adds color to the surface, also known as the diffuse map. To assign a Texture to the Base Map setting, click the object picker next to it. This opens the Asset Browser, where you can select from the Textures in your Project. Alternatively, you can use the color picker. The color next to the setting shows the tint on top of your assigned Texture. To assign another tint, you can click this color swatch. If you select Transparent or Alpha Clipping under Surface Options, your Material uses the Texture’s alpha channel or color. Add color to the surface , Also known as diffuse mapping . To assign a texture to the base map settings , Click the object selector next to it . This will open the asset browser , There you can choose from the texture of your project . perhaps , You can use the color selector . The color next to the setting shows the color on the texture you assigned . To specify another hue , You can click on this palette . If you choose transparent or Alpha Tailoring , Your material will use texture Alpha Channel or color . |
Metallic / Specular Map | Shows a map input for your chosen Workflow Mode in the Surface Options. Display the map input of the workflow mode you selected in the surface option . about metal Map workflow ,Map The basis assigned from above Map Get color . Use the slider to control the metal appearance of the surface .1 It's completely metallic , Like silver or copper ,0 It is completely dielectric , Like plastic or wood . For dirty or corrosive metals , You can usually use 0 To 1 Between the value of the . For highlight map settings , You can assign texture to it by clicking the object selector next to it . This will open the asset browser , There you can choose from the texture of your project . perhaps , You can use the color selector . For these two workflows , You can use the smooth slider to control the extension of highlights on the surface .0 Gives a light highlight .1 Give a small , Sharp highlights are like glass . Values in between produce a semi smooth appearance . for example ,0.5 It can produce gloss similar to plastic . Use Source Drop down menu to select where shader samples smooth map . Option has :metal Alpha( come from metal map Of Alpha passageway ) and Albedo Alpha( come from base map Of Alpha passageway ). The default value is metal Alpha. If the selected source has alpha passageway , The shader samples the channel and multiplies each sample by the smoothing value . |
Normal Map | Adds a normal map to the surface. With a normal map, you can add surface details like bumps, scratches and grooves. To add the map, click the object picker next to it. The normal map picks up ambient lighting in the environment. Add a normal map to the surface . Use normal mapping , You can add surface details , Such as bump 、 Scratches and grooves . To add a map , Click the object selector next to it . Normal map picks up rays in the environment . |
Height Map | URP implements the parallax mapping technique which uses the height map to achieve surface-level occlusion effect by shifting the areas of the visible surface texture. To add the map, click the object picker next to it. URP Parallax mapping technology , Use the height map to translate the visible surface texture area , Realize the occlusion effect of surface layer . To add a map , Click the object selector next to it . |
Occlusion Map | Select an occlusion map. This simulates shadows from ambient light and reflection, which makes lighting look more realistic as less light reaches corners and crevices of objects. To select the occlusion map, click the object picker next to it. Select an occlusion map . This simulates shadows caused by ambient light and reflection , Make the light look more realistic , Make less light reach the corners and cracks of the object . To select an occlusion map , Click the object selector next to it . |
Emission | Makes the surface look like it emits lights. When enabled, the Emission Map and Emission Color settings appear. Make the surface look as if it is shining . When enabled ,Emission Map Self illumination map and Emission Color The self illumination color setting will appear . To assign a self illumination map , Please click the object image next to it . This will open the asset browser , There you can choose from the texture of your project . For self illumination color , You can use the color selector to assign a hue at the top of the color . This can be more than 100% White , This is very useful for the effect , Such as lava , Glitter is brighter than white , But it's still another color . If you don't assign a self illumination map , The glow setting uses only the shading you assigned in the self illumination color . If self illumination is not enabled ,URP Set self illumination to black , And self illumination is not calculated . |
Tiling | A 2D multiplier value that scales the Texture to fit across a mesh according to the U and V axes. This is good for surfaces like floors and walls. The default value is 1, which means no scaling. Set a higher value to make the Texture repeat across your mesh. Set a lower value to stretch the Texture. Try different values until you reach your desired effect. One 2D Double value-added , according to U and V Axis scales the texture to fit the mesh . Good for surfaces like floors and walls . The default value is 1, This means no scaling . Set a higher value to make the texture repeat on your mesh . Set a low value to stretch the texture . Try different values , Until you get the effect you want . |
Offset | The 2D offset that positions the Texture on the mesh. To adjust the position on your mesh, move the Texture across the U or V axes. Locate the texture on the mesh 2D Offset . To adjust the position of the grid , stay U Axis or V Move the texture on the axis . |
Detail Inputs
Use the detail input settings to add additional details to the surface .
requirement :GPU Support shader Model 2.5 Or higher .
Property | Description |
---|---|
Mask | Select a texture that defines areas where Unity overlays the Detail maps over the Surface Inputs maps. The mask uses the alpha channel of the selected texture. The Tiling and Offset settings have no effect on the mask. Select a texture to define Unity Overlay the area of the detail map on the surface input map . The mask uses the selected texture alpha passageway . Tiling and offset settings have no effect on the mask . |
Base Map | Select the texture containing the surface details. Unity blends this map with the Surface Base Map using the overlay mode. Select a texture that contains surface details .Unity Use overlay mode to mix this map with the surface base map . |
Normal Map | Select the texture containing the normal vector data. Use a normal map to add surface details like bumps, scratches and grooves. Select the texture containing normal vector data . Use normal mapping to add surface details , Such as bump 、 Scratches and grooves . |
Tiling | Use this setting to scale the Base Map and the Normal Map on the mesh along the U and V axes, so that the maps fit the mesh best. The default value is 1. Select a value higher than one to make the maps repeat themselves across the mesh. Set a value lower than 1 to stretch the maps. Use this setting to scale the base map and normal map on the mesh along U and V Axis , In this way, the map can best match the mesh . The default value is 1. Choose one higher than 1 The value of makes the map repeat in the mesh . Set a value less than 1 To stretch the mapping . |
Offset | The offset that moves the Base Map and the Normal Map on the mesh along the U and V axes. Along the grid U Axis and V Axis shift offset of base map and normal map . |
Advanced
Advanced settings affect the underlying calculation of rendering . They have no obvious effect on your surface .
roperty | Description |
---|---|
Specular Highlights | Enable this to allow your Material to have specular highlights from direct lighting, for example Directional, Point, and Spot lights. This means that your Material reflects the shine from these light sources. Disable this to leave out these highlight calculations, so your Shader renders faster. By default, this feature is enabled. Enabling this option allows your material to get highlights from direct lighting , For example, directional light 、 Point light and spotlight . This means that your material will reflect the light of these light sources . Disable this to ignore these highlight calculations , This makes your shader render faster . By default , This feature is enabled . |
Environment Reflections | Sample reflections using the nearest Reflection Probe, or, if you have set one in the Lighting window, the Lighting Probe. If you disable this, you will have fewer Shader calculations, but this also means that your surface has no reflections. Use the nearest reflection probe for reflection sampling , perhaps , If you set a reflection probe in the lighting window , Then use the illumination probe for reflection sampling . If you disable this , You will have less coloring calculation , But it also means that there is no reflection on your surface . |
Enable GPU Instancing | Makes URP render meshes with the same geometry and Material in one batch, when possible. This makes rendering faster. URP cannot render Meshes in one batch if they have different Materials or if the hardware does not support GPU instancing. If possible, make URP Render meshes with the same geometry and materials in a batch . This makes rendering faster . If the mesh has different materials or the hardware does not support GPU Instantiation ,URP You cannot render meshes in a batch . |
Priority | Use this slider to determine the chronological rendering order for a Material. URP renders Materials with higher values first. You can use this to reduce overdraw on devices by making the pipeline render Materials in front of other Materials first, so it doesn't have to render overlapping areas twice. This works similarly to the render queue in the built-in Unity render pipeline. Use this slider to determine the rendering order of materials .URP First render higher value materials . You can use it to reduce over rendering on your device , The method is to let the pipeline render the material before other materials , So it doesn't need to render the overlapping area twice . This is similar to the built-in Unity Render queue in render pipeline . |
Channel packing
This shader uses channel padding , So you can make metal 、 The smoothing and occlusion attributes use a RGBA texture . When you use texture packaging , You only need to load a texture into memory , Instead of three separate textures . When you are in Substance or Photoshop When writing texture maps in programs , You can pack the map like this :
Channel | Property |
---|---|
Red | Metallic |
Green | Occlusion |
Blue | None |
Alpha | Smoothness |
边栏推荐
- Pass parent component to child component: props
- 1090: integer power (multi instance test)
- 机器人技术创新与实践旧版本大纲
- PostgreSQL source code (60) transaction system summary
- Abnova membrane protein lipoprotein technology and category display
- Lvs+kept (DR mode) learning notes
- 软件验收测试
- 异步组件和Suspense(真实开发中)
- Config distributed configuration center
- Release notes of JMeter version 5.5
猜你喜欢
虚拟机的作用
Special behavior of main function in import statement
关于二进制无法精确表示小数
AVL树的实现
Sqlmap tutorial (IV) practical skills three: bypass the firewall
$refs:组件中获取元素对象或者子组件实例:
Bindingexception exception (error reporting) processing
Implementing data dictionary with JSP custom tag
Precise space-time travel flow regulation system - ultra-high precision positioning system based on UWB
云备份项目
随机推荐
Databinding exception of kotlin
Jesd204b clock network
外包干了四年,废了...
Big coffee gathering | nextarch foundation cloud development meetup is coming
Chinese and English instructions prosci LAG-3 recombinant protein
Networkx drawing and common library function coordinate drawing
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
ViewModelProvider. Of obsolete solution
Le Service MySQL manque dans le service informatique
Mobx knowledge point collection case (quick start)
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.10 tabbar component (I) how to open and use the default tabbar comp
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
Config distributed configuration center
1090: integer power (multi instance test)
Circulating tumor cells - here comes abnova's solution
Tujia, muniao, meituan... Home stay summer war will start
ROS2规划系统plansys2简单的例子
How to model and simulate the target robot [mathematical / control significance]
How DHCP router works
组件的嵌套和拆分