Merge pull request #710 from lukaspj/3-Textures-Blending-Fix

3 textures blending fix
This commit is contained in:
Daniel Buckmaster 2014-11-04 17:06:04 +11:00
commit 9e4446046f
4 changed files with 15 additions and 6 deletions

View file

@ -32,9 +32,12 @@ float calcBlend( float texId, float2 layerCoord, float layerSize, float4 layerSa
float4 diff = saturate( abs( layerSample - texId ) );
float noBlend = any( 1 - diff );
// Use step to see if any of the layer samples
// Check if any of the layer samples
// match the current texture id.
float4 factors = step( texId, layerSample );
float4 factors = 0;
for(int i = 0; i < 4; i++)
if(layerSample[i] == texId)
factors[i] = 1;
// This is a custom bilinear filter.

View file

@ -32,9 +32,12 @@ float calcBlend( float texId, float2 layerCoord, float layerSize, float4 layerSa
float4 diff = saturate( abs( layerSample - texId ) );
float noBlend = any( 1 - diff );
// Use step to see if any of the layer samples
// Check if any of the layer samples
// match the current texture id.
float4 factors = step( texId, layerSample );
float4 factors = 0;
for(int i = 0; i < 4; i++)
if(layerSample[i] == texId)
factors[i] = 1;
// This is a custom bilinear filter.