Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/engine/renderer/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static void ComputeDynamics( shaderStage_t* pStage ) {
pStage->dynamic = pStage->dynamic || pStage->alphaExp.numOps || pStage->alphaTestExp.numOps;
pStage->dynamic = pStage->dynamic || pStage->rgbExp.numOps || pStage->redExp.numOps || pStage->greenExp.numOps || pStage->blueExp.numOps;
pStage->dynamic = pStage->dynamic || pStage->deformMagnitudeExp.numOps;
pStage->dynamic = pStage->dynamic || pStage->depthScaleExp.numOps || pStage->etaExp.numOps || pStage->etaDeltaExp.numOps
pStage->dynamic = pStage->dynamic || pStage->depthScaleExp.numOps
|| pStage->fogDensityExp.numOps || pStage->fresnelBiasExp.numOps || pStage->fresnelPowerExp.numOps
|| pStage->fresnelScaleExp.numOps || pStage->normalIntensityExp.numOps || pStage->refractionIndexExp.numOps;

Expand Down Expand Up @@ -1138,8 +1138,6 @@ void BindShaderSkybox( Material* material ) {
gl_skyboxShaderMaterial->BindProgram( material->deformIndex );

// Set shader uniforms.
gl_skyboxShaderMaterial->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin );
gl_skyboxShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_skyboxShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );
}

Expand All @@ -1156,7 +1154,6 @@ void BindShaderHeatHaze( Material* material ) {
gl_heatHazeShaderMaterial->BindProgram( material->deformIndex );

// Set shader uniforms.
gl_heatHazeShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_heatHazeShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );

gl_heatHazeShaderMaterial->SetUniform_ModelViewMatrixTranspose( glState.modelViewMatrix[glState.stackIndex] );
Expand Down
21 changes: 1 addition & 20 deletions src/engine/renderer/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,6 @@ GLShader_shadowFill::GLShader_shadowFill( GLShaderManager *manager ) :
GLShader( "shadowFill", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT, manager ),
u_ColorMap( this ),
u_TextureMatrix( this ),
u_ViewOrigin( this ),
u_AlphaThreshold( this ),
u_LightOrigin( this ),
u_LightRadius( this ),
Expand Down Expand Up @@ -2658,11 +2657,9 @@ GLShader_skybox::GLShader_skybox( GLShaderManager *manager ) :
u_ColorMapCube( this ),
u_CloudMap( this ),
u_TextureMatrix( this ),
u_ViewOrigin( this ),
u_CloudHeight( this ),
u_UseCloudMap( this ),
u_AlphaThreshold( this ),
u_ModelMatrix( this ),
u_ModelViewProjectionMatrix( this )
{
}
Expand All @@ -2678,11 +2675,9 @@ GLShader_skyboxMaterial::GLShader_skyboxMaterial( GLShaderManager* manager ) :
u_ColorMapCube( this ),
u_CloudMap( this ),
u_TextureMatrix( this ),
u_ViewOrigin( this ),
u_CloudHeight( this ),
u_UseCloudMap( this ),
u_AlphaThreshold( this ),
u_ModelMatrix( this ),
u_ModelViewProjectionMatrix( this )
{}

Expand Down Expand Up @@ -2733,13 +2728,10 @@ GLShader_fogGlobal::GLShader_fogGlobal( GLShaderManager *manager ) :
GLShader( "fogGlobal", ATTR_POSITION, manager ),
u_ColorMap( this ),
u_DepthMap( this ),
u_ViewOrigin( this ),
u_ViewMatrix( this ),
u_ModelViewProjectionMatrix( this ),
u_UnprojectMatrix( this ),
u_Color( this ),
u_FogDistanceVector( this ),
u_FogDepthVector( this )
u_FogDistanceVector( this )
{
}

