Add various minor improvements

This commit is contained in:
Wojtek Figat
2025-08-11 13:23:46 +02:00
parent c946fa239e
commit a18314c669
8 changed files with 23 additions and 14 deletions

BIN
Content/Shaders/PostProcessing.flax (Stored with Git LFS)

Binary file not shown.

View File

@@ -120,6 +120,8 @@ namespace FlaxEditor.Surface
private void UpdateSelectionRectangle()
{
if (Root == null)
return;
var p1 = _rootControl.PointFromParent(ref _leftMouseDownPos);
var p2 = _rootControl.PointFromParent(ref _mousePos);
var selectionRect = Rectangle.FromPoints(p1, p2);

View File

@@ -191,7 +191,7 @@ void WheeledVehicle::SetThrottle(float value)
_throttle = Math::Clamp(value, -1.0f, 1.0f);
}
float WheeledVehicle::GetThrottle()
float WheeledVehicle::GetThrottle() const
{
return _throttle;
}

View File

@@ -545,7 +545,7 @@ public:
/// Get the vehicle throttle. It is the analog accelerator pedal value in range (0,1) where 1 represents the pedal fully pressed and 0 represents the pedal in its rest state.
/// </summary>
/// <returns>The vehicle throttle.</returns>
API_FUNCTION() float GetThrottle();
API_FUNCTION() float GetThrottle() const;
/// <summary>
/// Sets the input for vehicle steering. Steer is the analog steer value in range (-1,1) where -1 represents the steering wheel at left lock and +1 represents the steering wheel at right lock.

View File

@@ -496,7 +496,9 @@ protected:
#define PxHitFlagEmpty (PxHitFlags)0
#define SCENE_QUERY_FLAGS (PxHitFlag::ePOSITION | PxHitFlag::eNORMAL | PxHitFlag::eFACE_INDEX | PxHitFlag::eUV)
#define SCENE_QUERY_SETUP(blockSingle) auto scenePhysX = (ScenePhysX*)scene; if (scene == nullptr) return false; \
#define SCENE_QUERY_SETUP(blockSingle) PROFILE_CPU(); \
auto scenePhysX = (ScenePhysX*)scene; \
if (scene == nullptr) return false; \
PxQueryFilterData filterData; \
filterData.flags |= PxQueryFlag::ePREFILTER; \
filterData.data.word0 = layerMask; \

View File

@@ -194,6 +194,7 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
// Check if LUT parameter hasn't been changed since the last time
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
colorGradingBuffer.Mode == toneMapping.Mode &&
Engine::FrameCount > 30 && // Skip caching when engine is starting TODO: find why this hack is needed
colorGradingBuffer.LutTexture == lutTexture)
{
// Resue existing texture

View File

@@ -367,15 +367,19 @@ void PostProcessingPass::Render(RenderContext& renderContext, GPUTexture* input,
// Bloom
auto tempDesc = GPUTextureDescription::New2D(w2, h2, bloomMipCount, output->Format(), GPUTextureFlags::ShaderResource | GPUTextureFlags::RenderTarget | GPUTextureFlags::PerMipViews);
auto bloomBuffer1 = RenderTargetPool::Get(tempDesc);
RENDER_TARGET_POOL_SET_NAME(bloomBuffer1, "PostProcessing.Bloom");
auto bloomBuffer2 = RenderTargetPool::Get(tempDesc);
RENDER_TARGET_POOL_SET_NAME(bloomBuffer2, "PostProcessing.Bloom");
for (int32 mip = 0; mip < bloomMipCount; mip++)
GPUTexture* bloomBuffer1 = nullptr, *bloomBuffer2 = nullptr;
if (useBloom || useLensFlares)
{
context->Clear(bloomBuffer1->View(0, mip), Color::Transparent);
context->Clear(bloomBuffer2->View(0, mip), Color::Transparent);
bloomBuffer1 = RenderTargetPool::Get(tempDesc);
bloomBuffer2 = RenderTargetPool::Get(tempDesc);
RENDER_TARGET_POOL_SET_NAME(bloomBuffer1, "PostProcessing.Bloom");
RENDER_TARGET_POOL_SET_NAME(bloomBuffer2, "PostProcessing.Bloom");
for (int32 mip = 0; mip < bloomMipCount; mip++)
{
context->Clear(bloomBuffer1->View(0, mip), Color::Transparent);
context->Clear(bloomBuffer2->View(0, mip), Color::Transparent);
}
}
if (useBloom)

View File

@@ -650,7 +650,7 @@ float4 PS_Composite(Quad_VS2PS input) : SV_Target
}
else
{
color = Input0.Sample(SamplerLinearClamp, uv);
color = Input0.Sample(SamplerPointClamp, uv);
}
// Lens Flares