mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
3 textures blending fix for OpenGL.
This commit is contained in:
parent
7962eef7dd
commit
f3e737e001
3 changed files with 11 additions and 7 deletions
|
|
@ -32,10 +32,12 @@ float calcBlend( float texId, vec2 layerCoord, float layerSize, vec4 layerSample
|
|||
vec4 diff = clamp( abs( layerSample - texId ), 0.0, 1.0 );
|
||||
float noBlend = float(any( bvec4(1 - diff) ));
|
||||
|
||||
// Use step to see if any of the layer samples
|
||||
// match the current texture id.
|
||||
vec4 factors = step( texId, layerSample );
|
||||
|
||||
vec4 factors = vec4(0);
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(layerSample[i] == texId)
|
||||
factors[i] = 1;
|
||||
|
||||
// This is a custom bilinear filter.
|
||||
|
||||
vec2 uv = layerCoord * layerSize;
|
||||
|
|
|
|||
|
|
@ -32,10 +32,12 @@ float calcBlend( float texId, vec2 layerCoord, float layerSize, vec4 layerSample
|
|||
vec4 diff = clamp( abs( layerSample - texId ), 0.0, 1.0 );
|
||||
float noBlend = float(any( bvec4(1 - diff) ));
|
||||
|
||||
// Use step to see if any of the layer samples
|
||||
// match the current texture id.
|
||||
vec4 factors = step( texId, layerSample );
|
||||
|
||||
vec4 factors = vec4(0);
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(layerSample[i] == texId)
|
||||
factors[i] = 1;
|
||||
|
||||
// This is a custom bilinear filter.
|
||||
|
||||
vec2 uv = layerCoord * layerSize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue