Client: 'buildcubemaps' will toggle r_skipEnvmap, which is now also defaulting to a black clear color (akin to Source)

This commit is contained in:
Marco Cawthorne 2023-03-16 16:04:47 -07:00
parent 64cb526943
commit 01be71e451
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 5 additions and 1 deletions

View File

@ -186,6 +186,7 @@ varying vec3 norm;
// the lighting stage for the world
#if defined(BUMP)
float refl = texture2D(s_normalmap, tex_c).a;
// whether to respect our bump, or to act flat
#if r_skipNormal == 0
@ -200,7 +201,6 @@ varying vec3 norm;
#if r_skipEnvmap == 0
vec3 cube_c;
vec3 env_f;
float refl = texture2D(s_normalmap, tex_c).a;
cube_c = reflect(normalize(-eyevector), vec3(0.0, 0.0, 1.0));
cube_c = cube_c.x * invsurface[0] +
cube_c.y * invsurface[1] +
@ -208,6 +208,8 @@ varying vec3 norm;
cube_c = (m_model * vec4(cube_c.xyz, 0.0)).xyz;
env_f = textureCube(s_reflectcube, cube_c).rgb * (e_lmscale.rgb * 0.25);
diffuse_f.rgb = mix(env_f, diffuse_f.rgb, refl);
#else
diffuse_f.rgb = mix(vec3(0.0, 0.0, 0.0), diffuse_f.rgb, refl);
#endif
#else
diffuse_f.rgb *= lightmap_fragment();

View File

@ -115,6 +115,7 @@ CMap_Shoot(void)
self.nextthink = time + 0.25f;
} else {
print("^2Cubemaps done...\n");
localcmd("r_skipEnvmap 0\n");
localcmd("vid_reload\n");
g_iCubeProcess = FALSE;
remove(self);
@ -159,6 +160,7 @@ CMap_Build(void)
localcmd("r_wireframe 0\n");
localcmd("r_hdr_irisadaptation 0\n");
localcmd("r_postprocshader \"\"0\n");
localcmd("r_skipEnvmap 1\n");
print("^4Building cubemaps...\n");
g_eCubeCycle = spawn();
g_eCubeCycle.owner = find(world, classname, "env_cubemap");