Skip to content

Commit

Permalink
Merge pull request #167 from kirides/lucifer602288-patch-1
Browse files Browse the repository at this point in the history
correction of "Render fog zones in Gothic 1" for Gothic 1.12f commited 11.02.2024 by ThielHater
  • Loading branch information
kirides authored Aug 19, 2024
2 parents 86f4a11 + 594ef41 commit c0e9d97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions D3D11Engine/D3D11PFX_HeightFog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ XRESULT D3D11PFX_HeightFog::Render( RenderToTextureBuffer* fxbuffer ) {
cb.HF_WeightZFar = std::min( cb.HF_WeightZFar, atmoMax );
cb.HF_WeightZNear = std::min( cb.HF_WeightZNear, atmoMin );

#ifndef BUILD_GOTHIC_1_08k
#if !defined(BUILD_GOTHIC_1_08k) || !defined(BUILD_1_12F)
float fogDensityFactor = 2;
float fogDensityFactorRain = (1.0f - Engine::GAPI->GetFogOverride());
#else
Expand All @@ -74,15 +74,15 @@ XRESULT D3D11PFX_HeightFog::Render( RenderToTextureBuffer* fxbuffer ) {
// Override fog color when in fog zone
color = Engine::GAPI->GetFogColor();

#ifndef BUILD_GOTHIC_1_08k
#if !defined(BUILD_GOTHIC_1_08k) || !defined(BUILD_1_12F)
// Make it z-Fog
cb.HF_HeightFalloff = Toolbox::lerp( cb.HF_HeightFalloff, 0.000001f, Engine::GAPI->GetFogOverride() );
#endif

// Turn up density
cb.HF_GlobalDensity = Toolbox::lerp( cb.HF_GlobalDensity, cb.HF_GlobalDensity * fogDensityFactor, Engine::GAPI->GetFogOverride() );

#ifndef BUILD_GOTHIC_1_08k
#if !defined(BUILD_GOTHIC_1_08k) || !defined(BUILD_1_12F)
// Use other fog-values for fog-zones
float distNear = WORLD_SECTION_SIZE * ((ffar - fnear) / ffar);
cb.HF_WeightZNear = Toolbox::lerp( cb.HF_WeightZNear, WORLD_SECTION_SIZE * 0.09f, Engine::GAPI->GetFogOverride() );
Expand Down
4 changes: 2 additions & 2 deletions D3D11Engine/GothicMemoryLocations1_12f.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ struct GothicMemoryLocations {
static const unsigned int Offset_MasterState = 0x74;

static const unsigned int GetUnderwaterFX = 0x5D8600;
static const unsigned int Offset_OverrideColor = 0x558;
static const unsigned int Offset_OverrideFlag = 0x564;
static const unsigned int Offset_FarZ = 0x56C;
static const unsigned int Offset_Color = 0x580;

static const unsigned int SetCameraLocationHint = 0x005DA380;

Expand Down

0 comments on commit c0e9d97

Please sign in to comment.