Exemple #1
0
    private bool DepthTest(Vector3 point, int x, int y)
    {
        if (!APIContext.states.depthTest)
        {
            return(true);
        }

        APITextureBuffer depthBuffer = APIContext.frameBufferManager.frameBufferTarget.depthBuffer;
        float            depth       = point.z;

        if (APIMath.Tex2D(depthBuffer, point).r <= depth)
        {
            depthBuffer.SetPixel(x, y, Color.red * depth);

            return(true);
        }

        return(false);
    }
    public override Color Fragment(VertData i)
    {
        float att = Vector3.Dot(i.normal, new Vector3(0, -1f, 0));

        return(att * APIMath.Tex2D(mainTexture, i.uv));
    }