bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc

24 lines
545 B
Python
Raw Normal View History

$input a_position
/*
2014-01-13 17:45:18 -05:00
* Copyright 2013-2014 Dario Manesku. All rights reserved.
2016-01-01 03:11:04 -05:00
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
uniform vec4 u_virtualLightPos_extrusionDist;
#define u_virtualLightPos u_virtualLightPos_extrusionDist.xyz
#define u_extrusionDistance u_virtualLightPos_extrusionDist.w
void main()
{
vec3 pos = a_position;
vec3 toLight = pos - u_virtualLightPos;
pos += normalize(toLight) * u_extrusionDistance;
gl_Position = mul(u_modelViewProj, vec4(pos, 1.0));
}