mirror of https://github.com/teverse/teverse
Compare commits
3 Commits
85dd40e95a
...
f4e0ae6139
Author | SHA1 | Date |
---|---|---|
Jay | f4e0ae6139 | |
Jay | 6876f15b5c | |
Jay | 498cb68083 |
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue