|
|
|
|
|
|
matMask |= mapMask; |
|
|
|
} |
|
|
|
|
|
|
|
void ApplyBlendDiffuse(inout float4 dst, inout int matMask, float2 texCoords, int sliceIndex, int mapMask, float blend, float lod) |
|
|
|
void ApplyBlendDiffuse(inout float4 dst, inout int matMask, float2 texCoords, int sliceIndex, int mapMask, inout float blend, float lod) |
|
|
|
blend = src.w; // diffuse texture alpha affects all other channels |
|
|
|
dst.xyz = src.xyz * src.w + dst.xyz * (1.0f - src.w); |
|
|
|
dst.w = dst.w * (1.0f - src.w); |
|
|
|
matMask |= mapMask; |
|
|
|
|
|
|
matMask |= mapMask; |
|
|
|
} |
|
|
|
|
|
|
|
void AddDecalContribution(PositionInputs posInput, inout SurfaceData surfaceData) |
|
|
|
void AddDecalContribution(PositionInputs posInput, inout SurfaceData surfaceData, inout float alpha) |
|
|
|
{ |
|
|
|
if(_EnableDBuffer) |
|
|
|
{ |
|
|
|
|
|
|
if(diffuseIndex != -1) |
|
|
|
{ |
|
|
|
ApplyBlendDiffuse(DBuffer0, mask, positionDS.xz, diffuseIndex, DBUFFERHTILEBIT_DIFFUSE, decalBlend, lod); |
|
|
|
alpha = alpha < decalBlend ? decalBlend : alpha; // use decal alpha if it higher than transparent alpha |
|
|
|
} |
|
|
|
|
|
|
|
if(normalIndex != -1) |
|
|
|