-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenGL shaders: implemented 'model_distort4ghost.vs'
- Loading branch information
1 parent
5fe2032
commit b565539
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |