mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #161 from Azaezel/alpha40_BandingBreakup
Alpha40 banding breakup
This commit is contained in:
commit
75583ca6c7
|
|
@ -138,6 +138,20 @@ namespace IBLUtilities
|
|||
GFXShaderConstHandle* prefilterMipSizeSC = prefilterShader->getShaderConstHandle("$mipSize");
|
||||
GFXShaderConstHandle* prefilterResolutionSC = prefilterShader->getShaderConstHandle("$resolution");
|
||||
|
||||
GFXStateBlockDesc desc;
|
||||
desc.zEnable = false;
|
||||
desc.samplersDefined = true;
|
||||
desc.samplers[0].addressModeU = GFXAddressClamp;
|
||||
desc.samplers[0].addressModeV = GFXAddressClamp;
|
||||
desc.samplers[0].addressModeW = GFXAddressClamp;
|
||||
desc.samplers[0].magFilter = GFXTextureFilterLinear;
|
||||
desc.samplers[0].minFilter = GFXTextureFilterLinear;
|
||||
desc.samplers[0].mipFilter = GFXTextureFilterLinear;
|
||||
|
||||
GFXStateBlockRef preStateBlock;
|
||||
preStateBlock = GFX->createStateBlock(desc);
|
||||
GFX->setStateBlock(preStateBlock);
|
||||
|
||||
GFX->pushActiveRenderTarget();
|
||||
GFX->setShader(prefilterShader);
|
||||
GFX->setShaderConstBuffer(prefilterConsts);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "materials/shaderData.h"
|
||||
|
||||
#include "gfx/gfxTextureManager.h"
|
||||
#include "scene/reflectionManager.h"
|
||||
|
||||
#include "postFx/postEffect.h"
|
||||
#include "T3D/lighting/reflectionProbe.h"
|
||||
|
|
@ -930,6 +931,14 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
if (!renderWithProbes)
|
||||
RenderProbeMgr::smRenderReflectionProbes = false;
|
||||
|
||||
GFXFormat reflectFormat;
|
||||
|
||||
if (clientProbe->mUseHDRCaptures)
|
||||
reflectFormat = GFXFormatR16G16B16A16F;
|
||||
else
|
||||
reflectFormat = GFXFormatR8G8B8A8;
|
||||
const GFXFormat oldRefFmt = REFLECTMGR->getReflectFormat();
|
||||
REFLECTMGR->setReflectFormat(reflectFormat);
|
||||
cubeRefl.updateReflection(reflParams);
|
||||
|
||||
//Now, save out the maps
|
||||
|
|
@ -940,16 +949,8 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
clientProbe->createClientResources();
|
||||
|
||||
//Prep it with whatever resolution we've dictated for our bake
|
||||
if (clientProbe->mUseHDRCaptures)
|
||||
{
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, GFXFormatR16G16B16A16F);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, GFXFormatR16G16B16A16F);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, GFXFormatR8G8B8A8);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, GFXFormatR8G8B8A8);
|
||||
}
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, reflectFormat);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, reflectFormat);
|
||||
|
||||
GFXTextureTargetRef renderTarget = GFX->allocRenderToTextureTarget(false);
|
||||
|
||||
|
|
@ -980,6 +981,7 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
probe->setMaskBits(-1);
|
||||
|
||||
Con::warnf("RenderProbeMgr::bake() - Finished bake! Took %g milliseconds", diffTime);
|
||||
REFLECTMGR->setReflectFormat(oldRefFmt);
|
||||
}
|
||||
|
||||
void RenderProbeMgr::bakeProbes()
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ function HDRPostFX::onEnabled( %this )
|
|||
// Set the right global shader define for HDR.
|
||||
if ( %format $= "GFXFormatR10G10B10A2" )
|
||||
addGlobalShaderMacro( "TORQUE_HDR_RGB10" );
|
||||
else if ( %format $= "GFXFormatR16G16B16A16" )
|
||||
else if ( %format $= "GFXFormatR16G16B16A16F" )
|
||||
addGlobalShaderMacro( "TORQUE_HDR_RGB16" );
|
||||
|
||||
echo( "HDR FORMAT: " @ %format );
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function initRenderManager()
|
|||
enabled = "false";
|
||||
|
||||
//When hdr is enabled this will be changed to the appropriate format
|
||||
format = "GFXFormatR8G8B8A8_SRGB";
|
||||
format = "GFXFormatR16G16B16A16F";
|
||||
depthFormat = "GFXFormatD24S8";
|
||||
aaLevel = 0; // -1 = match backbuffer
|
||||
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ float3 boxProject(float3 wsPosition, float3 wsReflectVec, float4x4 worldToObj, f
|
|||
float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z);
|
||||
float3 posonbox = wsPosition + wsReflectVec * dist;
|
||||
|
||||
return posonbox - refPosition.xyz;
|
||||
return posonbox-refPosition;
|
||||
}
|
||||
|
||||
float4 computeForwardProbes(Surface surface,
|
||||
|
|
|
|||
Loading…
Reference in a new issue