|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
void ComputeMaskWeights(float4 inputMasks, out float outWeights[_MAX_LAYER]) |
|
|
|
void ComputeMaskWeights(float3 inputMasks, out float outWeights[_MAX_LAYER]) |
|
|
|
masks[0] = inputMasks.r; |
|
|
|
masks[1] = inputMasks.g; |
|
|
|
masks[2] = inputMasks.b; |
|
|
|
masks[3] = inputMasks.a; |
|
|
|
masks[0] = 1.0f; // Layer 0 is always full |
|
|
|
masks[1] = inputMasks.r; |
|
|
|
masks[2] = inputMasks.g; |
|
|
|
masks[3] = inputMasks.b; |
|
|
|
|
|
|
|
// calculate weight of each layers |
|
|
|
float left = 1.0f; |
|
|
|
|
|
|
|
|
|
|
void GetSurfaceAndBuiltinData(FragInput input, out SurfaceData surfaceData, out BuiltinData builtinData) |
|
|
|
{ |
|
|
|
float4 maskValues = float4(1.0, 0.0, 0.0, 0.0);// input.vertexColor; |
|
|
|
// Mask Values : Layer 1, 2, 3 are r, g, b |
|
|
|
float3 maskValues = float3(0.0, 0.0, 0.0);// input.vertexColor; |
|
|
|
float4 maskMap = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0); |
|
|
|
maskValues = maskMap; |
|
|
|
maskValues = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0).rgb; |
|
|
|
#endif |
|
|
|
|
|
|
|
float weights[_MAX_LAYER]; |
|
|
|