Platform: Added example model into test_dlights.
This commit is contained in:
parent
11d52abec3
commit
9245ae809b
17 changed files with 9134 additions and 12 deletions
|
@ -171,7 +171,7 @@ varying vec3 lightvector;
|
||||||
/* take existing specular map into account to appoint a new glossy light */
|
/* take existing specular map into account to appoint a new glossy light */
|
||||||
#ifdef SPECULAR
|
#ifdef SPECULAR
|
||||||
vec3 halfdir = normalize(normalize(eyevector) + nl);
|
vec3 halfdir = normalize(normalize(eyevector) + nl);
|
||||||
float spec = pow(max(dot(halfdir, normal_f), 0.0), FTE_SPECULAR_EXPONENT * gloss) * float(SPECMUL);
|
float spec = pow(max(dot(halfdir, normal_f), 0.0), gloss);
|
||||||
diff += l_lightcolourscale.z * spec * specrgb;
|
diff += l_lightcolourscale.z * spec * specrgb;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,23 @@ varying mat3 invsurface;
|
||||||
|
|
||||||
#ifdef VERTEX_SHADER
|
#ifdef VERTEX_SHADER
|
||||||
#include "sys/skeletal.h"
|
#include "sys/skeletal.h"
|
||||||
|
|
||||||
|
#ifdef CHROME
|
||||||
|
/* Rotate Light Vector */
|
||||||
|
vec3 rlv(vec3 axis, vec3 origin, vec3 lightpoint)
|
||||||
|
{
|
||||||
|
vec3 offs;
|
||||||
|
vec3 result;
|
||||||
|
offs[0] = lightpoint[0] - origin[0];
|
||||||
|
offs[1] = lightpoint[1] - origin[1];
|
||||||
|
offs[2] = lightpoint[2] - origin[2];
|
||||||
|
result[0] = dot(offs[0], axis[0]);
|
||||||
|
result[1] = dot(offs[1], axis[1]);
|
||||||
|
result[2] = dot(offs[2], axis[2]);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void main ()
|
void main ()
|
||||||
{
|
{
|
||||||
vec3 n, s, t, w;
|
vec3 n, s, t, w;
|
||||||
|
@ -41,7 +58,20 @@ varying mat3 invsurface;
|
||||||
n = normalize(n);
|
n = normalize(n);
|
||||||
s = normalize(s);
|
s = normalize(s);
|
||||||
t = normalize(t);
|
t = normalize(t);
|
||||||
|
|
||||||
|
#ifdef CHROME
|
||||||
|
vec3 rorg = rlv(vec3(0,0,0), w, e_eyepos);
|
||||||
|
vec3 viewc = normalize(e_eyepos - w);
|
||||||
|
float d = dot(n, viewc);
|
||||||
|
vec3 reflected;
|
||||||
|
reflected.x = n.x * 2.0 * d - viewc.x;
|
||||||
|
reflected.y = n.y * 2.0 * d - viewc.y;
|
||||||
|
reflected.z = n.z * 2.0 * d - viewc.z;
|
||||||
|
tex_c.x = 0.5 + reflected.y * 0.5;
|
||||||
|
tex_c.y = 0.5 - reflected.z * 0.5;
|
||||||
|
#else
|
||||||
tex_c = v_texcoord;
|
tex_c = v_texcoord;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* normalmap */
|
/* normalmap */
|
||||||
invsurface = mat3(s, t, n);
|
invsurface = mat3(s, t, n);
|
||||||
|
@ -72,7 +102,6 @@ varying mat3 invsurface;
|
||||||
void main ()
|
void main ()
|
||||||
{
|
{
|
||||||
vec4 fb_f = texture2D(s_fullbright, tex_c);
|
vec4 fb_f = texture2D(s_fullbright, tex_c);
|
||||||
vec3 new_e_light_dir = vec3(cos(e_time), sin(e_time), 0);
|
|
||||||
vec3 light;
|
vec3 light;
|
||||||
|
|
||||||
#if r_skipDiffuse==0
|
#if r_skipDiffuse==0
|
||||||
|
|
Binary file not shown.
|
@ -65,8 +65,7 @@
|
||||||
{
|
{
|
||||||
"classname" "info_player_deathmatch"
|
"classname" "info_player_deathmatch"
|
||||||
}
|
}
|
||||||
|
// entity 3
|
||||||
// entity 5
|
|
||||||
{
|
{
|
||||||
"classname" "func_button"
|
"classname" "func_button"
|
||||||
"target" "foobar2"
|
"target" "foobar2"
|
||||||
|
@ -80,7 +79,7 @@
|
||||||
( 48 -80 64 ) ( 48 -40 64 ) ( 48 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
|
( 48 -80 64 ) ( 48 -40 64 ) ( 48 -80 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// entity 6
|
// entity 4
|
||||||
{
|
{
|
||||||
"classname" "func_button"
|
"classname" "func_button"
|
||||||
"target" "foobar1"
|
"target" "foobar1"
|
||||||
|
@ -94,24 +93,26 @@
|
||||||
( 48 112 64 ) ( 48 152 64 ) ( 48 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
|
( 48 112 64 ) ( 48 152 64 ) ( 48 112 72 ) next/rusty7 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// entity 5
|
||||||
{
|
{
|
||||||
"classname" "point_message"
|
"classname" "point_message"
|
||||||
"origin" "-160.000000 128.000000 32.000000"
|
"origin" "-160.000000 128.000000 32.000000"
|
||||||
"message" "White dynamic light with no style pattern."
|
"message" "White dynamic light with no style pattern."
|
||||||
}
|
}
|
||||||
|
// entity 6
|
||||||
{
|
{
|
||||||
"classname" "dynamic_light"
|
"classname" "dynamic_light"
|
||||||
"origin" "-192.000000 128.000000 64.000000"
|
"origin" "-192.000000 128.000000 64.000000"
|
||||||
"_light" "255 255 255"
|
"_light" "255 255 255"
|
||||||
"brightness" "250"
|
"brightness" "250"
|
||||||
}
|
}
|
||||||
|
// entity 7
|
||||||
{
|
{
|
||||||
"classname" "point_message"
|
"classname" "point_message"
|
||||||
"origin" "-160.000000 -64.000000 32.000000"
|
"origin" "-160.000000 -64.000000 32.000000"
|
||||||
"message" "Small blinking yellow dynamic light."
|
"message" "Small blinking yellow dynamic light."
|
||||||
}
|
}
|
||||||
|
// entity 8
|
||||||
{
|
{
|
||||||
"classname" "dynamic_light"
|
"classname" "dynamic_light"
|
||||||
"origin" "-192.000000 -64.000000 64.000000"
|
"origin" "-192.000000 -64.000000 64.000000"
|
||||||
|
@ -119,12 +120,13 @@
|
||||||
"_light" "255 255 128"
|
"_light" "255 255 128"
|
||||||
"brightness" "150"
|
"brightness" "150"
|
||||||
}
|
}
|
||||||
|
// entity 9
|
||||||
{
|
{
|
||||||
"classname" "point_message"
|
"classname" "point_message"
|
||||||
"origin" "120.000000 128.000000 32.000000"
|
"origin" "120.000000 128.000000 32.000000"
|
||||||
"message" "Toggable white flickering dynamic light."
|
"message" "Toggable white flickering dynamic light."
|
||||||
}
|
}
|
||||||
|
// entity 10
|
||||||
{
|
{
|
||||||
"classname" "dynamic_light"
|
"classname" "dynamic_light"
|
||||||
"origin" "192.000000 128.000000 64.000000"
|
"origin" "192.000000 128.000000 64.000000"
|
||||||
|
@ -133,12 +135,13 @@
|
||||||
"_light" "255 255 255"
|
"_light" "255 255 255"
|
||||||
"brightness" "250"
|
"brightness" "250"
|
||||||
}
|
}
|
||||||
|
// entity 11
|
||||||
{
|
{
|
||||||
"classname" "point_message"
|
"classname" "point_message"
|
||||||
"origin" "120.000000 -64.000000 32.000000"
|
"origin" "120.000000 -64.000000 32.000000"
|
||||||
"message" "Toggable red slow pulsing dynamic light."
|
"message" "Toggable red slow pulsing dynamic light."
|
||||||
}
|
}
|
||||||
|
// entity 12
|
||||||
{
|
{
|
||||||
"classname" "dynamic_light"
|
"classname" "dynamic_light"
|
||||||
"origin" "192.000000 -128.000000 64.000000"
|
"origin" "192.000000 -128.000000 64.000000"
|
||||||
|
@ -147,3 +150,16 @@
|
||||||
"_light" "255 0 0"
|
"_light" "255 0 0"
|
||||||
"brightness" "250"
|
"brightness" "250"
|
||||||
}
|
}
|
||||||
|
// entity 13
|
||||||
|
{
|
||||||
|
"classname" "prop_dynamic"
|
||||||
|
"origin" "160.000000 0.000000 0.000000"
|
||||||
|
"model" "models/logos/visions.vvm"
|
||||||
|
"angles" "0 -90 0"
|
||||||
|
"avelocity" "0 90 0"
|
||||||
|
}
|
||||||
|
// entity 14
|
||||||
|
{
|
||||||
|
"classname" "env_cubemap"
|
||||||
|
"origin" "0 0 0"
|
||||||
|
}
|
||||||
|
|
BIN
platform/test_maps.pk3dir/models/logos/visions.max
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions.max
Normal file
Binary file not shown.
4
platform/test_maps.pk3dir/models/logos/visions.qc
Normal file
4
platform/test_maps.pk3dir/models/logos/visions.qc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
output visions.vvm
|
||||||
|
materialprefix models/logos/
|
||||||
|
scale 0.1
|
||||||
|
scene visions.smd
|
9030
platform/test_maps.pk3dir/models/logos/visions.smd
Normal file
9030
platform/test_maps.pk3dir/models/logos/visions.smd
Normal file
File diff suppressed because it is too large
Load diff
BIN
platform/test_maps.pk3dir/models/logos/visions.vvm
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions.vvm
Normal file
Binary file not shown.
BIN
platform/test_maps.pk3dir/models/logos/visions_black.tga
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions_black.tga
Normal file
Binary file not shown.
BIN
platform/test_maps.pk3dir/models/logos/visions_chrome.ktx
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions_chrome.ktx
Normal file
Binary file not shown.
|
@ -0,0 +1,6 @@
|
||||||
|
// Vera Visions Material
|
||||||
|
{
|
||||||
|
program vertexlit_specular#CHROME
|
||||||
|
diffusemap models/logos/visions_chrome.ktx
|
||||||
|
fullbrightmap models/logos/visions_chrome.ktx
|
||||||
|
}
|
BIN
platform/test_maps.pk3dir/models/logos/visions_eye.ktx
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions_eye.ktx
Normal file
Binary file not shown.
14
platform/test_maps.pk3dir/models/logos/visions_eye.mat
Normal file
14
platform/test_maps.pk3dir/models/logos/visions_eye.mat
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Vera Visions Material
|
||||||
|
{
|
||||||
|
diffusemap models/logos/visions_eye.ktx
|
||||||
|
normalmap models/logos/visions_eye_n.tga
|
||||||
|
|
||||||
|
{
|
||||||
|
program vertexlit_specular
|
||||||
|
}
|
||||||
|
{
|
||||||
|
clampmap models/logos/visions_eye.tga
|
||||||
|
blendFunc add
|
||||||
|
rgbGen wave sin 1 0.2 1 .8
|
||||||
|
}
|
||||||
|
}
|
BIN
platform/test_maps.pk3dir/models/logos/visions_eye_n.tga
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions_eye_n.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
BIN
platform/test_maps.pk3dir/models/logos/visions_glow.ktx
Normal file
BIN
platform/test_maps.pk3dir/models/logos/visions_glow.ktx
Normal file
Binary file not shown.
9
platform/test_maps.pk3dir/models/logos/visions_glow.mat
Normal file
9
platform/test_maps.pk3dir/models/logos/visions_glow.mat
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// Vera Visions Material
|
||||||
|
{
|
||||||
|
{
|
||||||
|
clampmap models/logos/visions_glow.ktx
|
||||||
|
blendFunc add
|
||||||
|
rgbGen wave sin 1 0.2 1 .8
|
||||||
|
tcMod rotate 50
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,9 +32,11 @@ class prop_dynamic:CBaseEntity
|
||||||
|
|
||||||
virtual void(void) Init;
|
virtual void(void) Init;
|
||||||
virtual void(string, string) SpawnKey;
|
virtual void(string, string) SpawnKey;
|
||||||
|
virtual float(void) predraw;
|
||||||
};
|
};
|
||||||
|
|
||||||
void prop_dynamic::SpawnKey(string strField, string strKey)
|
void
|
||||||
|
prop_dynamic::SpawnKey(string strField, string strKey)
|
||||||
{
|
{
|
||||||
switch (strField) {
|
switch (strField) {
|
||||||
case "modelscale":
|
case "modelscale":
|
||||||
|
@ -43,12 +45,22 @@ void prop_dynamic::SpawnKey(string strField, string strKey)
|
||||||
case "angle":
|
case "angle":
|
||||||
angles[1] = stof(strKey);
|
angles[1] = stof(strKey);
|
||||||
break;
|
break;
|
||||||
|
case "avelocity":
|
||||||
|
avelocity = stov(strKey);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
CBaseEntity::SpawnKey(strField, strKey);
|
CBaseEntity::SpawnKey(strField, strKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
float
|
||||||
|
prop_dynamic::predraw(void)
|
||||||
|
{
|
||||||
|
angles += avelocity * frametime;
|
||||||
|
return CBaseEntity::predraw();
|
||||||
|
}
|
||||||
|
|
||||||
void prop_dynamic::Init(void)
|
void
|
||||||
|
prop_dynamic::Init(void)
|
||||||
{
|
{
|
||||||
CBaseEntity::Init();
|
CBaseEntity::Init();
|
||||||
|
|
||||||
|
@ -61,7 +73,9 @@ void prop_dynamic::Init(void)
|
||||||
drawmask = MASK_ENGINE;
|
drawmask = MASK_ENGINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void prop_dynamic::prop_dynamic(void)
|
void
|
||||||
|
prop_dynamic::prop_dynamic(void)
|
||||||
{
|
{
|
||||||
scale = 1.0f;
|
scale = 1.0f;
|
||||||
|
Init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue