matiasah / shadows

Shädows - A Shadows & Lights engine for löve
MIT License
169 stars 9 forks source link

Issue in ShapeShader (need float constants for GLES) #17

Closed Sungray closed 7 years ago

Sungray commented 7 years ago
Shadows.ShapeShader = love.graphics.newShader [[

    vec4 effect(vec4 Color, Image Texture, vec2 textureCoord, vec2 pixelCoord) {

        vec4 pixel = Texel(Texture, textureCoord);

        if ( pixel.a > 0 ) {

            if ( pixel.r > 0 || pixel.g > 0 || pixel.b > 0 ) {

                return Color;

            }

        }

        return vec4(0.0, 0.0, 0.0, 0.0);

    }

]]

0 should be 0.0 :

Shadows.ShapeShader = love.graphics.newShader [[

    vec4 effect(vec4 Color, Image Texture, vec2 textureCoord, vec2 pixelCoord) {

        vec4 pixel = Texel(Texture, textureCoord);

        if ( pixel.a > 0.0 ) {

            if ( pixel.r > 0.0 || pixel.g > 0.0 || pixel.b > 0.0 ) {

                return Color;

            }

        }

        return vec4(0.0, 0.0, 0.0, 0.0);

    }

]]
matiasah commented 7 years ago

You could perhaps open a pull request next time, but thank you anyway!

matiasah commented 7 years ago

Fixed in ad9e0a0

Sungray commented 7 years ago

Will do, not used to GitHub ! :)