@@ -5993,10 +5993,6 @@ shader_t *R_FindShaderByName( const char *name )
59935993 // see if the shader is already loaded
59945994 for ( sh = shaderHashTable[ hash ]; sh; sh = sh->next )
59955995 {
5996- // NOTE: if there was no shader or image available with the name strippedName
5997- // then a default shader is created with type == SHADER_3D_DYNAMIC, so we
5998- // have to check all default shaders otherwise for every call to R_FindShader
5999- // with that same strippedName a new default shader is created.
60005996 if ( Q_stricmp ( sh->name , strippedName ) == 0 )
60015997 {
60025998 // match found
@@ -6022,19 +6018,14 @@ Will always return a valid shader, but it might be the
60226018default shader if the real one can't be found.
60236019
60246020In the interest of not requiring an explicit shader text entry to
6025- be defined for every single image used in the game, three default
6026- shader behaviors can be auto-created for any image:
6021+ be defined for every single image used in the game, two default
6022+ shader behaviors can be auto-created for any image that does not
6023+ have an explicit shader:
60276024
6028- If type == SHADER_2D, then the image will be used
6029- for 2D rendering unless an explicit shader is found
6025+ If type == SHADER_2D, then the image will default to using vertex colors.
60306026
6031- If type == SHADER_3D_DYNAMIC, then the image will have
6032- dynamic diffuse lighting applied to it, as appropriate for most
6033- entity skin surfaces.
6034-
6035- If type == SHADER_3D_STATIC, then the image will use
6036- the vertex rgba modulate values, as appropriate for misc_model
6037- pre-lit surfaces.
6027+ If type == SHADER_3D, then the renderer will choose appropriate precomputed
6028+ lighting: lightmap, (precomputed) vertex or light grid.
60386029===============
60396030*/
60406031shader_t *R_FindShader ( const char *name, shaderType_t type, int flags )
@@ -6059,7 +6050,7 @@ shader_t *R_FindShader( const char *name, shaderType_t type, int flags )
60596050 for ( sh = shaderHashTable[ hash ]; sh; sh = sh->next )
60606051 {
60616052 // NOTE: if there was no shader or image available with the name strippedName
6062- // then a default shader is created with type == SHADER_3D_DYNAMIC , so we
6053+ // then a default shader is created with type == SHADER_3D , so we
60636054 // have to check all default shaders otherwise for every call to R_FindShader
60646055 // with that same strippedName a new default shader is created.
60656056 if ( ( sh->type == type || sh->defaultShader ) && !Q_stricmp ( sh->name , strippedName ) )
@@ -6214,20 +6205,8 @@ shader_t *R_FindShader( const char *name, shaderType_t type, int flags )
62146205 break ;
62156206 }
62166207
6217- case shaderType_t::SHADER_3D_DYNAMIC:
6218- {
6219- // dynamic colors at vertexes
6220- stages[ 0 ].type = stageType_t::ST_COLLAPSE_DIFFUSEMAP;
6221- stages[ 0 ].bundle [ 0 ].image [ 0 ] = image;
6222- stages[ 0 ].active = true ;
6223- stages[ 0 ].rgbGen = colorGen_t::CGEN_IDENTITY_LIGHTING;
6224- stages[ 0 ].stateBits = implicitStateBits;
6225- break ;
6226- }
6227-
6228- case shaderType_t::SHADER_3D_STATIC:
6208+ case shaderType_t::SHADER_3D:
62296209 {
6230- // explicit colors at vertexes
62316210 stages[ 0 ].type = stageType_t::ST_COLLAPSE_DIFFUSEMAP;
62326211 stages[ 0 ].bundle [ 0 ].image [ 0 ] = image;
62336212 stages[ 0 ].active = true ;
@@ -6349,8 +6328,7 @@ class ListShadersCmd : public Cmd::StaticCmd
63496328 {
63506329 static const std::unordered_map<shaderType_t, std::string> shaderTypeName = {
63516330 { shaderType_t::SHADER_2D, " 2D" },
6352- { shaderType_t::SHADER_3D_DYNAMIC, " 3D_DYNAMIC" },
6353- { shaderType_t::SHADER_3D_STATIC, " 3D_STATIC" },
6331+ { shaderType_t::SHADER_3D, " 3D" },
63546332 };
63556333
63566334 static const std::unordered_map<shaderSort_t, std::string> shaderSortName = {
@@ -6822,7 +6800,7 @@ static void CreateInternalShaders()
68226800
68236801 Q_strncpyz ( shader.name , " <default>" , sizeof ( shader.name ) );
68246802
6825- shader.type = shaderType_t::SHADER_3D_DYNAMIC ;
6803+ shader.type = shaderType_t::SHADER_3D ;
68266804 shader.noFog = true ;
68276805 shader.fogShader = nullptr ;
68286806 stages[ 0 ].type = stageType_t::ST_DIFFUSEMAP;
@@ -6833,7 +6811,7 @@ static void CreateInternalShaders()
68336811
68346812 Q_strncpyz ( shader.name , " <fogEqual>" , sizeof ( shader.name ) );
68356813
6836- shader.type = shaderType_t::SHADER_3D_DYNAMIC ;
6814+ shader.type = shaderType_t::SHADER_3D ;
68376815 shader.sort = Util::ordinal ( shaderSort_t::SS_FOG );
68386816 stages[0 ].type = stageType_t::ST_FOGMAP;
68396817 for ( int i = 0 ; i < 5 ; i++ ) {
@@ -6845,7 +6823,7 @@ static void CreateInternalShaders()
68456823
68466824 Q_strncpyz ( shader.name , " <fogLE>" , sizeof ( shader.name ) );
68476825
6848- shader.type = shaderType_t::SHADER_3D_DYNAMIC ;
6826+ shader.type = shaderType_t::SHADER_3D ;
68496827 shader.sort = Util::ordinal ( shaderSort_t::SS_FOG );
68506828 stages[0 ].type = stageType_t::ST_FOGMAP;
68516829 for ( int i = 0 ; i < 5 ; i++ ) {
0 commit comments