Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: static branching instead of macros #109

Merged
merged 17 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions package/Shaders/Common/Permutation.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@


#define _Glowmap 2
#define _Hair 6

// LightingShaderFlags
#define _VC (1 << 0)
#define _Skinned (1 << 1)
#define _ModelSpaceNormals (1 << 2)
// flags 3 to 8 are unused
#define _Specular (1 << 9)
#define _SoftLighting (1 << 10)
#define _RimLighting (1 << 11)
#define _BackLighting (1 << 12)
#define _ShadowDir (1 << 13)
#define _DefShadow (1 << 14)
#define _ProjectedUV (1 << 15)
// (HAIR technique only)
#define _DepthWriteDecals (1 << 15)
#define _AnisoLighting (1 << 16)
#define _AmbientSpecular (1 << 17)
#define _WorldMap (1 << 18)
#define _BaseObjectIsSnow (1 << 19)
#define _DoAlphaTest (1 << 20)
#define _Snow (1 << 21)
#define _CharacterLight (1 << 22)
#define _AdditionalAlphaMask (1 << 23)

#define _NormalTexCoord (1 << 1)
#define _Reflections (1 << 2)
#define _Refractions (1 << 3)
#define _Depth (1 << 4)
#define _Interior (1 << 5)
#define _Wading (1 << 6)
#define _VertexAlphaDepth (1 << 7)
#define _Cubemap (1 << 8)
#define _Flowmap (1 << 9)
#define _BlendNormals (1 << 10)

struct PerShader
{
uint VertexShaderDescriptor;
uint PixelShaderDescriptor;
};

StructuredBuffer<PerShader> shaderDescriptors : register(t127);
Loading