Added tweaks that'll help with 3D Glasses:

r_viewmodelscale (try 5)
gl_mono (0/1)
This commit is contained in:
Marco Cawthorne 2020-03-30 18:04:45 +02:00
parent dcd42ba93b
commit ec835c75f0
8 changed files with 47 additions and 9 deletions

View File

@ -48,6 +48,7 @@ var vector autocvar_vgui_color = [255,170,0];
var vector autocvar_v_gunofs = [0,0,0];
var int autocvar_r_viewmodelpass = 0;
var float autocvar_r_viewmodelfov = 90.0f;
var float autocvar_r_viewmodelscale = 1.0f;
/* particle descriptors */
var float PARTICLE_BLOOD;

View File

@ -144,6 +144,16 @@ void View_DrawViewModel(void)
makevectors(view_angles);
eViewModel.angles = view_angles;
// Give the gun a tilt effect like in old HL/CS versions
if (autocvar_v_bobclassic == 1) {
eViewModel.angles[2] = -pSeat->fBob;
}
/* now apply the scale hack */
eViewModel.scale = autocvar_r_viewmodelscale;
pSeat->fBob *= autocvar_r_viewmodelscale;
eViewModel.origin = pSeat->vPlayerOrigin + pl.view_ofs;
eViewModel.origin += [0,0,-1] + (v_forward * (pSeat->fBob * 0.4))
+ (v_forward * autocvar_v_gunofs[0])
@ -162,11 +172,6 @@ void View_DrawViewModel(void)
}
}
// Give the gun a tilt effect like in old HL/CS versions
if (autocvar_v_bobclassic == 1) {
eViewModel.angles[2] = -pSeat->fBob;
}
// Only bother when zoomed out
if (pl.viewzoom == 1.0f) {
// Update muzzleflash position and draw it

View File

@ -83,7 +83,7 @@ CBaseEntity::RenderFXPass(void)
r = random() * 0.5f;
makevectors(angles);
if (cltime & 1) {
v_right *= 0.75 + r;
renderflags |= RF_USEAXIS;
@ -91,7 +91,7 @@ CBaseEntity::RenderFXPass(void)
v_up *= 1.0 - (random() * 0.2f);
renderflags |= RF_USEAXIS;
}
dist = vlen(getproperty(VF_ORIGIN) - origin);
if (dist < 256) {
float distalpha = dist / 256;

View File

@ -6,6 +6,7 @@
!!cvardf gl_affinemodels=0
!!cvardf gl_ldr=1
!!cvardf gl_halflambert=1
!!cvardf gl_mono=0
#include "sys/defs.h"
@ -108,6 +109,11 @@ varying vec3 light;
diffuse_f *= e_colourident;
if (gl_mono == 1.0) {
float bw = (diffuse_f.r + diffuse_f.g + diffuse_f.b) / 3.0;
diffuse_f.rgb = vec3(bw, bw, bw);
}
gl_FragColor = diffuse_f;
}
#endif

View File

@ -1,6 +1,7 @@
!!ver 110
!!ver 130
!!permu FOG
!!samps reflectcube
!!cvardf gl_mono=0
#include "sys/defs.h"
#include "sys/fog.h"
@ -18,6 +19,12 @@ void main ()
void main ()
{
vec4 skybox = textureCube(s_reflectcube, pos);
if (gl_mono == 1.0) {
float bw = (skybox.r + skybox.g + skybox.b) / 3.0;
skybox.rgb = vec3(bw, bw, bw) * 1.5;
}
gl_FragColor = vec4(fog3(skybox.rgb), 1.0);
}
#endif

View File

@ -1,5 +1,7 @@
!!ver 130
!!permu FOG
!!samps 1
!!cvardf gl_mono=0
#include "sys/fog.h"
#ifdef VERTEX_SHADER
@ -31,6 +33,11 @@ void main ()
col = fog4blend(col * vc * e_colourident * e_vlscale);
if (gl_mono == 1.0) {
float bw = (col.r + col.g + col.b) / 3.0;
col.rgb = vec3(bw, bw, bw) * 1.5;
}
gl_FragColor = col;
}
#endif

View File

@ -1,9 +1,10 @@
!!ver 110
!!ver 130
!!permu LIGHTSTYLED
!!samps diffuse reflectcube normalmap
!!samps lightmap
!!samps =LIGHTSTYLED lightmap1 lightmap2 lightmap3
!!cvardf gl_mono=0
#include "sys/defs.h"
@ -103,6 +104,12 @@ varying mat3 invsurface;
#endif
diffuse_f *= e_colourident;
if (gl_mono == 1.0) {
float bw = (diffuse_f.r + diffuse_f.g + diffuse_f.b) / 3.0;
diffuse_f.rgb = vec3(bw, bw, bw);
}
gl_FragColor = diffuse_f;
}

View File

@ -2,6 +2,7 @@
!!permu FOG
!!cvarf r_wateralpha
!!samps diffuse lightmap
!!cvardf gl_mono=0
#include "sys/defs.h"
@ -41,6 +42,10 @@ void main ()
ts *= (texture2D(s_lightmap, lm0) * e_lmscale).rgb;
#endif
if (gl_mono == 1.0) {
float bw = (ts.r + ts.g + ts.b) / 3.0;
ts.rgb = vec3(bw, bw, bw);
}
gl_FragColor = fog4(vec4(ts, USEALPHA) * e_colourident);
}
#endif