当前位置:网站首页>URP - shaders and materials - simple lit

URP - shaders and materials - simple lit

2022-07-07 07:22:00 Programmer base camp

Simple Lit Shader

When performance is more important than realism , Use this shader . This shader uses a simple approximation of illumination . Because this shader Do not calculate physical correctness and energy conservation , It renders quickly .

Using the Simple Lit Shader in the Editor

Select and use this shader :

  1. In your project , Create or find the material you want to use the shader . Select material . A material inspection window will open .
  2. Click shader , choice Universal Render Pipeline > Simple 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 .

PropertyDescription
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.
Alpha uses the Material’s alpha value to change how transparent an object is. 0 is fully transparent. 1 appears fully opaque, but the Material is still rendered during the Transparent render pass. This is useful for visuals that you want to be fully visible but to also fade over time, like clouds.
Premultiply applies a similar effect to the Material as Alpha, but preserves reflections and highlights, even when your surface is transparent. This means that only the reflected light is visible. For example, imagine transparent glass.
Additive adds an extra layer to the Material, on top of another surface. This is good for holograms. 
Multiply multiplies the color of the Material with the color behind the surface. This creates a darker effect, like when you look through colored glass.

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.
Front Face renders the front face of your geometry and culls the back face. This is the default setting. 
Back Face renders the front face of your geometry and culls the front face. 
Both makes URP render both faces of the geometry. This is good for small, flat objects, like leaves, where you might want both sides visible.

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.

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 .

PropertyDescription
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 .

Specular Map

Controls the color of your specular highlights from direct lighting, for example Directional, Point, and Spot lights. To assign a Texture to the Specular 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
In Source, you can select a Texture in your Project to act as a source for the smoothness. By default, the source is the Alpha channel for this Texture. 
You can use the Smoothness slider to control the spread of highlights on the surface. 0 gives a wide, rough highlight. 1 gives a small, sharp highlight like glass. Values in between produce semi-glossy looks. For example, 0.5 produces a plastic-like glossiness.

Control the color of your highlights from direct lighting , For example, direction lights , spot , And spotlights . To set a texture for the highlight map , 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 .

stay Source in , You can select a texture in the project as the source of smoothness . By default , The source is this texture Alpha passageway .

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 .

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. 
The float value next to the setting is a multiplier for the effect of the Normal Map. Low values decrease the effect of the normal map. High values create stronger effects.

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 .
The floating-point value next to this setting is the multiplier of the normal mapping effect . Low values will reduce the effect of normal mapping . The higher the value , The stronger the effect .

Emission

Makes the surface look like it emits lights. When enabled, the Emission Map and Emission Color settings appear.
To assign an Emission Map, click the object picture next to it. This opens the Asset Browser, where you can select from the textures in your Project.
For Emission Color, you can use the color picker to assign a tint on top of the color. This can be more than 100% white, which is useful for effects like lava, that shines brighter than white while still being another color.
If you have not assigned an Emission Map, the Emission setting only uses the tint you’ve assigned in Emission Color.
If you do not enable Emission, URP sets the emission to black and does not calculate emission.

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 .

Advanced

Advanced settings affect the underlying calculation of rendering . They have no obvious effect on your surface .

ropertyDescription
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 .

原网站

版权声明
本文为[Programmer base camp]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130704049748.html