|
@@ -21,6 +21,7 @@
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
#include "gfx/util/screenspace.h"
|
|
#include "gfx/util/screenspace.h"
|
|
|
|
+#include "gfx/gfxDevice.h"
|
|
|
|
|
|
// The conversion from screen space to the render target
|
|
// The conversion from screen space to the render target
|
|
// is made more complex because screen space is relative
|
|
// is made more complex because screen space is relative
|
|
@@ -41,9 +42,11 @@ void ScreenSpace::RenderTargetParameters(const Point3I &targetSize, const RectI
|
|
Point2F targetScale( (F32)targetViewport.extent.x / (F32)targetSize.x,
|
|
Point2F targetScale( (F32)targetViewport.extent.x / (F32)targetSize.x,
|
|
(F32)targetViewport.extent.y / (F32)targetSize.y );
|
|
(F32)targetViewport.extent.y / (F32)targetSize.y );
|
|
|
|
|
|
|
|
+ bool hasTexelPixelOffset = GFX->getAdapterType() == Direct3D9;
|
|
|
|
+
|
|
// Get the target half pixel size.
|
|
// Get the target half pixel size.
|
|
- const Point2F halfPixel( 0.5f / targetSize.x,
|
|
|
|
- 0.5f / targetSize.y );
|
|
|
|
|
|
+ const Point2F halfPixel( hasTexelPixelOffset ? 0.5f / targetSize.x : 0.0,
|
|
|
|
+ hasTexelPixelOffset ? 0.5f / targetSize.y : 0.0);
|
|
|
|
|
|
rtParams.set( targetOffset.x + halfPixel.x,
|
|
rtParams.set( targetOffset.x + halfPixel.x,
|
|
targetOffset.y + halfPixel.y,
|
|
targetOffset.y + halfPixel.y,
|