Skip to content

Commit b2fe028

Browse files
committed
NUKE forward lighting dynamic light renderer
It still kinda worked but we don't want to maintain it. Fixes #747.
1 parent 58d3c65 commit b2fe028

32 files changed

+58
-4392
lines changed
-1.14 KB
Binary file not shown.
-1.03 KB
Binary file not shown.
-23.7 KB
Binary file not shown.
-8.22 KB
Binary file not shown.

pkg/daemon_src.dpkdir/scripts/engine.shader

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,3 @@ gfx/2d/bigchars
2828
rgbgen vertex
2929
}
3030
}
31-
32-
lights/defaultDynamicLight
33-
{
34-
{
35-
stage attenuationMapZ
36-
map lights/mkintsquarelight1a
37-
edgeClamp
38-
}
39-
{
40-
stage attenuationMapXY
41-
forceHighQuality
42-
map lights/round
43-
colored
44-
zeroClamp
45-
}
46-
}
47-
48-
lights/defaultPointLight
49-
{
50-
// this will also be the falloff for any
51-
// point light shaders that don't specify one
52-
lightFalloffImage lights/mkintsquarelight1a
53-
{
54-
stage attenuationMapXY
55-
forceHighQuality
56-
map lights/squarelight1
57-
colored
58-
zeroClamp
59-
}
60-
}
61-
62-
lights/defaultProjectedLight
63-
{
64-
// by default, stay bright almost all the way to the end
65-
lightFalloffImage lights/mkintsquarelight1b
66-
{
67-
stage attenuationMapXY
68-
forceHighQuality
69-
map lights/squarelight1
70-
colored
71-
zeroClamp
72-
}
73-
}

