mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Doing a hard compare instead of using step for blending factors
This commit is contained in:
parent
9612d3c290
commit
53f241974b
2 changed files with 10 additions and 4 deletions
|
|
@ -32,9 +32,12 @@ float calcBlend( float texId, float2 layerCoord, float layerSize, float4 layerSa
|
||||||
float4 diff = saturate( abs( layerSample - texId ) );
|
float4 diff = saturate( abs( layerSample - texId ) );
|
||||||
float noBlend = any( 1 - diff );
|
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.
|
// 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.
|
// This is a custom bilinear filter.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,12 @@ float calcBlend( float texId, float2 layerCoord, float layerSize, float4 layerSa
|
||||||
float4 diff = saturate( abs( layerSample - texId ) );
|
float4 diff = saturate( abs( layerSample - texId ) );
|
||||||
float noBlend = any( 1 - diff );
|
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.
|
// 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.
|
// This is a custom bilinear filter.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue