|
|
|
|
|
|
{ |
|
|
|
float3 result = float3(0.0, 0.0, 0.0); |
|
|
|
|
|
|
|
result = rgb0 * weight[0] + rgb1 * weight[1]; |
|
|
|
result = rgb0 * weight[0] + rgb1 * weight[1]; |
|
|
|
#if _LAYER_COUNT >= 3 |
|
|
|
result += (rgb2 * weight[2]); |
|
|
|
#endif |
|
|
|
|
|
|
// calculate weight of each layers |
|
|
|
float left = 1.0f; |
|
|
|
|
|
|
|
// ATTRIBUTE_UNROLL |
|
|
|
[unroll] |
|
|
|
for (int i = _LAYER_COUNT - 1; i > 0; --i) |
|
|
|
{ |
|
|
|
outWeights[i] = masks[i] * left; |
|
|
|
|
|
|
|
|
|
|
void GetSurfaceAndBuiltinData(FragInput input, out SurfaceData surfaceData, out BuiltinData builtinData) |
|
|
|
{ |
|
|
|
float4 maskValues = float4(1.0, 1.0, 1.0, 1.0);// input.vertexColor; |
|
|
|
float4 maskValues = float4(1.0, 0.0, 0.0, 0.0);// input.vertexColor; |
|
|
|
float4 maskMap = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0); |
|
|
|
maskValues *= maskMap; |
|
|
|
float4 maskMap = SAMPLE_TEXTURE2D(_LayerMaskMap, sampler_LayerMaskMap, input.texCoord0); |
|
|
|
maskValues = maskMap; |
|
|
|
#endif |
|
|
|
|
|
|
|
float weights[_MAX_LAYER]; |
|
|
|