mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-28 23:02:07 +00:00
Add alpha testing for TraceFirstHitTriangle
This commit is contained in:
parent
2fdad6e380
commit
f9fb9056f6
1 changed files with 7 additions and 1 deletions
|
@ -520,9 +520,15 @@ int TraceFirstHitTriangleT(vec3 origin, float tmin, vec3 dir, float tmax, out fl
|
|||
SurfaceInfo surface = surfaces[surfaceIndices[primitiveID]];
|
||||
|
||||
if(surface.PortalIndex == 0)
|
||||
{
|
||||
int index = primitiveID * 3;
|
||||
vec2 uv = vertices[elements[index + 0]].uv * primitiveWeights.x + vertices[elements[index + 1]].uv * primitiveWeights.y + vertices[elements[index + 2]].uv * primitiveWeights.z;
|
||||
|
||||
if (texture(textures[surface.TextureIndex], uv).w > 0.9)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Portal was hit: Apply transformation onto the ray
|
||||
mat4 transformationMatrix = portals[surface.PortalIndex].Transformation;
|
||||
|
|
Loading…
Reference in a new issue