src.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ set(GLSLSOURCELIST
185185
# Regular shaders
186186
${ENGINE_DIR}/renderer/glsl_source/fogQuake3_vp.glsl
187187
${ENGINE_DIR}/renderer/glsl_source/fogQuake3_fp.glsl
188-
${ENGINE_DIR}/renderer/glsl_source/forwardLighting_vp.glsl
189-
${ENGINE_DIR}/renderer/glsl_source/forwardLighting_fp.glsl
190188
${ENGINE_DIR}/renderer/glsl_source/generic_vp.glsl
191189
${ENGINE_DIR}/renderer/glsl_source/generic_fp.glsl
192190
${ENGINE_DIR}/renderer/glsl_source/heatHaze_vp.glsl

src/engine/qcommon/q_shared.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,7 @@ inline vec_t VectorNormalize2( const vec3_t v, vec3_t out )
18991899

19001900
using GameStateCSs = std::array<std::string, MAX_CONFIGSTRINGS>;
19011901

1902+
// TODO(0.56): NUKE all
19021903
#define REF_FORCE_DLIGHT ( 1 << 31 ) // RF, passed in through overdraw parameter, force this dlight under all conditions
19031904
#define REF_JUNIOR_DLIGHT ( 1 << 30 ) // (SA) this dlight does not light surfaces. it only affects dynamic light grid
19041905
#define REF_DIRECTED_DLIGHT ( 1 << 29 ) // ydnar: global directional light, origin should be interpreted as a normal vector

src/engine/renderer/Material.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,9 @@ void BindShaderLightMapping( Material* material ) {
793793
gl_lightMappingShaderMaterial->SetUniformBlock_Lights( tr.dlightUBO );
794794

795795
// bind u_LightTiles
796-
if ( r_realtimeLightingRenderer.Get() == Util::ordinal( realtimeLightingRenderer_t::TILED ) ) {
797-
gl_lightMappingShaderMaterial->SetUniform_LightTilesBindless(
798-
GL_BindToTMU( BIND_LIGHTTILES, tr.lighttileRenderImage )
799-
);
800-
}
796+
gl_lightMappingShaderMaterial->SetUniform_LightTilesBindless(
797+
GL_BindToTMU( BIND_LIGHTTILES, tr.lighttileRenderImage )
798+
);
801799
}
802800

803801
gl_lightMappingShaderMaterial->SetUniform_ViewOrigin( backEnd.orientation.viewOrigin );
@@ -1428,9 +1426,7 @@ void MaterialSystem::AddStageTextures( MaterialSurface* surface, shader_t* shade
14281426
surface->texDataDynamic[stage] = dynamic;
14291427

14301428
if ( glConfig2.realtimeLighting ) {
1431-
if ( r_realtimeLightingRenderer.Get() == Util::ordinal( realtimeLightingRenderer_t::TILED ) ) {
1432-
material->AddTexture( tr.lighttileRenderImage->texture );
1433-
}
1429+
material->AddTexture( tr.lighttileRenderImage->texture );
14341430
}
14351431
}
14361432

src/engine/renderer/gl_shader.cpp

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ GLShader_generic *gl_genericShader = nullptr;
6464
GLShader_genericMaterial *gl_genericShaderMaterial = nullptr;
6565
GLShader_lightMapping *gl_lightMappingShader = nullptr;
6666
GLShader_lightMappingMaterial *gl_lightMappingShaderMaterial = nullptr;
67-
GLShader_forwardLighting_omniXYZ *gl_forwardLightingShader_omniXYZ = nullptr;
68-
GLShader_forwardLighting_projXYZ *gl_forwardLightingShader_projXYZ = nullptr;
69-
GLShader_forwardLighting_directionalSun *gl_forwardLightingShader_directionalSun = nullptr;
7067
GLShader_fogQuake3 *gl_fogQuake3Shader = nullptr;
7168
GLShader_fogQuake3Material *gl_fogQuake3ShaderMaterial = nullptr;
7269
GLShader_heatHaze *gl_heatHazeShader = nullptr;
@@ -686,7 +683,6 @@ static std::string GenEngineConstants() {
686683
if ( glConfig2.realtimeLighting )
687684
{
688685
AddDefine( str, "r_realtimeLighting", 1 );
689-
AddDefine( str, "r_realtimeLightingRenderer", r_realtimeLightingRenderer.Get() );
690686
}
691687

692688
if ( r_showNormalMaps->integer )
@@ -2553,160 +2549,6 @@ void GLShader_lightMappingMaterial::SetShaderProgramUniforms( ShaderProgramDescr
25532549
}
25542550
}
25552551

2556-
GLShader_forwardLighting_omniXYZ::GLShader_forwardLighting_omniXYZ():
2557-
GLShader( "forwardLighting_omniXYZ", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT,
2558-
false, "forwardLighting", "forwardLighting" ),
2559-
u_DiffuseMap( this ),
2560-
u_NormalMap( this ),
2561-
u_MaterialMap( this ),
2562-
u_AttenuationMapXY( this ),
2563-
u_AttenuationMapZ( this ),
2564-
u_RandomMap( this ),
2565-
u_HeightMap( this ),
2566-
u_TextureMatrix( this ),
2567-
u_SpecularExponent( this ),
2568-
u_AlphaThreshold( this ),
2569-
u_ColorModulateColorGen_Float( this ),
2570-
u_ColorModulateColorGen_Uint( this ),
2571-
u_Color_Float( this ),
2572-
u_Color_Uint( this ),
2573-
u_ViewOrigin( this ),
2574-
u_LightOrigin( this ),
2575-
u_LightColor( this ),
2576-
u_LightRadius( this ),
2577-
u_LightScale( this ),
2578-
u_LightAttenuationMatrix( this ),
2579-
u_ModelMatrix( this ),
2580-
u_ModelViewProjectionMatrix( this ),
2581-
u_Bones( this ),
2582-
u_VertexInterpolation( this ),
2583-
u_ReliefDepthScale( this ),
2584-
u_ReliefOffsetBias( this ),
2585-
u_NormalScale( this ),
2586-
GLDeformStage( this ),
2587-
GLCompileMacro_USE_VERTEX_SKINNING( this ),
2588-
GLCompileMacro_USE_VERTEX_ANIMATION( this ),
2589-
GLCompileMacro_USE_HEIGHTMAP_IN_NORMALMAP( this ),
2590-
GLCompileMacro_USE_RELIEF_MAPPING( this )
2591-
{
2592-
}
2593-
2594-
void GLShader_forwardLighting_omniXYZ::SetShaderProgramUniforms( ShaderProgramDescriptor *shaderProgram )
2595-
{
2596-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DiffuseMap" ), 0 );
2597-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 1 );
2598-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_MaterialMap" ), 2 );
2599-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_AttenuationMapXY" ), 3 );
2600-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_AttenuationMapZ" ), 4 );
2601-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_RandomMap" ), 6 );
2602-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
2603-
}
2604-
2605-
GLShader_forwardLighting_projXYZ::GLShader_forwardLighting_projXYZ():
2606-
GLShader( "forwardLighting_projXYZ", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT,
2607-
false, "forwardLighting", "forwardLighting" ),
2608-
u_DiffuseMap( this ),
2609-
u_NormalMap( this ),
2610-
u_MaterialMap( this ),
2611-
u_AttenuationMapXY( this ),
2612-
u_AttenuationMapZ( this ),
2613-
u_RandomMap( this ),
2614-
u_HeightMap( this ),
2615-
u_TextureMatrix( this ),
2616-
u_SpecularExponent( this ),
2617-
u_AlphaThreshold( this ),
2618-
u_ColorModulateColorGen_Float( this ),
2619-
u_ColorModulateColorGen_Uint( this ),
2620-
u_Color_Float( this ),
2621-
u_Color_Uint( this ),
2622-
u_ViewOrigin( this ),
2623-
u_LightOrigin( this ),
2624-
u_LightColor( this ),
2625-
u_LightRadius( this ),
2626-
u_LightScale( this ),
2627-
u_LightAttenuationMatrix( this ),
2628-
u_ModelMatrix( this ),
2629-
u_ModelViewProjectionMatrix( this ),
2630-
u_Bones( this ),
2631-
u_VertexInterpolation( this ),
2632-
u_ReliefDepthScale( this ),
2633-
u_ReliefOffsetBias( this ),
2634-
u_NormalScale( this ),
2635-
GLDeformStage( this ),
2636-
GLCompileMacro_USE_VERTEX_SKINNING( this ),
2637-
GLCompileMacro_USE_VERTEX_ANIMATION( this ),
2638-
GLCompileMacro_USE_HEIGHTMAP_IN_NORMALMAP( this ),
2639-
GLCompileMacro_USE_RELIEF_MAPPING( this )
2640-
{
2641-
}
2642-
2643-
void GLShader_forwardLighting_projXYZ::BuildShaderCompileMacros( std::string& compileMacros )
2644-
{
2645-
compileMacros += "LIGHT_PROJ ";
2646-
}
2647-
2648-
void GLShader_forwardLighting_projXYZ::SetShaderProgramUniforms( ShaderProgramDescriptor *shaderProgram )
2649-
{
2650-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DiffuseMap" ), 0 );
2651-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 1 );
2652-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_MaterialMap" ), 2 );
2653-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_AttenuationMapXY" ), 3 );
2654-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_AttenuationMapZ" ), 4 );
2655-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_RandomMap" ), 6 );
2656-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
2657-
}
2658-
2659-
GLShader_forwardLighting_directionalSun::GLShader_forwardLighting_directionalSun():
2660-
GLShader( "forwardLighting_directionalSun", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT,
2661-
false, "forwardLighting", "forwardLighting" ),
2662-
u_DiffuseMap( this ),
2663-
u_NormalMap( this ),
2664-
u_MaterialMap( this ),
2665-
u_HeightMap( this ),
2666-
u_TextureMatrix( this ),
2667-
u_SpecularExponent( this ),
2668-
u_AlphaThreshold( this ),
2669-
u_ColorModulateColorGen_Float( this ),
2670-
u_ColorModulateColorGen_Uint( this ),
2671-
u_Color_Float( this ),
2672-
u_Color_Uint( this ),
2673-
u_ViewOrigin( this ),
2674-
u_LightDir( this ),
2675-
u_LightColor( this ),
2676-
u_LightRadius( this ),
2677-
u_LightScale( this ),
2678-
u_LightAttenuationMatrix( this ),
2679-
u_ModelMatrix( this ),
2680-
u_ViewMatrix( this ),
2681-
u_ModelViewProjectionMatrix( this ),
2682-
u_Bones( this ),
2683-
u_VertexInterpolation( this ),
2684-
u_ReliefDepthScale( this ),
2685-
u_ReliefOffsetBias( this ),
2686-
u_NormalScale( this ),
2687-
GLDeformStage( this ),
2688-
GLCompileMacro_USE_VERTEX_SKINNING( this ),
2689-
GLCompileMacro_USE_VERTEX_ANIMATION( this ),
2690-
GLCompileMacro_USE_HEIGHTMAP_IN_NORMALMAP( this ),
2691-
GLCompileMacro_USE_RELIEF_MAPPING( this )
2692-
{
2693-
}
2694-
2695-
void GLShader_forwardLighting_directionalSun::BuildShaderCompileMacros( std::string& compileMacros )
2696-
{
2697-
compileMacros += "LIGHT_DIRECTIONAL ";
2698-
}
2699-
2700-
void GLShader_forwardLighting_directionalSun::SetShaderProgramUniforms( ShaderProgramDescriptor *shaderProgram )
2701-
{
2702-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DiffuseMap" ), 0 );
2703-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_NormalMap" ), 1 );
2704-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_MaterialMap" ), 2 );
2705-
//glUniform1i(glGetUniformLocation( shaderProgram->id, "u_AttenuationMapXY" ), 3);
2706-
//glUniform1i(glGetUniformLocation( shaderProgram->id, "u_AttenuationMapZ" ), 4);
2707-
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_HeightMap" ), 15 );
2708-
}
2709-
27102552
GLShader_reflection::GLShader_reflection():
27112553
GLShader( "reflection", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT,
27122554
false, "reflection_CB", "reflection_CB" ),

0 commit comments

Comments
 (0)