Expand All @@ -2755,15 +2747,10 @@ GLShader_heatHaze::GLShader_heatHaze( GLShaderManager *manager ) :
u_NormalMap( this ),
u_HeightMap( this ),
u_TextureMatrix( this ),
u_ViewOrigin( this ),
u_ViewUp( this ),
u_DeformMagnitude( this ),
u_ModelMatrix( this ),
u_ModelViewProjectionMatrix( this ),
u_ModelViewMatrixTranspose( this ),
u_ProjectionMatrixTranspose( this ),
u_ColorModulate( this ),
u_Color( this ),
u_Bones( this ),
u_NormalScale( this ),
u_VertexInterpolation( this ),
Expand All @@ -2786,16 +2773,11 @@ GLShader_heatHazeMaterial::GLShader_heatHazeMaterial( GLShaderManager* manager )
u_NormalMap( this ),
u_HeightMap( this ),
u_TextureMatrix( this ),
u_ViewOrigin( this ),
u_ViewUp( this ),
u_DeformEnable( this ),
u_DeformMagnitude( this ),
u_ModelMatrix( this ),
u_ModelViewProjectionMatrix( this ),
u_ModelViewMatrixTranspose( this ),
u_ProjectionMatrixTranspose( this ),
u_ColorModulate( this ),
u_Color( this ),
u_NormalScale( this ),
GLDeformStage( this )
{
Expand Down Expand Up @@ -2862,7 +2844,6 @@ GLShader_cameraEffects::GLShader_cameraEffects( GLShaderManager *manager ) :
u_ColorModulate( this ),
u_TextureMatrix( this ),
u_ModelViewProjectionMatrix( this ),
u_DeformMagnitude( this ),
u_InverseGamma( this )
{
}
Expand Down
21 changes: 1 addition & 20 deletions src/engine/renderer/gl_shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4240,7 +4240,6 @@ class GLShader_shadowFill :
public GLShader,
public u_ColorMap,
public u_TextureMatrix,
public u_ViewOrigin,
public u_AlphaThreshold,
public u_LightOrigin,
public u_LightRadius,
Expand Down Expand Up @@ -4311,11 +4310,9 @@ class GLShader_skybox :
public u_ColorMapCube,
public u_CloudMap,
public u_TextureMatrix,
public u_ViewOrigin,
public u_CloudHeight,
public u_UseCloudMap,
public u_AlphaThreshold,
public u_ModelMatrix,
public u_ModelViewProjectionMatrix
{
public:
Expand All @@ -4328,11 +4325,9 @@ class GLShader_skyboxMaterial :
public u_ColorMapCube,
public u_CloudMap,
public u_TextureMatrix,
public u_ViewOrigin,
public u_CloudHeight,
public u_UseCloudMap,
public u_AlphaThreshold,
public u_ModelMatrix,
public u_ModelViewProjectionMatrix {
public:
GLShader_skyboxMaterial( GLShaderManager* manager );
Expand Down Expand Up @@ -4378,13 +4373,10 @@ class GLShader_fogGlobal :
public GLShader,
public u_ColorMap,
public u_DepthMap,
public u_ViewOrigin,
public u_ViewMatrix,
public u_ModelViewProjectionMatrix,
public u_UnprojectMatrix,
public u_Color,
public u_FogDistanceVector,
public u_FogDepthVector
public u_FogDistanceVector
{
public:
GLShader_fogGlobal( GLShaderManager *manager );
Expand All @@ -4397,15 +4389,10 @@ class GLShader_heatHaze :
public u_NormalMap,
public u_HeightMap,
public u_TextureMatrix,
public u_ViewOrigin,
public u_ViewUp,
public u_DeformMagnitude,
public u_ModelMatrix,
public u_ModelViewProjectionMatrix,
public u_ModelViewMatrixTranspose,
public u_ProjectionMatrixTranspose,
public u_ColorModulate,
public u_Color,
public u_Bones,
public u_NormalScale,
public u_VertexInterpolation,
Expand All @@ -4424,16 +4411,11 @@ class GLShader_heatHazeMaterial :
public u_NormalMap,
public u_HeightMap,
public u_TextureMatrix,
public u_ViewOrigin,
public u_ViewUp,
public u_DeformEnable,
public u_DeformMagnitude,
public u_ModelMatrix,
public u_ModelViewProjectionMatrix,
public u_ModelViewMatrixTranspose,
public u_ProjectionMatrixTranspose,
public u_ColorModulate,
public u_Color,
public u_NormalScale,
public GLDeformStage
{
Expand Down Expand Up @@ -4490,7 +4472,6 @@ class GLShader_cameraEffects :
public u_ColorModulate,
public u_TextureMatrix,
public u_ModelViewProjectionMatrix,
public u_DeformMagnitude,
public u_InverseGamma
{
public:
Expand Down
2 changes: 0 additions & 2 deletions src/engine/renderer/glsl_source/depthtile1_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
uniform sampler2D u_DepthMap;
IN(flat) vec3 unprojectionParams;

uniform vec3 u_zFar;

const vec2 pixelScale = 1 / r_FBufSize;

DECLARE_OUTPUT(vec4)
Expand Down
3 changes: 0 additions & 3 deletions src/engine/renderer/glsl_source/fogGlobal_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
uniform sampler2D u_ColorMap; // fog texture
uniform sampler2D u_DepthMap;

uniform vec3 u_ViewOrigin;
uniform vec4 u_FogDistanceVector;
uniform vec4 u_FogDepthVector;
uniform vec4 u_Color;
uniform mat4 u_ViewMatrix;
uniform mat4 u_UnprojectMatrix;

#if __VERSION__ > 120
Expand Down
2 changes: 0 additions & 2 deletions src/engine/renderer/glsl_source/fogQuake3_vp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#insert vertexSkinning_vp
#insert vertexAnimation_vp

uniform vec3 u_ViewOrigin;

uniform float u_Time;

uniform vec4 u_ColorModulate;
Expand Down
1 change: 0 additions & 1 deletion src/engine/renderer/glsl_source/heatHaze_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define HEATHAZE_GLSL

uniform sampler2D u_CurrentMap;
uniform float u_AlphaThreshold;

#if defined(USE_MATERIAL_SYSTEM)
uniform float u_DeformEnable;
Expand Down
1 change: 0 additions & 1 deletion src/engine/renderer/glsl_source/reflection_CB_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

uniform samplerCube u_ColorMapCube;
uniform vec3 u_ViewOrigin;
uniform mat4 u_ModelMatrix;

IN(smooth) vec3 var_Position;
IN(smooth) vec2 var_TexCoords;
Expand Down
3 changes: 0 additions & 3 deletions src/engine/renderer/tr_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2983,8 +2983,6 @@ void RB_RenderGlobalFog()
// go back to the world modelview matrix
backEnd.orientation = backEnd.viewParms.world;

gl_fogGlobalShader->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin ); // world space

{
fog_t *fog;

Expand Down Expand Up @@ -3014,7 +3012,6 @@ void RB_RenderGlobalFog()
gl_fogGlobalShader->SetUniform_Color( fog->color );
}

gl_fogGlobalShader->SetUniform_ViewMatrix( backEnd.viewParms.world.viewMatrix );
gl_fogGlobalShader->SetUniform_UnprojectMatrix( backEnd.viewParms.unprojectionMatrix );

// bind u_ColorMap
Expand Down
7 changes: 0 additions & 7 deletions src/engine/renderer/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1152,9 +1152,6 @@ enum class shaderProfilerRenderSubGroupsMode {

expression_t normalIntensityExp;

expression_t etaExp;
expression_t etaDeltaExp;

expression_t fogDensityExp;

expression_t depthScaleExp;
Expand Down Expand Up @@ -1225,8 +1222,6 @@ enum class shaderProfilerRenderSubGroupsMode {
// something calls RE_RegisterShader again with
// the same name, we don't try looking for it again

bool createdByGuide; // created using a shader .guide template

int surfaceFlags;
int contentFlags;

Expand All @@ -1242,8 +1237,6 @@ enum class shaderProfilerRenderSubGroupsMode {
float reliefDepthScale = 1.0f; // per-shader relief depth scale

bool noShadows;
bool fogLight;
bool blendLight;
bool ambientLight;
bool translucent;
bool forceOpaque;
Expand Down
3 changes: 0 additions & 3 deletions src/engine/renderer/tr_shade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2013,9 +2013,6 @@ void Render_skybox( shaderStage_t *pStage )

gl_skyboxShader->BindProgram( pStage->deformIndex );

gl_skyboxShader->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin ); // in world space

gl_skyboxShader->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
gl_skyboxShader->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[ glState.stackIndex ] );

// bind u_ColorMap
Expand Down