@@ -128,9 +128,9 @@ bool ExponentialHeightFog::IntersectsItself(const Ray& ray, Real& distance, Vect
|
||||
return false;
|
||||
}
|
||||
|
||||
void ExponentialHeightFog::GetVolumetricFogOptions(VolumetricFogOptions& result) const
|
||||
void ExponentialHeightFog::GetVolumetricFogOptions(const RenderView& view, VolumetricFogOptions& result) const
|
||||
{
|
||||
const float height = (float)GetPosition().Y;
|
||||
const float height = (float)(GetPosition().Y - view.Origin.Y);
|
||||
const float density = FogDensity / 1000.0f;
|
||||
const float heightFalloff = FogHeightFalloff / 1000.0f;
|
||||
|
||||
@@ -145,7 +145,7 @@ void ExponentialHeightFog::GetVolumetricFogOptions(VolumetricFogOptions& result)
|
||||
|
||||
void ExponentialHeightFog::GetExponentialHeightFogData(const RenderView& view, ShaderExponentialHeightFogData& result) const
|
||||
{
|
||||
const float height = (float)GetPosition().Y;
|
||||
const float height = (float)(GetPosition().Y - view.Origin.Y);
|
||||
const float density = FogDensity / 1000.0f;
|
||||
const float heightFalloff = FogHeightFalloff / 1000.0f;
|
||||
const float viewHeight = view.Position.Y;
|
||||
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||
|
||||
// [IFogRenderer]
|
||||
void GetVolumetricFogOptions(VolumetricFogOptions& result) const override;
|
||||
void GetVolumetricFogOptions(const RenderView& view, VolumetricFogOptions& result) const override;
|
||||
void GetExponentialHeightFogData(const RenderView& view, ShaderExponentialHeightFogData& result) const override;
|
||||
void DrawFog(GPUContext* context, RenderContext& renderContext, GPUTextureView* output) override;
|
||||
|
||||
|
||||
@@ -80,8 +80,9 @@ public:
|
||||
/// <summary>
|
||||
/// Gets the volumetric fog options.
|
||||
/// </summary>
|
||||
/// <param name="view">The rendering view.</param>
|
||||
/// <param name="result">The result.</param>
|
||||
virtual void GetVolumetricFogOptions(VolumetricFogOptions& result) const = 0;
|
||||
virtual void GetVolumetricFogOptions(const RenderView& view, VolumetricFogOptions& result) const = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the exponential height fog data.
|
||||
|
||||
@@ -228,7 +228,7 @@ void RenderFogData::Init(const RenderView& view, IFogRenderer* renderer)
|
||||
{
|
||||
Renderer = renderer;
|
||||
renderer->GetExponentialHeightFogData(view, ExponentialHeightFogData);
|
||||
renderer->GetVolumetricFogOptions(VolumetricFog);
|
||||
renderer->GetVolumetricFogOptions(view, VolumetricFog);
|
||||
if (!VolumetricFog.UseVolumetricFog())
|
||||
{
|
||||
ExponentialHeightFogData.VolumetricFogMaxDistance = -1;
|
||||
|
||||
Reference in New Issue
Block a user