Skip to content

Commit

Permalink
[loved] Fixed formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Mar 14, 2017
1 parent 365d5b0 commit a810a8d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions spine-love/spine-love/spine.lua
Expand Up @@ -93,26 +93,26 @@ function PolygonBatcher.new(vertexCount, useTwoColorTint)
{"VertexColor2", "byte", 4} -- The r,g,b,a dark color of each vertex.
}
local vertexcode = [[
attribute vec4 VertexColor2;
varying vec4 color2;
vec4 position(mat4 transform_projection, vec4 vertex_position) {
color2 = VertexColor2;
return transform_projection * vertex_position;
}
attribute vec4 VertexColor2;
varying vec4 color2;
vec4 position(mat4 transform_projection, vec4 vertex_position) {
color2 = VertexColor2;
return transform_projection * vertex_position;
}
]]

local pixelcode = [[
varying vec4 color2;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) {
vec4 texColor = Texel(texture, texture_coords);
float alpha = texColor.a * color.a;
vec4 outputColor;
outputColor.a = alpha;
outputColor.rgb = (1.0 - texColor.rgb) * color2.rgb * alpha + texColor.rgb * color.rgb;
return outputColor;
}
varying vec4 color2;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) {
vec4 texColor = Texel(texture, texture_coords);
float alpha = texColor.a * color.a;
vec4 outputColor;
outputColor.a = alpha;
outputColor.rgb = (1.0 - texColor.rgb) * color2.rgb * alpha + texColor.rgb * color.rgb;
return outputColor;
}
]]

twoColorTintShader = love.graphics.newShader(pixelcode, vertexcode)
Expand Down

0 comments on commit a810a8d

Please sign in to comment.