Talk:BLS
Jump to navigation
Jump to search
Permutations reverse engineered for vertex md2 Diffuse_T1
Based on Legion 21062 build
Additives 16 and 8 are mutually exclusive, only one of these values should be counted in final permutation number
Full formula to get right permutation number: 48*disableFog + 24*enableShadowBand + 16*enableBoneAndFullMatr + 8*enableBone + flags
Fun fact, it seems, that even though 48 and 24 can be added together, they are mutually exclusive too. Thus these pairs of permutations are equal (48, 72), (49, 73)... up to (71, 95)
Additive
48 - disable fog
- Disables out_fog from shader
24 - enable Shadowband
- Enables vec4 vc_shadowBandMtx0[3]; in shader uniform buffer
- Enables out float out_fog; as shader output
- Position in such shaders is called shadowPos. Probably these are used for rendering shadows
16 - enable bone and full bone matrix construct
- Enables vec4 in_boneWeights; input attribute
- Enables uvec4 in_boneIndices; input attribute
- If flag 1 is enabled - also enables in_boneOffset; input attribute, which is used as index into vc_worldView to get view matrix. Also (1 + in_boneOffset) is added to in_boneIndices before getting vc_worldView[in_boneIndices]
- 4 in_boneWeights are multiplied by 4 vc_worldView[in_boneIndices] and added together to form world matrix for bone
8 - enable bone
- Enables vec4 in_boneWeights; input attribute
- Enables uvec4 in_boneIndices; input attribute
- If flag 1 is enabled - also enables in_boneOffset; input attribute, which is used as index into vc_worldView to get view matrix. Also (1 + in_boneOffset) is added to in_boneIndices before getting vc_worldView[in_boneIndices]
- Does same as additive 16, but discards values of in_boneWeights and uses only first vc_worldView[in_boneIndices.x] as world matrix for bone
Flags
1 - disable View matrix
- Disables mat3x4 vc_viewMatrix in shader input
2 - enable clip plane
- Enables vec4 vc_clipPlane in uniform buffer
- Enables float out_clipDist as shader output
4 - Disable clamp between vc_matDiffuse and vc_matEmissive
- Disables vec4 vc_matEmissive; in uniform buffer
- Use vc_matDiffuse as color instead clamp((vc_matDiffuse + vc_matEmissive), 0, 1);