Skip to content

Commit

Permalink
OpenGL shaders: implemented 'model_distort4ghost.vs'
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyLoaderr authored and Xottab-DUTY committed Nov 17, 2019
1 parent 5fe2032 commit b565539
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions res/gamedata/shaders/gl/model_distort4ghost.vs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "common.h"
#include "skin.h"
#include "iostructs\v_model_distort.h"

vf _main (v_model v)
{
vf o;

o.hpos = mul (m_WVP, v.P); // xform, input in world coords
o.tc0 = v.tc.xy; // copy tc

// calculate fade
float3 dir_v = normalize (mul(m_WV,v.P));
float3 norm_v = normalize (mul(m_WV,v.N));
float fade = 1.3*(1.0 - abs (dot(dir_v,norm_v)));
o.c0 = float4 (fade);

return o;
}

0 comments on commit b565539

Please sign in to comment.