v0.5
This commit is contained in:
1 parent
153708c3b9
commit
507c08083a
51 files changed
+2481
-20
No files matched your search
@@ -3,7 +3,7 @@ Shader "BSDF/StandardURP"
|
||||
Properties
|
||||
{
|
||||
_BaseMap("纹理贴图", 2D) = "white" {}
|
||||
_LightMap("光照贴图", 2D) = "white" {}
|
||||
_LightMap("光照贴图", 2D) = "black" {}
|
||||
_NormalMap("法线贴图", 2D) = "bump" {}
|
||||
_BaseColor("基础颜色", Color) = (1, 1, 1, 1)
|
||||
_Metallic("金属度", Range(0, 1)) = 0.0
|
||||
@@ -146,12 +146,14 @@ Shader "BSDF/StandardURP"
|
||||
float3 BRDFToColor(BRDFData bsdf, InputData inputData,float3 positionWS){
|
||||
float3 color = float3(0, 0, 0);
|
||||
//主光源
|
||||
Light mainLight = GetMainLight();
|
||||
float4 shadowCoord = TransformWorldToShadowCoord(positionWS);//阴影坐标
|
||||
Light mainLight = GetMainLight(shadowCoord);
|
||||
color += LightingPhysicallyBased(bsdf,mainLight, inputData.normalWS, inputData.viewDirectionWS);
|
||||
//附加光源
|
||||
for (int i = 0; i < GetAdditionalLightsCount(); ++i)
|
||||
{
|
||||
Light additionalLight = GetAdditionalLight(i, positionWS);
|
||||
half4 shadowMask = CalculateShadowMask(inputData);
|
||||
Light additionalLight = GetAdditionalLight(i, positionWS,shadowMask);
|
||||
color += LightingPhysicallyBased(bsdf, additionalLight, inputData.normalWS, inputData.viewDirectionWS);
|
||||
}
|
||||
//环境光
|
||||
|
||||
Reference in new issue
Block a user