Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correction of "Render fog zones in Gothic 1" for Gothic 1.12f commited 11.02.2024 by ThielHater #167

Merged
merged 1 commit into from
Aug 19, 2024
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
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
Loading