init
This commit is contained in:
commit
2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions
11
gamedata/shaders/r1/shared/cloudconfig.hlsli
Normal file
11
gamedata/shaders/r1/shared/cloudconfig.hlsli
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef _CLOUDCONFIG_H
|
||||
#define _CLOUDCONFIG_H
|
||||
|
||||
// note: timers has resolution (sec), where x=1, y=10, z=1/10,
|
||||
#define CLOUD_TILE0 (0.7f)
|
||||
#define CLOUD_SPEED0 (2 * 0.05) //(0.033f)
|
||||
#define CLOUD_TILE1 (2.8) //(2.5f)
|
||||
#define CLOUD_SPEED1 (2 * 0.025) //(0.033f)
|
||||
#define CLOUD_FADE (0.5)
|
||||
|
||||
#endif
|
||||
69
gamedata/shaders/r1/shared/common.hlsli
Normal file
69
gamedata/shaders/r1/shared/common.hlsli
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef SHARED_COMMON_H
|
||||
#define SHARED_COMMON_H
|
||||
|
||||
uniform float3x4 m_W;
|
||||
uniform float3x4 m_V;
|
||||
uniform float4x4 m_P;
|
||||
uniform float3x4 m_WV;
|
||||
uniform float4x4 m_VP;
|
||||
uniform float4x4 m_WVP;
|
||||
uniform float4 timers;
|
||||
uniform float4 fog_plane;
|
||||
uniform float4 fog_params; // x=near*(1/(far-near)), ?,?, w = -1/(far-near)
|
||||
uniform float4 fog_color;
|
||||
uniform float3 L_sun_color;
|
||||
uniform float3 L_sun_dir_w;
|
||||
uniform float3 L_sun_dir_e;
|
||||
uniform float4 L_hemi_color;
|
||||
uniform float4 L_ambient; // L_ambient.w = skynbox-lerp-factor
|
||||
uniform float3 eye_position;
|
||||
uniform float3 eye_direction;
|
||||
uniform float3 eye_normal;
|
||||
uniform float4 dt_params;
|
||||
|
||||
//GUNSLINGER**************************//
|
||||
uniform float4 m_hud_params;
|
||||
//uniform float4 screen_res;
|
||||
uniform float4 m_zoom_deviation;
|
||||
uniform float4 m_actor_params;
|
||||
uniform float4 m_affects;
|
||||
uniform float4 m_timearrow;
|
||||
uniform float4 m_timearrow2;
|
||||
uniform float4 m_digiclock;
|
||||
//************************************//
|
||||
|
||||
float3 unpack_normal(float3 v)
|
||||
{
|
||||
return 2.0f * v - 1.0f;
|
||||
}
|
||||
float3 unpack_bx2(float3 v)
|
||||
{
|
||||
return 2.0f * v - 1.0f;
|
||||
}
|
||||
float3 unpack_bx4(float3 v)
|
||||
{
|
||||
return 4.0f * v - 2.0f;
|
||||
}
|
||||
|
||||
float2 unpack_tc_base(float2 tc, float du, float dv)
|
||||
{
|
||||
return (tc.xy + float2(du, dv)) * (32.f / 32768.f);
|
||||
}
|
||||
|
||||
float2 unpack_tc_lmap(float2 tc)
|
||||
{
|
||||
return tc * (1.f / 32768.f);
|
||||
} // [-1 .. +1 ]
|
||||
|
||||
float calc_cyclic(float x)
|
||||
{
|
||||
float f = 1.4142f * sin(x * 3.14159f);
|
||||
return f * f - 1.0f;
|
||||
}
|
||||
|
||||
float2 calc_xz_wave(float2 dir2D, float frac)
|
||||
{
|
||||
return dir2D * frac;
|
||||
}
|
||||
|
||||
#endif
|
||||
55
gamedata/shaders/r1/shared/waterconfig.hlsli
Normal file
55
gamedata/shaders/r1/shared/waterconfig.hlsli
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef _WATERCONFIG_H
|
||||
#define _WATERCONFIG_H
|
||||
|
||||
// настройки для: (1)
|
||||
// waterdistortion
|
||||
// waterdistortion2
|
||||
|
||||
#define W_POSITION_SHIFT_HEIGHT (1.f / 60.f) //(1.f/100.f) //amplitude /50 - small, /10 - large
|
||||
#define W_POSITION_SHIFT_SPEED (25.f) //(25.0f)
|
||||
#define W_DISTORT_BASE_TILE_0 (1.0f) //(1.0f)
|
||||
#define W_DISTORT_BASE_TILE_1 (1.1f) //(1.1f)
|
||||
#define W_DISTORT_AMP_0 (+0.15f) //(+0.15f)
|
||||
#define W_DISTORT_AMP_1 (+0.55f) //(-0.30f)
|
||||
#define W_DISTORT_POWER (1.0f) //(1.0f)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
-- waters clear
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
настройки для:
|
||||
waterdistortion
|
||||
waterdistortion2
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define W_POSITION_SHIFT_HEIGHT (1.f/50.f) //(1.f/100.f) //amplitude /50 - small, /10 - large
|
||||
#define W_POSITION_SHIFT_SPEED (15.f) //(25.0f)
|
||||
#define W_DISTORT_BASE_TILE_0 (1.3f) //(1.6f)
|
||||
#define W_DISTORT_BASE_TILE_1 (2.3f) //(1.1f)
|
||||
#define W_DISTORT_AMP_0 (+0.35f) //(+0.15f)
|
||||
#define W_DISTORT_AMP_1 (-1.75f) //(-0.30f)
|
||||
#define W_DISTORT_POWER (1.0f) //(1.0f)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
настройки для:
|
||||
waterdistortion
|
||||
waterdistortion
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define W_POSITION_SHIFT_HEIGHT (1.f/80.f) //(1.f/100.f) //amplitude /50 - small, /10 - large
|
||||
#define W_POSITION_SHIFT_SPEED (20.f) //(25.0f)
|
||||
#define W_DISTORT_BASE_TILE_0 (1.6f) //(1.6f)
|
||||
#define W_DISTORT_BASE_TILE_1 (1.1f) //(1.1f)
|
||||
#define W_DISTORT_AMP_0 (+0.15f) //(+0.15f)
|
||||
#define W_DISTORT_AMP_1 (-0.30f) //(-0.30f)
|
||||
#define W_DISTORT_POWER (6.0f) //(6.0f)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
-- waters mulyaka
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#define W_POSITION_SHIFT_HEIGHT (1.f/50.f) // amplitude /50 - small, /10 - large
|
||||
#define W_POSITION_SHIFT_SPEED (25.f)
|
||||
#define W_DISTORT_BASE_TILE (0.1f) //(1.0f)
|
||||
#define W_DISTORT_AMP_0 (+0.58f) //(-0.08f)
|
||||
#define W_DISTORT_AMP_1 (+0.38f) //(+0.18f)
|
||||
#define W_DISTORT_POWER (3.0f) //(2.0f)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
30
gamedata/shaders/r1/shared/watermove.hlsli
Normal file
30
gamedata/shaders/r1/shared/watermove.hlsli
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef _WATERMOVE_H
|
||||
#define _WATERMOVE_H
|
||||
|
||||
float4 watermove(float4 P)
|
||||
{
|
||||
float3 wave1 = float3(0.11f, 0.13f, 0.07f) * W_POSITION_SHIFT_SPEED;
|
||||
float dh = sin(timers.x + dot((float3)P, wave1));
|
||||
P.y += dh * W_POSITION_SHIFT_HEIGHT;
|
||||
return P;
|
||||
}
|
||||
|
||||
float2 watermove_tc(float2 base, float2 P, float amp)
|
||||
{
|
||||
float2 wave1 = float2(0.2111f, 0.2333f) * amp;
|
||||
float angle = timers.z + dot(P, wave1);
|
||||
float du = sin(angle);
|
||||
float dv = cos(angle);
|
||||
return (base + amp * float2(du, dv));
|
||||
}
|
||||
|
||||
float3 waterrefl(out float amount, float3 P, float3 N)
|
||||
{
|
||||
float3 v2point = normalize(P - eye_position);
|
||||
float3 vreflect = reflect(v2point, N);
|
||||
float fresnel = (.5f + .5f * dot(vreflect, v2point));
|
||||
amount = 1 - fresnel * fresnel; // 0=full env, 1=no env
|
||||
return vreflect;
|
||||
}
|
||||
|
||||
#endif
|
||||
23
gamedata/shaders/r1/shared/wmark.hlsli
Normal file
23
gamedata/shaders/r1/shared/wmark.hlsli
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#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