Client/Platform: Added some base impact decal examples for non HL BSP...

this will change a bit more to include more material types. Patience!
This commit is contained in:
Marco Cawthorne 2020-10-15 19:02:55 +02:00
parent d0231eee50
commit 074e1cc120
15 changed files with 301 additions and 1 deletions

View File

@ -0,0 +1,206 @@
r_part default
{
type cdecal
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part alien
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part flesh
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part foliage
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part computer
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part dirt
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part vent
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_metal"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part grate
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_metal"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part metal
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_metal"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part glass
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_glass"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part sand
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part slosh
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part snow
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part tile
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_tile"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part wood
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_wood"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}
r_part concrete
{
type cdecal
blend premul_subtract
texture "textures/decals/impact_default"
tcoords 0 0 0.125 1 1 8 0.125
rgbf 1 1 1
scale 12 12
die 30 60
orgwrand 6 6
rotationstart -180 180
}

View File

@ -0,0 +1,8 @@
{
polygonOffset 1
{
program unlit
map "textures/decals/impact_default.tga"
blendfunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
}
}

View File

@ -0,0 +1,8 @@
{
polygonOffset 1
{
program unlit
map "textures/decals/impact_glass.tga"
blendFunc GL_ONE GL_ONE
}
}

View File

@ -0,0 +1,8 @@
{
polygonOffset 1
{
program unlit
map "textures/decals/impact_metal.tga"
blendfunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
}
}

View File

@ -0,0 +1,8 @@
{
polygonOffset 1
{
program unlit
map "textures/decals/impact_tile.tga"
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

View File

@ -0,0 +1,8 @@
{
polygonOffset 1
{
program unlit
map "textures/decals/impact_wood.tga"
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

View File

@ -20,6 +20,23 @@ var int FX_IMPACT_SMOKE_BROWN;
var int FX_IMPACT_SMOKE_GREY;
var int FX_IMPACT_SPARK;
var int DECAL_IMPACT_DEFAULT;
var int DECAL_IMPACT_ALIEN;
var int DECAL_IMPACT_FLESH;
var int DECAL_IMPACT_FOLIAGE;
var int DECAL_IMPACT_COMPUTER;
var int DECAL_IMPACT_DIRT;
var int DECAL_IMPACT_VENT;
var int DECAL_IMPACT_GRATE;
var int DECAL_IMPACT_METAL;
var int DECAL_IMPACT_GLASS;
var int DECAL_IMPACT_SAND;
var int DECAL_IMPACT_SLOSH;
var int DECAL_IMPACT_SNOW;
var int DECAL_IMPACT_TILE;
var int DECAL_IMPACT_WOOD;
var int DECAL_IMPACT_CONCRETE;
void
FX_Impact_Init(void)
{
@ -33,6 +50,24 @@ FX_Impact_Init(void)
FX_IMPACT_SMOKE_GREY = particleeffectnum("fx_impact.smoke_grey");
FX_IMPACT_SMOKE_BROWN = particleeffectnum("fx_impact.smoke_brown");
FX_IMPACT_SPARK = particleeffectnum("fx_impact.spark");
/* engine-side particle system decals for non HL1 BSP */
DECAL_IMPACT_DEFAULT = particleeffectnum("decal_impact.default");
DECAL_IMPACT_ALIEN = particleeffectnum("decal_impact.alien");
DECAL_IMPACT_FLESH = particleeffectnum("decal_impact.flesh");
DECAL_IMPACT_FOLIAGE = particleeffectnum("decal_impact.foliage");
DECAL_IMPACT_COMPUTER = particleeffectnum("decal_impact.computer");
DECAL_IMPACT_DIRT = particleeffectnum("decal_impact.dirt");
DECAL_IMPACT_VENT = particleeffectnum("decal_impact.vent");
DECAL_IMPACT_GRATE = particleeffectnum("decal_impact.grate");
DECAL_IMPACT_METAL = particleeffectnum("decal_impact.metal");
DECAL_IMPACT_GLASS = particleeffectnum("decal_impact.glass");
DECAL_IMPACT_SAND = particleeffectnum("decal_impact.sand");
DECAL_IMPACT_SLOSH = particleeffectnum("decal_impact.slosh");
DECAL_IMPACT_SNOW = particleeffectnum("decal_impact.snow");
DECAL_IMPACT_TILE = particleeffectnum("decal_impact.tile");
DECAL_IMPACT_WOOD = particleeffectnum("decal_impact.wood");
DECAL_IMPACT_CONCRETE = particleeffectnum("decal_impact.concrete");
}
#endif
@ -53,6 +88,7 @@ FX_Impact(int iType, vector vecPos, vector vNormal)
multicast(vecPos, MULTICAST_PVS);
#else
/* decals */
if (serverkeyfloat("*bspversion") == 30)
switch (iType) {
case IMPACT_GLASS:
Decals_Place(vecPos, sprintf("{break%d", floor(random(1,4))));
@ -64,6 +100,24 @@ FX_Impact(int iType, vector vecPos, vector vNormal)
Decals_Place(vecPos, sprintf("{bigshot%d", floor(random(1,6))));
break;
}
else
switch (iType) {
case IMPACT_GLASS:
pointparticles(DECAL_IMPACT_GLASS, vecPos, vNormal, 1);
break;
case IMPACT_WOOD:
pointparticles(DECAL_IMPACT_WOOD, vecPos, vNormal, 1);
break;
case IMPACT_METAL:
pointparticles(DECAL_IMPACT_METAL, vecPos, vNormal, 1);
break;
case IMPACT_FLESH:
pointparticles(DECAL_IMPACT_FLESH, vecPos, vNormal, 1);
break;
default:
pointparticles(DECAL_IMPACT_DEFAULT, vecPos, vNormal, 1);
break;
}
switch (iType) {
case IMPACT_MELEE:

View File

@ -26,7 +26,7 @@ FX_Spark_Init(void)
precache_sound("buttons/spark4.wav");
precache_sound("buttons/spark5.wav");
precache_sound("buttons/spark6.wav");
PARTICLE_SPARK = particleeffectnum("part_spark");
PARTICLE_SPARK = particleeffectnum("fx_spark.effect");
}
#endif