Skip to content

Commit

Permalink
Add fog parameters to uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-bckl committed May 4, 2021
1 parent 37134de commit 05246ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 4 additions & 0 deletions OpenGLDrv/Inc/OpenGLRenderInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ enum EHardwareShaderUniforms{
UNIFORM_BLOCK_MEMBER(float, TanTime) \
UNIFORM_BLOCK_MEMBER(vec4, GlobalColor) \
UNIFORM_BLOCK_MEMBER(vec4, AmbientLightColor) \
UNIFORM_BLOCK_MEMBER(vec4, FogColor) \
UNIFORM_BLOCK_MEMBER(bool, FogEnabled) \
UNIFORM_BLOCK_MEMBER(float, FogStart) \
UNIFORM_BLOCK_MEMBER(float, FogEnd) \
UNIFORM_BLOCK_MEMBER(STRUCT(TextureInfo){ \
UNIFORM_STRUCT_MEMBER(bool, IsCubemap) \
UNIFORM_STRUCT_MEMBER(bool, IsBumpmap) \
Expand Down
1 change: 0 additions & 1 deletion OpenGLDrv/Src/OpenGLRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "GL/glew.h"
#include "GL/wglew.h"
#include "OpenGLResource.h"
#include <conio.h>

#define MIN_OPENGL_MAJOR_VERSION 4
#define MIN_OPENGL_MINOR_VERSION 5
Expand Down
24 changes: 11 additions & 13 deletions OpenGLDrv/Src/OpenGLRenderInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,28 +640,26 @@ void FOpenGLRenderInterface::SetLight(INT LightIndex, FDynamicLight* Light, FLOA
}

void FOpenGLRenderInterface::SetDistanceFog(UBOOL Enable, FLOAT FogStart, FLOAT FogEnd, FColor Color){
// EnableFog(Enable);
// CurrentState->FogStart = FogStart;
// CurrentState->FogEnd = FogEnd;
// CurrentState->FogColor = Color;
// ++CurrentState->UniformRevision;
// NeedUniformUpdate = true;
CurrentState->FogEnabled = Enable;
CurrentState->FogStart = FogStart;
CurrentState->FogEnd = FogEnd;
CurrentState->FogColor = Color;
++CurrentState->UniformRevision;
NeedUniformUpdate = true;
}

UBOOL FOpenGLRenderInterface::EnableFog(UBOOL Enable){
// CurrentState->FogEnabled = Enable != 0;
// ++CurrentState->UniformRevision;
// NeedUniformUpdate = true;
CurrentState->FogEnabled = Enable != 0;
++CurrentState->UniformRevision;
NeedUniformUpdate = true;

// return Enable;
return 0;
return Enable;
}

UBOOL FOpenGLRenderInterface::IsFogEnabled(){
return 0;//CurrentState->FogEnabled;
return CurrentState->FogEnabled;
}


void FOpenGLRenderInterface::SetGlobalColor(FColor Color){
++CurrentState->UniformRevision;
NeedUniformUpdate = true;
Expand Down

0 comments on commit 05246ac

Please sign in to comment.