Skip to content

Instantly share code, notes, and snippets.

@cabbibo
Created October 4, 2018 16:31
Show Gist options
  • Save cabbibo/7d3b53bead7fd4bceb6c2e745fe6a632 to your computer and use it in GitHub Desktop.
Save cabbibo/7d3b53bead7fd4bceb6c2e745fe6a632 to your computer and use it in GitHub Desktop.
Properties {
[Toggle(Enable16Struct)] _Struct16("16 Struct", Float) = 0
[Toggle(Enable24Struct)] _Struct24("24 Struct", Float) = 0
[Toggle(Enable36Struct)] _Struct36("36 Struct", Float) = 0
}
#pragma multi_compile __ Enable16Struct
#pragma multi_compile __ Enable24Struct
#pragma multi_compile __ Enable36Struct
#if defined(Enable16Struct) || defined(Enable24Struct) || defined(Enable36Struct)
#ifdef Enable16Struct
struct Vert{
float3 pos;
float3 vel;
float3 nor;
float3 tan;
float2 uv;
float2 debug;
};
#endif
#ifdef Enable24Struct
struct Vert{
float3 pos;
float3 vel;
float3 nor;
float3 tang;
float2 uv;
float used;
float3 triIDs;
float3 triWeights;
float3 debug;
};
#endif
#ifdef Enable36Struct
struct Vert{
float3 pos;
float3 vel;
float3 nor;
float3 tang;
float2 uv;
float used;
float3 targetPos;
float3 bindPos;
float3 bindNor;
float3 bindTan;
float4 boneWeights;
float4 boneIDs;
float debug;
};
#endif
#else
struct Vert{
float3 pos;
float3 vel;
float3 nor;
float3 tan;
float2 uv;
float2 debug;
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment