浏览代码

Fixed Unlit GI

/main
Felipe Lira 6 年前
当前提交
d7794acc
共有 4 个文件被更改,包括 55 次插入5 次删除
  1. 12
      com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGUI/LightweightShaderGUI.cs
  2. 23
      com.unity.render-pipelines.lightweight/LWRP/Shaders/LightweightStandardUnlit.shader
  3. 16
      com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/LightweightPassMetaUnlit.hlsl
  4. 9
      com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/LightweightPassMetaUnlit.hlsl.meta

12
com.unity.render-pipelines.lightweight/LWRP/Editor/ShaderGUI/LightweightShaderGUI.cs


if (alphaClipProp.floatValue == 1)
m_MaterialEditor.ShaderProperty(alphaCutoffProp, Styles.alphaClipThresholdText, MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
EditorGUI.BeginChangeCheck();
bool receiveShadows = EditorGUILayout.Toggle(Styles.receiveShadowText, receiveShadowsProp.floatValue == 1.0f);
if (EditorGUI.EndChangeCheck())
receiveShadowsProp.floatValue = receiveShadows ? 1.0f : 0.0f;
if (receiveShadowsProp != null)
{
EditorGUI.BeginChangeCheck();
bool receiveShadows =
EditorGUILayout.Toggle(Styles.receiveShadowText, receiveShadowsProp.floatValue == 1.0f);
if (EditorGUI.EndChangeCheck())
receiveShadowsProp.floatValue = receiveShadows ? 1.0f : 0.0f;
}
EditorGUILayout.Space();
}

23
com.unity.render-pipelines.lightweight/LWRP/Shaders/LightweightStandardUnlit.shader


#else
half3 normalWS = normalize(IN.normal);
#endif
color += SAMPLE_GI(IN.lightmapUV, IN.vertexSH, normalWS);
color *= SAMPLE_GI(IN.lightmapUV, IN.vertexSH, normalWS);
#endif
ApplyFog(color, IN.uv0AndFogCoord.z);

#include "LWRP/ShaderLibrary/InputSurfaceUnlit.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassDepthOnly.hlsl"
ENDHLSL
}
// This pass it not used during regular rendering, only for lightmap baking.
Pass
{
Name "Meta"
Tags{"LightMode" = "Meta"}
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma vertex LightweightVertexMeta
#pragma fragment LightweightFragmentMetaUnlit
#include "LWRP/ShaderLibrary/InputSurfaceUnlit.hlsl"
#include "LWRP/ShaderLibrary/LightweightPassMetaUnlit.hlsl"
ENDHLSL
}
}

16
com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/LightweightPassMetaUnlit.hlsl


#ifndef LIGHTWEIGHT_PASS_META_SIMPLE_INCLUDED
#define LIGHTWEIGHT_PASS_META_SIMPLE_INCLUDED
#include "LightweightPassMetaCommon.hlsl"
half4 LightweightFragmentMetaUnlit(MetaVertexOuput i) : SV_Target
{
float2 uv = i.uv;
MetaInput o = (MetaInput)0;
o.Albedo = _Color.rgb * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv).rgb;
return MetaFragment(o);
}
#endif // LIGHTWEIGHT_PASS_META_SIMPLE_INCLUDED

9
com.unity.render-pipelines.lightweight/LWRP/ShaderLibrary/LightweightPassMetaUnlit.hlsl.meta


fileFormatVersion: 2
guid: 138efaf7fb432134da44d5a4981a62ad
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存