Add various minor improvements
This commit is contained in:
BIN
Content/Shaders/PostProcessing.flax
(Stored with Git LFS)
BIN
Content/Shaders/PostProcessing.flax
(Stored with Git LFS)
Binary file not shown.
@@ -120,6 +120,8 @@ namespace FlaxEditor.Surface
|
|||||||
|
|
||||||
private void UpdateSelectionRectangle()
|
private void UpdateSelectionRectangle()
|
||||||
{
|
{
|
||||||
|
if (Root == null)
|
||||||
|
return;
|
||||||
var p1 = _rootControl.PointFromParent(ref _leftMouseDownPos);
|
var p1 = _rootControl.PointFromParent(ref _leftMouseDownPos);
|
||||||
var p2 = _rootControl.PointFromParent(ref _mousePos);
|
var p2 = _rootControl.PointFromParent(ref _mousePos);
|
||||||
var selectionRect = Rectangle.FromPoints(p1, p2);
|
var selectionRect = Rectangle.FromPoints(p1, p2);
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ void WheeledVehicle::SetThrottle(float value)
|
|||||||
_throttle = Math::Clamp(value, -1.0f, 1.0f);
|
_throttle = Math::Clamp(value, -1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float WheeledVehicle::GetThrottle()
|
float WheeledVehicle::GetThrottle() const
|
||||||
{
|
{
|
||||||
return _throttle;
|
return _throttle;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
/// 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>
|
/// </summary>
|
||||||
/// <returns>The vehicle throttle.</returns>
|
/// <returns>The vehicle throttle.</returns>
|
||||||
API_FUNCTION() float GetThrottle();
|
API_FUNCTION() float GetThrottle() const;
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// 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.
|
||||||
|
|||||||
@@ -496,7 +496,9 @@ protected:
|
|||||||
#define PxHitFlagEmpty (PxHitFlags)0
|
#define PxHitFlagEmpty (PxHitFlags)0
|
||||||
#define SCENE_QUERY_FLAGS (PxHitFlag::ePOSITION | PxHitFlag::eNORMAL | PxHitFlag::eFACE_INDEX | PxHitFlag::eUV)
|
#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; \
|
PxQueryFilterData filterData; \
|
||||||
filterData.flags |= PxQueryFlag::ePREFILTER; \
|
filterData.flags |= PxQueryFlag::ePREFILTER; \
|
||||||
filterData.data.word0 = layerMask; \
|
filterData.data.word0 = layerMask; \
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ GPUTexture* ColorGradingPass::RenderLUT(RenderContext& renderContext)
|
|||||||
// Check if LUT parameter hasn't been changed since the last time
|
// Check if LUT parameter hasn't been changed since the last time
|
||||||
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
|
if (Platform::MemoryCompare(&colorGradingBuffer.CachedData , &data, sizeof(Data)) == 0 &&
|
||||||
colorGradingBuffer.Mode == toneMapping.Mode &&
|
colorGradingBuffer.Mode == toneMapping.Mode &&
|
||||||
|
Engine::FrameCount > 30 && // Skip caching when engine is starting TODO: find why this hack is needed
|
||||||
colorGradingBuffer.LutTexture == lutTexture)
|
colorGradingBuffer.LutTexture == lutTexture)
|
||||||
{
|
{
|
||||||
// Resue existing texture
|
// Resue existing texture
|
||||||
|
|||||||
@@ -367,15 +367,19 @@ void PostProcessingPass::Render(RenderContext& renderContext, GPUTexture* input,
|
|||||||
// Bloom
|
// Bloom
|
||||||
|
|
||||||
auto tempDesc = GPUTextureDescription::New2D(w2, h2, bloomMipCount, output->Format(), GPUTextureFlags::ShaderResource | GPUTextureFlags::RenderTarget | GPUTextureFlags::PerMipViews);
|
auto tempDesc = GPUTextureDescription::New2D(w2, h2, bloomMipCount, output->Format(), GPUTextureFlags::ShaderResource | GPUTextureFlags::RenderTarget | GPUTextureFlags::PerMipViews);
|
||||||
auto bloomBuffer1 = RenderTargetPool::Get(tempDesc);
|
GPUTexture* bloomBuffer1 = nullptr, *bloomBuffer2 = nullptr;
|
||||||
RENDER_TARGET_POOL_SET_NAME(bloomBuffer1, "PostProcessing.Bloom");
|
if (useBloom || useLensFlares)
|
||||||
auto bloomBuffer2 = RenderTargetPool::Get(tempDesc);
|
|
||||||
RENDER_TARGET_POOL_SET_NAME(bloomBuffer2, "PostProcessing.Bloom");
|
|
||||||
|
|
||||||
for (int32 mip = 0; mip < bloomMipCount; mip++)
|
|
||||||
{
|
{
|
||||||
context->Clear(bloomBuffer1->View(0, mip), Color::Transparent);
|
bloomBuffer1 = RenderTargetPool::Get(tempDesc);
|
||||||
context->Clear(bloomBuffer2->View(0, mip), Color::Transparent);
|
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)
|
if (useBloom)
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ float4 PS_Composite(Quad_VS2PS input) : SV_Target
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
color = Input0.Sample(SamplerLinearClamp, uv);
|
color = Input0.Sample(SamplerPointClamp, uv);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lens Flares
|
// Lens Flares
|
||||||
|
|||||||
Reference in New Issue
Block a user