init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
24
gamedata/shaders/r2/shared/wmark.hlsli
Normal file
24
gamedata/shaders/r2/shared/wmark.hlsli
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef WMARK_H
|
||||
#define WMARK_H
|
||||
|
||||
#include "common.hlsli"
|
||||
|
||||
#define NORMAL_SHIFT 0.007f
|
||||
#define MIN_SHIFT 0.003f
|
||||
#define MAX_SHIFT 0.011f
|
||||
#define RANGE 100.f
|
||||
|
||||
float4 wmark_shift(float3 pos, float3 norm)
|
||||
{
|
||||
float3 P = pos;
|
||||
float3 N = norm;
|
||||
float3 sd = eye_position - P;
|
||||
float d = length(sd);
|
||||
float w = min(d / RANGE, 1.f);
|
||||
float s = lerp(MIN_SHIFT, MAX_SHIFT, d);
|
||||
P += N.xyz * NORMAL_SHIFT;
|
||||
P -= normalize(eye_direction + normalize(P - eye_position)) * s;
|
||||
return float4(P, 1.f);
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue