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()
|
|
|
|
{
|
2020-12-28 22:24:49 +03:00
|
|
|
#if BGFX_SHADER_LANGUAGE_HLSL && (BGFX_SHADER_LANGUAGE_HLSL < 400)
|
2016-07-25 02:07:09 +03:00
|
|
|
vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy + u_viewTexel.xy * vec2_splat(0.5);
|
2016-07-25 01:39:50 +03:00
|
|
|
#else
|
2016-07-25 02:07:09 +03:00
|
|
|
vec2 texCoord = gl_FragCoord.xy * u_viewTexel.xy;
|
2016-07-25 01:39:50 +03:00
|
|
|
#endif
|
|
|
|
|
2016-07-25 02:07:09 +03:00
|
|
|
gl_FragData[0].xyz = u_tint.xyz; // Color of light sphere
|
|
|
|
gl_FragData[0].w = -v_normal.z; // Radius of light sphere
|
2016-07-25 01:39:50 +03:00
|
|
|
}
|