Compare commits

...

3 Commits

Author SHA1 Message Date
Jay f4e0ae6139 Merge branch 'master' of https://github.com/teverse/teverse 2020-05-16 17:47:19 +01:00
Jay 6876f15b5c shader 2020-05-16 17:47:15 +01:00
Jay 498cb68083 Shader update 2020-05-16 11:06:31 +01:00
2 changed files with 3 additions and 18 deletions

View File

@ -8,22 +8,5 @@ uniform vec4 u_camPos;
void main()
{
float roughness = v_color1.y;
float metalness = v_color1.x;
GBufferData buffer;
buffer.base_color = v_color0.xyz;
buffer.ambient_occlusion = 11.0;
buffer.world_normal = v_normal.xyz;
buffer.roughness = roughness;
buffer.emissive_color = vec3(0.0, 0.0, 0.0);
buffer.metalness = metalness;
buffer.subsurface_color = vec3(1.0, 1.0, 1.0);
buffer.subsurface_opacity = 0.0;
vec4 result[3];
encodeGBuffer(buffer, result);
gl_FragData[0] = result[0];
gl_FragData[1] = result[1];
gl_FragData[2] = result[2];
gl_FragColor = vec4(encodeNormalUint(v_normal), 0.0);
}

View File

@ -29,6 +29,8 @@ void main()
vec4 tangent = a_tangent * 2.0 - 1.0;
vec3 wnormal = normalize(mul(modelIT, normal.xyz ));
wnormal = instMul(model, vec4(wnormal, 1.0) ).xyz;
vec3 wtangent = normalize(mul(modelIT, tangent.xyz ));
vec3 view = mul(u_view, vec4(wpos, 0.0) ).xyz;