add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
11
gamedata/shaders/shared/cloudconfig.h
Normal file
11
gamedata/shaders/shared/cloudconfig.h
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
|
||||
11
gamedata/shaders/shared/cloudconfig.hlsli
Normal file
11
gamedata/shaders/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
|
||||
48
gamedata/shaders/shared/common.h
Normal file
48
gamedata/shaders/shared/common.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#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 half4 timers;
|
||||
uniform half4 fog_plane;
|
||||
uniform float4 fog_params; // x=near*(1/(far-near)), ?,?, w = -1/(far-near)
|
||||
uniform half4 fog_color;
|
||||
uniform half3 L_sun_color;
|
||||
uniform half3 L_sun_dir_w;
|
||||
uniform half3 L_sun_dir_e;
|
||||
uniform half4 L_hemi_color;
|
||||
uniform half4 L_ambient; // L_ambient.w = skynbox-lerp-factor
|
||||
uniform float3 eye_position;
|
||||
uniform half3 eye_direction;
|
||||
uniform half3 eye_normal;
|
||||
uniform half4 dt_params;
|
||||
|
||||
half3 unpack_normal (half3 v) { return 2*v-1; }
|
||||
half3 unpack_bx2 (half3 v) { return 2*v-1; }
|
||||
half3 unpack_bx4 (half3 v) { return 4*v-2; }
|
||||
|
||||
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 phase = 1/(2*3.141592653589f);
|
||||
float sqrt2 = 1.4142136f;
|
||||
float sqrt2m2 = 2.8284271f;
|
||||
float f = sqrt2m2*frac(x)-sqrt2; // [-sqrt2 .. +sqrt2]
|
||||
return f*f - 1.f; // [-1 .. +1]
|
||||
}
|
||||
float2 calc_xz_wave (float2 dir2D, float frac) {
|
||||
// Beizer
|
||||
float2 ctrl_A = float2(0.f, 0.f );
|
||||
float2 ctrl_B = float2(dir2D.x, dir2D.y );
|
||||
return lerp (ctrl_A, ctrl_B, frac);
|
||||
}
|
||||
|
||||
#endif
|
||||
58
gamedata/shaders/shared/common.hlsli
Normal file
58
gamedata/shaders/shared/common.hlsli
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#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;
|
||||
|
||||
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
|
||||
56
gamedata/shaders/shared/waterconfig.h
Normal file
56
gamedata/shaders/shared/waterconfig.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#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)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
55
gamedata/shaders/shared/waterconfig.hlsli
Normal file
55
gamedata/shaders/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)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
*/
|
||||
26
gamedata/shaders/shared/watermove.h
Normal file
26
gamedata/shaders/shared/watermove.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#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
|
||||
30
gamedata/shaders/shared/watermove.hlsli
Normal file
30
gamedata/shaders/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
|
||||
22
gamedata/shaders/shared/wmark.h
Normal file
22
gamedata/shaders/shared/wmark.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef WMARK_H
|
||||
#define WMARK_H
|
||||
#include "common.h"
|
||||
|
||||
#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
|
||||
24
gamedata/shaders/shared/wmark.hlsli
Normal file
24
gamedata/shaders/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