lighting single buffer

This commit is contained in:
Tim Barnes 2018-11-21 15:53:02 +10:00
parent c4a4fe5304
commit 9e65e940d0
37 changed files with 309 additions and 813 deletions

View file

@ -144,6 +144,8 @@ ReflectionProbe::ReflectionProbe()
mEditPosOffset = false;
mProbeInfoIdx = -1;
mCaptureMask = REFLECTION_PROBE_CAPTURE_TYPEMASK;
}
ReflectionProbe::~ReflectionProbe()
@ -620,9 +622,9 @@ bool ReflectionProbe::createClientResources()
//brdf lookup resources
//make the brdf lookup texture the same size as the prefilter texture
String brdfPath = Con::getVariable("$Core::BRDFTexture", "core/art/brdfTexture.dds");
String brdfPath = Con::getVariable("$Core::BRDFTexture", "core/art/pbr/brdfTexture.dds");
mBrdfTexture = TEXMGR->createTexture(brdfPath, &GFXTexturePersistentProfile);// TEXMGR->createTexture(mPrefilterSize, mPrefilterSize, GFXFormatR16G16B16A16F, &GFXRenderTargetProfile, 1, 0);
mBrdfTexture = TEXMGR->createTexture(brdfPath, &GFXTexturePersistentProfile);
if (!mBrdfTexture)
{
@ -978,7 +980,7 @@ void ReflectionProbe::bake(String outputPath, S32 resolution, bool renderWithPro
MathUtils::makeFrustum(&left, &right, &top, &bottom, M_HALFPI_F, 1.0f, nearPlane);
Frustum frustum(false, left, right, top, bottom, nearPlane, farDist);
renderFrame(&baseTarget, matView, frustum, StaticObjectType | StaticShapeObjectType & EDITOR_RENDER_TYPEMASK, gCanvasClearColor);
renderFrame(&baseTarget, matView, frustum, mCaptureMask & EDITOR_RENDER_TYPEMASK, gCanvasClearColor);
baseTarget->resolve();
}

View file

@ -169,6 +169,7 @@ protected:
F32 mMaxDrawDistance;
bool mResourcesCreated;
U32 mCaptureMask;
public:
ReflectionProbe();
@ -242,6 +243,8 @@ public:
String getPrefilterMapPath();
String getIrradianceMapPath();
void bake(String outputPath, S32 resolution, bool renderWithProbes = false);
const U32 getProbeInfoIndex() { return mProbeInfoIdx; }
};
typedef ProbeRenderInst::ProbeShapeType ReflectProbeType;

View file

@ -78,7 +78,7 @@ ConsoleDocClass(Skylight,
//-----------------------------------------------------------------------------
Skylight::Skylight() : ReflectionProbe()
{
mCaptureMask = SKYLIGHT_CAPTURE_TYPEMASK;
}
Skylight::~Skylight()

View file

@ -216,7 +216,10 @@ enum SceneObjectTypeMasks : U32
///
/// @note Terrains have their own means for rendering inside interior zones.
OUTDOOR_OBJECT_TYPEMASK = ( TerrainObjectType |
EnvironmentObjectType )
EnvironmentObjectType ),
SKYLIGHT_CAPTURE_TYPEMASK = (EnvironmentObjectType),
REFLECTION_PROBE_CAPTURE_TYPEMASK = (StaticObjectType | StaticShapeObjectType)
};
#endif