Skip to content

Commit

Permalink
Moar optimization, moar speed
Browse files Browse the repository at this point in the history
  • Loading branch information
uis246 committed Nov 30, 2020
1 parent 745f7ba commit a3b10c7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cwd/assets/altcraft/shaders/vert/face.vs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ out VS_OUT {
flat vec3 Color;
} vs_out;

//Intel SNB: VS vec4 shader: 54 instructions. 0 loops. 194 cycles. 0:0 spills:fills, 1 sends. Compacted 864 to 848 bytes (2%)
//Intel SNB: VS vec4 shader: 53 instructions. 0 loops. 178 cycles. 0:0 spills:fills, 1 sends. Compacted 848 to 832 bytes (2%)

void main() {
gl_Position = projView * vec4(positions[gl_VertexID], 1.0);
Expand All @@ -44,14 +44,10 @@ void main() {
uvec4(qinfo, qinfo >> uint(5)) & uint(0x1F)
) * 0.0625 /* /16.0 */;

// tex.xy += subUV.xy * tex.zw;
// tex.zw = subUV.zw * tex.zw * uv;
// UvPosition = tex.xy + tex.zw;

UvPosition = tex.xy + subUV.xy*tex.zw + subUV.zw*tex.zw*uv;
UvPosition = tex.xy + tex.zw*(subUV.xy + uv*(subUV.zw-subUV.xy));
Layer = phlf.z;

vec2 light = vec2((qinfo >> uint(10)) & uint(0xF)) / 15.0;
vec2 light = vec2((qinfo >> uint(10)) & uint(0xF)) * (1 / 15.0);
vs_out.Light = clamp(light.x + (light.y * DayTime), MinLightLevel, 1.0);
vs_out.Color = vec3(0.275, 0.63, 0.1) * (qinfo.x>>14);
}

0 comments on commit a3b10c7

Please sign in to comment.