2016-07-25 01:39:50 +03:00
|
|
|
$input v_normal
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2016 Joseph Cherlin. All rights reserved.
|
|
|
|
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../common/common.sh"
|
|
|
|
|
|
|
|
uniform vec4 u_tint;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2016-07-25 02:07:09 +03:00
|
|
|
vec3 normalWorldSpace = v_normal;
|
2016-07-25 01:39:50 +03:00
|
|
|
|
2016-07-25 02:07:09 +03:00
|
|
|
// Write normal
|
|
|
|
gl_FragData[0].xyz = normalWorldSpace.xyz; // Normal is already compressed to [0,1] so can fit in gbuffer
|
|
|
|
gl_FragData[0].w = 0.0;
|
2016-07-25 01:39:50 +03:00
|
|
|
|
2016-07-25 02:07:09 +03:00
|
|
|
// Write color
|
|
|
|
gl_FragData[1] = u_tint;
|
2016-07-25 01:39:50 +03:00
|
|
|
}
|