Files
XCEngine/engine/assets/builtin/shaders/forward-lit/forward-lit.shader

38 lines
1.6 KiB
Plaintext
Raw Normal View History

Shader "Builtin Forward Lit"
{
Properties
{
_BaseColor ("Base Color", Color) = (1,1,1,1) [Semantic(BaseColor)]
_Cutoff ("Alpha Cutoff", Range) = 0.5 [Semantic(AlphaCutoff)]
_MainTex ("Base Map", 2D) = "white" [Semantic(BaseColorTexture)]
}
SubShader
{
Pass
{
Name "ForwardLit"
Tags { "LightMode" = "ForwardBase" }
Resources
{
PerObjectConstants (ConstantBuffer, 0, 0) [Semantic(PerObject)]
2026-04-05 15:44:37 +08:00
LightingConstants (ConstantBuffer, 1, 0) [Semantic(Lighting)]
MaterialConstants (ConstantBuffer, 2, 0) [Semantic(Material)]
ShadowReceiverConstants (ConstantBuffer, 3, 0) [Semantic(ShadowReceiver)]
BaseColorTexture (Texture2D, 4, 0) [Semantic(BaseColorTexture)]
LinearClampSampler (Sampler, 5, 0) [Semantic(LinearClampSampler)]
ShadowMapTexture (Texture2D, 6, 0) [Semantic(ShadowMapTexture)]
ShadowMapSampler (Sampler, 7, 0) [Semantic(ShadowMapSampler)]
}
HLSLPROGRAM
#pragma vertex MainVS
#pragma fragment MainPS
#pragma multi_compile _ XC_MAIN_LIGHT_SHADOWS
#pragma shader_feature_local _ XC_ALPHA_TEST
#pragma backend D3D12 HLSL "forward-lit.vs.hlsl" "forward-lit.ps.hlsl" vs_5_0 ps_5_0
#pragma backend OpenGL GLSL "forward-lit.vert.glsl" "forward-lit.frag.glsl"
#pragma backend Vulkan GLSL "forward-lit.vert.vk.glsl" "forward-lit.frag.vk.glsl"
ENDHLSL
}
}
}