From b40d33a663d6e027a186e4e7a4cc15d841c1e008 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 5 Jun 2019 01:04:47 -0500 Subject: [PATCH 1/3] WIP of shifting the skylight cubemap to be packed into the cubemap array --- .../source/T3D/lighting/reflectionProbe.cpp | 8 +- .../source/renderInstance/renderProbeMgr.cpp | 128 ++++++++---------- Engine/source/renderInstance/renderProbeMgr.h | 10 +- .../advanced/reflectionProbeArrayP.hlsl | 7 +- 4 files changed, 63 insertions(+), 90 deletions(-) diff --git a/Engine/source/T3D/lighting/reflectionProbe.cpp b/Engine/source/T3D/lighting/reflectionProbe.cpp index 6fccb3d05..671433878 100644 --- a/Engine/source/T3D/lighting/reflectionProbe.cpp +++ b/Engine/source/T3D/lighting/reflectionProbe.cpp @@ -638,8 +638,7 @@ void ReflectionProbe::processBakedCubemap() mProbeInfo->mIsEnabled = true; //Update the probe manager with our new texture! - if (!mProbeInfo->mIsSkylight) - PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); + PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); } } @@ -730,8 +729,7 @@ void ReflectionProbe::processStaticCubemap() mProbeInfo->mIsEnabled = true; //Update the probe manager with our new texture! - if (!mProbeInfo->mIsSkylight) - PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); + PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); } } @@ -739,7 +737,7 @@ bool ReflectionProbe::createClientResources() { if (mProbeInfo == nullptr) { - mProbeInfo = PROBEMGR->registerProbe(mProbeShapeType == ProbeRenderInst::Skylight); + mProbeInfo = PROBEMGR->registerProbe(); if (!mProbeInfo) return false; diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 878253e93..74603dd81 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -314,51 +314,47 @@ void RenderProbeMgr::addElement(RenderInst *inst) }*/ } -ProbeRenderInst* RenderProbeMgr::registerProbe(const bool &isSkylight) +ProbeRenderInst* RenderProbeMgr::registerProbe() { ProbeRenderInst newProbe; - newProbe.mIsSkylight = isSkylight; mRegisteredProbes.push_back(newProbe); newProbe.mProbeIdx = mRegisteredProbes.size(); - if (!newProbe.mIsSkylight) + const U32 cubeIndex = _findNextEmptyCubeSlot(); + if (cubeIndex == INVALID_CUBE_SLOT) { - const U32 cubeIndex = _findNextEmptyCubeSlot(); - if (cubeIndex == INVALID_CUBE_SLOT) - { - Con::warnf("RenderProbeMgr::addProbe: Invalid cubemap slot."); - return nullptr; - } - - //check if we need to resize the cubemap array - if (cubeIndex >= mCubeSlotCount) - { - //alloc temp array handles - GFXCubemapArrayHandle irr = GFXCubemapArrayHandle(GFX->createCubemapArray()); - GFXCubemapArrayHandle prefilter = GFXCubemapArrayHandle(GFX->createCubemapArray()); - - irr->init(mCubeSlotCount + PROBE_ARRAY_SLOT_BUFFER_SIZE, PROBE_IRRAD_SIZE, PROBE_FORMAT); - prefilter->init(mCubeSlotCount + PROBE_ARRAY_SLOT_BUFFER_SIZE, PROBE_PREFILTER_SIZE, PROBE_FORMAT); - - mIrradianceArray->copyTo(irr); - mPrefilterArray->copyTo(prefilter); - - //assign the temp handles to the new ones, this will destroy the old ones as well - mIrradianceArray = irr; - mPrefilterArray = prefilter; - - mCubeSlotCount += PROBE_ARRAY_SLOT_BUFFER_SIZE; - } - - newProbe.mCubemapIndex = cubeIndex; - //mark cubemap slot as taken - mCubeMapSlots[cubeIndex] = true; - mCubeMapCount++; - - Con::warnf("RenderProbeMgr::registerProbe: Registered probe %u to cubeIndex %u", newProbe.mProbeIdx, cubeIndex); + Con::warnf("RenderProbeMgr::addProbe: Invalid cubemap slot."); + return nullptr; } + //check if we need to resize the cubemap array + if (cubeIndex >= mCubeSlotCount) + { + //alloc temp array handles + GFXCubemapArrayHandle irr = GFXCubemapArrayHandle(GFX->createCubemapArray()); + GFXCubemapArrayHandle prefilter = GFXCubemapArrayHandle(GFX->createCubemapArray()); + + irr->init(mCubeSlotCount + PROBE_ARRAY_SLOT_BUFFER_SIZE, PROBE_IRRAD_SIZE, PROBE_FORMAT); + prefilter->init(mCubeSlotCount + PROBE_ARRAY_SLOT_BUFFER_SIZE, PROBE_PREFILTER_SIZE, PROBE_FORMAT); + + mIrradianceArray->copyTo(irr); + mPrefilterArray->copyTo(prefilter); + + //assign the temp handles to the new ones, this will destroy the old ones as well + mIrradianceArray = irr; + mPrefilterArray = prefilter; + + mCubeSlotCount += PROBE_ARRAY_SLOT_BUFFER_SIZE; + } + + newProbe.mCubemapIndex = cubeIndex; + //mark cubemap slot as taken + mCubeMapSlots[cubeIndex] = true; + mCubeMapCount++; + + Con::warnf("RenderProbeMgr::registerProbe: Registered probe %u to cubeIndex %u", newProbe.mProbeIdx, cubeIndex); + mProbesDirty = true; return &mRegisteredProbes.last(); @@ -416,6 +412,7 @@ void RenderProbeMgr::_setupStaticParameters() mMipCount = 0; mHasSkylight = false; + mSkylightCubemapIdx = -1; if (probePositionsData.size() != MAXPROBECOUNT) { @@ -434,19 +431,9 @@ void RenderProbeMgr::_setupStaticParameters() probeBBMaxData.fill(Point4F::Zero); probeConfigData.fill(Point4F::Zero); - cubeMaps.clear(); - irradMaps.clear(); Vector cubemapIdxes; - if (probeCount != 0 && mRegisteredProbes[0].mPrefilterCubemap != nullptr) - { - //Get our mipCount - mMipCount = mRegisteredProbes[0].mPrefilterCubemap.getPointer()->getMipMapLevels(); - } - else - { - mMipCount = 1; - } + mMipCount = 1; for (U32 i = 0; i < probeCount; i++) { @@ -457,11 +444,12 @@ void RenderProbeMgr::_setupStaticParameters() if (!curEntry.mIsEnabled) continue; + U32 mips = mRegisteredProbes[0].mPrefilterCubemap.getPointer()->getMipMapLevels(); + mMipCount = mips != 0 && mips > mMipCount ? mips : 0; + if (curEntry.mProbeShapeType == ProbeRenderInst::ProbeShapeType::Skylight || curEntry.mIsSkylight) { - skylightPos = curEntry.getPosition(); - skylightPrefilterMap = curEntry.mPrefilterCubemap; - skylightIrradMap = curEntry.mIrradianceCubemap; + mSkylightCubemapIdx = curEntry.mCubemapIndex; mHasSkylight = true; continue; } @@ -483,9 +471,6 @@ void RenderProbeMgr::_setupStaticParameters() curEntry.mAtten, curEntry.mCubemapIndex); - cubeMaps.push_back(curEntry.mPrefilterCubemap); - irradMaps.push_back(curEntry.mIrradianceCubemap); - cubemapIdxes.push_back(i); mEffectiveProbeCount++; @@ -499,10 +484,6 @@ void RenderProbeMgr::updateProbeTexture(U32 probeIdx) if (probeIdx >= mRegisteredProbes.size()) return; - //We don't stuff skylights into the array, so we can just skip out on this if it's a skylight - if (mRegisteredProbes[probeIdx].mIsSkylight) - return; - const U32 cubeIndex = mRegisteredProbes[probeIdx].mCubemapIndex; mIrradianceArray->updateTexture(mRegisteredProbes[probeIdx].mIrradianceCubemap, cubeIndex); mPrefilterArray->updateTexture(mRegisteredProbes[probeIdx].mPrefilterCubemap, cubeIndex); @@ -758,7 +739,7 @@ void RenderProbeMgr::render( SceneRenderState *state ) _setupStaticParameters(); // Early out if nothing to draw. - if (!RenderProbeMgr::smRenderReflectionProbes || !state->isDiffusePass() || (!mRegisteredProbes.size() || mEffectiveProbeCount == 0 || mCubeMapCount != 0 ) && !mHasSkylight) + if (!RenderProbeMgr::smRenderReflectionProbes || !state->isDiffusePass() || (mRegisteredProbes.size() == 0 || (mEffectiveProbeCount == 0 && !mHasSkylight))) { getProbeArrayEffect()->setSkip(true); return; @@ -772,7 +753,7 @@ void RenderProbeMgr::render( SceneRenderState *state ) // the vector light material as we use lazy creation. //_setupPerFrameParameters(state); - //Visualization + //Visualization String useDebugAtten = Con::getVariable("$Probes::showAttenuation", "0"); mProbeArrayEffect->setShaderMacro("DEBUGVIZ_ATTENUATION", useDebugAtten); @@ -785,14 +766,17 @@ void RenderProbeMgr::render( SceneRenderState *state ) String useDebugContrib = Con::getVariable("$Probes::showProbeContrib", "0"); mProbeArrayEffect->setShaderMacro("DEBUGVIZ_CONTRIB", useDebugContrib); - //Array rendering - //U32 probeCount = mRegisteredProbes.size(); + if (mHasSkylight || mEffectiveProbeCount != 0) + { + mProbeArrayEffect->setTexture(3, mBRDFTexture); + mProbeArrayEffect->setCubemapArrayTexture(4, mPrefilterArray); + mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray); + } mProbeArrayEffect->setShaderConst("$hasSkylight", (float)mHasSkylight); if (mHasSkylight) { - mProbeArrayEffect->setCubemapTexture(6, skylightPrefilterMap); - mProbeArrayEffect->setCubemapTexture(7, skylightIrradMap); + mProbeArrayEffect->setShaderConst("$skylightCubemapIdx", mSkylightCubemapIdx); } mProbeArrayEffect->setShaderConst("$numProbes", (float)mEffectiveProbeCount); @@ -800,10 +784,6 @@ void RenderProbeMgr::render( SceneRenderState *state ) mProbeArrayEffect->setShaderConst("$cubeMips", (float)mMipCount); if (mEffectiveProbeCount != 0) { - mProbeArrayEffect->setTexture(3, mBRDFTexture); - mProbeArrayEffect->setCubemapArrayTexture(4, mPrefilterArray); - mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray); - if (useDebugContrib == String("1")) { MRandomLCG RandomGen; @@ -829,14 +809,14 @@ void RenderProbeMgr::render( SceneRenderState *state ) mProbeArrayEffect->setShaderConst("$probeContribColors", contribColors); } - } - mProbeArrayEffect->setShaderConst("$inProbePosArray", probePositionsData); - mProbeArrayEffect->setShaderConst("$inRefPosArray", probeRefPositionsData); - mProbeArrayEffect->setShaderConst("$worldToObjArray", probeWorldToObjData); - mProbeArrayEffect->setShaderConst("$bbMinArray", probeBBMinData); - mProbeArrayEffect->setShaderConst("$bbMaxArray", probeBBMaxData); - mProbeArrayEffect->setShaderConst("$probeConfigData", probeConfigData); + mProbeArrayEffect->setShaderConst("$inProbePosArray", probePositionsData); + mProbeArrayEffect->setShaderConst("$inRefPosArray", probeRefPositionsData); + mProbeArrayEffect->setShaderConst("$worldToObjArray", probeWorldToObjData); + mProbeArrayEffect->setShaderConst("$bbMinArray", probeBBMinData); + mProbeArrayEffect->setShaderConst("$bbMaxArray", probeBBMaxData); + mProbeArrayEffect->setShaderConst("$probeConfigData", probeConfigData); + } // Make sure the effect is gonna render. getProbeArrayEffect()->setSkip(false); diff --git a/Engine/source/renderInstance/renderProbeMgr.h b/Engine/source/renderInstance/renderProbeMgr.h index 560410188..8eba74431 100644 --- a/Engine/source/renderInstance/renderProbeMgr.h +++ b/Engine/source/renderInstance/renderProbeMgr.h @@ -199,13 +199,9 @@ class RenderProbeMgr : public RenderBinManager Vector probeBBMinData; Vector probeBBMaxData; Vector probeConfigData; - Vector cubeMaps; - Vector irradMaps; - bool mHasSkylight; - GFXCubemapHandle skylightIrradMap; - GFXCubemapHandle skylightPrefilterMap; - Point4F skylightPos; + bool mHasSkylight; + S32 mSkylightCubemapIdx; AlignedArray mProbePositions; AlignedArray mProbeBBMin; @@ -286,7 +282,7 @@ public: /// Returns the active LM. static inline RenderProbeMgr* getProbeManager(); - ProbeRenderInst* registerProbe(const bool& isSkylight); + ProbeRenderInst* registerProbe(); void unregisterProbe(U32 probeIdx); virtual void setProbeInfo(ProcessedMaterial *pmat, diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl index ea2ca7641..9ded5bd1b 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -31,9 +31,8 @@ uniform float4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten uniform float4 probeContribColors[MAX_PROBES]; #endif -TORQUE_UNIFORM_SAMPLERCUBE(skylightSpecularMap, 6); -TORQUE_UNIFORM_SAMPLERCUBE(skylightIrradMap, 7); uniform float hasSkylight; +uniform float skylightCubemapIdx; float4 main(PFXVertToPix IN) : SV_TARGET { @@ -173,8 +172,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET if (hasSkylight && alpha > 0.001) { - irradiance += TORQUE_TEXCUBELOD(skylightIrradMap, float4(surface.R, 0)).xyz * alpha; - specular += TORQUE_TEXCUBELOD(skylightSpecularMap, float4(surface.R, lod)).xyz * alpha; + irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz * alpha; + specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz * alpha; } #if DEBUGVIZ_SPECCUBEMAP == 1 && DEBUGVIZ_DIFFCUBEMAP == 0 From dd3422b5a268ba71418b1f241d59bcc99d3a44ab Mon Sep 17 00:00:00 2001 From: Areloch Date: Thu, 13 Jun 2019 00:37:12 -0500 Subject: [PATCH 2/3] Added ability to pass ints to post effect shader consts Reorg'd probe init to flow better and be more robust on load Cleaned up various parts of the probe render manager to be more stable Fixed issue with crash on release due to numProbe in loops being 0 Updated glsl probe array shader Beginning of rework of editor settings Beginning of conversion of asset import config to similar system as editor settings --- .../source/T3D/lighting/reflectionProbe.cpp | 20 +- Engine/source/T3D/lighting/reflectionProbe.h | 3 - Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp | 4 +- .../materials/processedCustomMaterial.cpp | 2 +- .../materials/processedShaderMaterial.cpp | 2 +- Engine/source/postFx/postEffect.cpp | 39 ++++ Engine/source/postFx/postEffect.h | 12 ++ .../source/renderInstance/renderProbeMgr.cpp | 107 +++++------ Engine/source/renderInstance/renderProbeMgr.h | 2 +- Engine/source/util/settings.cpp | 2 +- .../scripts/advancedLighting_Shaders.cs | 5 - .../advanced/gl/reflectionProbeArrayP.glsl | 46 +++-- .../advanced/gl/reflectionProbeP.glsl | 162 ---------------- .../advanced/gl/reflectionProbeV.glsl | 32 ---- .../advanced/reflectionProbeArrayP.hlsl | 71 +++---- .../assetBrowser/scripts/assetBrowser.cs | 2 +- .../tools/assetBrowser/scripts/assetImport.cs | 23 +-- .../BaseGame/game/tools/gui/profiles.ed.cs | 2 +- Templates/BaseGame/game/tools/settings.xml | 173 +++++++++--------- .../BaseGame/game/tools/worldEditor/main.cs | 7 +- Templates/Full/game/Full.torsion.opt | 4 +- 21 files changed, 300 insertions(+), 420 deletions(-) delete mode 100644 Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl delete mode 100644 Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl diff --git a/Engine/source/T3D/lighting/reflectionProbe.cpp b/Engine/source/T3D/lighting/reflectionProbe.cpp index 671433878..8c6f11cfe 100644 --- a/Engine/source/T3D/lighting/reflectionProbe.cpp +++ b/Engine/source/T3D/lighting/reflectionProbe.cpp @@ -89,7 +89,11 @@ ImplementEnumType(ReflectionModeEnum, //----------------------------------------------------------------------------- // Object setup and teardown //----------------------------------------------------------------------------- -ReflectionProbe::ReflectionProbe() +ReflectionProbe::ReflectionProbe() : + cubeDescId(0), + reflectorDesc(nullptr), + mSphereVertCount(0), + mSpherePrimitiveCount(0) { // Flag this object so that it will always // be sent across the network to clients @@ -247,11 +251,11 @@ bool ReflectionProbe::_setReflectionMode(void *object, const char *index, const { ReflectionProbe* probe = reinterpret_cast(object); - if (data == "Static Cubemap") + if (!dStrcmp(data,"Static Cubemap")) { probe->mReflectionModeType = StaticCubemap; } - else if (data == "Baked Cubemap") + else if (!dStrcmp(data, "Baked Cubemap")) { //Clear our cubemap if we changed it to be baked, just for cleanliness probe->mReflectionModeType = BakedCubemap; @@ -589,6 +593,8 @@ void ReflectionProbe::processDynamicCubemap() else mProbeInfo->mIsEnabled = false; + mCubemapDirty = false; + //Update the probe manager with our new texture! //if (!mProbeInfo->mIsSkylight && mProbeInfo->mPrefilterCubemap->isInitialized() && mProbeInfo->mIrradianceCubemap->isInitialized()) // PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); @@ -637,8 +643,10 @@ void ReflectionProbe::processBakedCubemap() { mProbeInfo->mIsEnabled = true; + mCubemapDirty = false; + //Update the probe manager with our new texture! - PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); + PROBEMGR->updateProbeTexture(mProbeInfo); } } @@ -728,8 +736,10 @@ void ReflectionProbe::processStaticCubemap() { mProbeInfo->mIsEnabled = true; + mCubemapDirty = false; + //Update the probe manager with our new texture! - PROBEMGR->updateProbeTexture(mProbeInfo->mProbeIdx); + PROBEMGR->updateProbeTexture(mProbeInfo); } } diff --git a/Engine/source/T3D/lighting/reflectionProbe.h b/Engine/source/T3D/lighting/reflectionProbe.h index 61d0b58db..4c40f5e2b 100644 --- a/Engine/source/T3D/lighting/reflectionProbe.h +++ b/Engine/source/T3D/lighting/reflectionProbe.h @@ -151,9 +151,6 @@ protected: U32 mDynamicLastBakeMS; U32 mRefreshRateMS; - GBitmap* mCubeFaceBitmaps[6]; - U32 mCubemapResolution; - F32 mMaxDrawDistance; bool mResourcesCreated; diff --git a/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp b/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp index 1451df186..abf26218d 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Cubemap.cpp @@ -26,7 +26,7 @@ #include "gfx/D3D11/gfxD3D11EnumTranslate.h" #include "gfx/bitmap/imageUtils.h" -GFXD3D11Cubemap::GFXD3D11Cubemap() : mTexture(NULL), mSRView(NULL), mDSView(NULL) +GFXD3D11Cubemap::GFXD3D11Cubemap() : mTexture(NULL), mSRView(NULL), mDSView(NULL), mTexSize(0) { mDynamic = false; mAutoGenMips = false; @@ -568,4 +568,4 @@ void GFXD3D11CubemapArray::zombify() void GFXD3D11CubemapArray::resurrect() { // Static cubemaps are handled by D3D -} \ No newline at end of file +} diff --git a/Engine/source/materials/processedCustomMaterial.cpp b/Engine/source/materials/processedCustomMaterial.cpp index 7c3b04bd6..a6c03cfba 100644 --- a/Engine/source/materials/processedCustomMaterial.cpp +++ b/Engine/source/materials/processedCustomMaterial.cpp @@ -541,4 +541,4 @@ MaterialParameters* ProcessedCustomMaterial::allocMaterialParameters() } } return ret; -} \ No newline at end of file +} diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index 5c911be1e..6b2b0632a 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -1360,7 +1360,7 @@ void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const Scene LIGHTMGR->setLightInfo(this, mMaterial, sgData, state, pass, shaderConsts); - PROBEMGR->setProbeInfo(this, mMaterial, sgData, state, pass, shaderConsts); + //PROBEMGR->setProbeInfo(this, mMaterial, sgData, state, pass, shaderConsts); } void ProcessedShaderMaterial::setBuffers( GFXVertexBufferHandleBase *vertBuffer, GFXPrimitiveBufferHandle *primBuffer ) diff --git a/Engine/source/postFx/postEffect.cpp b/Engine/source/postFx/postEffect.cpp index d75d170a9..2d1285102 100644 --- a/Engine/source/postFx/postEffect.cpp +++ b/Engine/source/postFx/postEffect.cpp @@ -183,6 +183,16 @@ void PostEffect::EffectConst::set(const F32 &newVal) mValueType = FloatType; } +void PostEffect::EffectConst::set(const int& newVal) +{ + if (mIntVal == newVal) + return; + + mIntVal = newVal; + mDirty = true; + mValueType = IntType; +} + void PostEffect::EffectConst::set(const Point4F &newVal) { if (mPointVal == newVal) @@ -326,6 +336,21 @@ void PostEffect::EffectConst::setToBuffer( GFXShaderConstBufferRef buff ) const char* err = avar("PostEffect::EffectConst::setToBuffer $s type is not implemented", mName.c_str()); Con::errorf(err); GFXAssertFatal(0, err); +#endif + } + } + else if (mValueType == IntType) + { + if (type == GFXSCT_Int) + { + buff->set(mHandle, mIntVal); + } + else + { +#if TORQUE_DEBUG + const char* err = avar("PostEffect::EffectConst::setToBuffer $s type is not implemented", mName.c_str()); + Con::errorf(err); + GFXAssertFatal(0, err); #endif } } @@ -1676,6 +1701,20 @@ void PostEffect::setShaderConst(const String &name, const F32 &val) iter->value->set(val); } +void PostEffect::setShaderConst(const String& name, const int& val) +{ + PROFILE_SCOPE(PostEffect_SetShaderConst_Float); + + EffectConstTable::Iterator iter = mEffectConsts.find(name); + if (iter == mEffectConsts.end()) + { + EffectConst* newConst = new EffectConst(name, val); + iter = mEffectConsts.insertUnique(name, newConst); + } + + iter->value->set(val); +} + void PostEffect::setShaderConst(const String &name, const Point4F &val) { PROFILE_SCOPE(PostEffect_SetShaderConst_Point); diff --git a/Engine/source/postFx/postEffect.h b/Engine/source/postFx/postEffect.h index 84ea55c4f..e1ab050e7 100644 --- a/Engine/source/postFx/postEffect.h +++ b/Engine/source/postFx/postEffect.h @@ -230,6 +230,14 @@ protected: set(val); } + EffectConst(const String& name, const int& val) + : mName(name), + mHandle(NULL), + mDirty(true) + { + set(val); + } + EffectConst(const String &name, const Point4F &val) : mName(name), mHandle(NULL), @@ -264,6 +272,7 @@ protected: void set( const String &newVal ); void set(const F32 &newVal); + void set(const int& newVal); void set(const Point4F &newVal); void set(const MatrixF &newVal); void set(const Vector &newVal); @@ -277,6 +286,7 @@ protected: String mStringVal; + S32 mIntVal; F32 mFloatVal; Point4F mPointVal; MatrixF mMatrixVal; @@ -287,6 +297,7 @@ protected: enum { StringType, + IntType, FloatType, PointType, MatrixType, @@ -427,6 +438,7 @@ public: /// void setShaderConst( const String &name, const String &val ); void setShaderConst(const String &name, const F32 &val); + void setShaderConst(const String& name, const int& val); void setShaderConst(const String &name, const Point4F &val); void setShaderConst(const String &name, const MatrixF &val); void setShaderConst(const String &name, const Vector &val); diff --git a/Engine/source/renderInstance/renderProbeMgr.cpp b/Engine/source/renderInstance/renderProbeMgr.cpp index 74603dd81..0b7186f1b 100644 --- a/Engine/source/renderInstance/renderProbeMgr.cpp +++ b/Engine/source/renderInstance/renderProbeMgr.cpp @@ -87,7 +87,8 @@ ProbeRenderInst::ProbeRenderInst() : mAtten(0.0), mCubemapIndex(0), mIsSkylight(false), - mProbeIdx(0) + mProbeIdx(0), + mProbeShapeType(Box) { } @@ -132,7 +133,8 @@ ProbeShaderConstants::ProbeShaderConstants() mBRDFTextureMap(NULL), mSkylightSpecularMap(NULL), mSkylightIrradMap(NULL), - mHasSkylight(NULL) + mHasSkylight(NULL), + mWorldToObjArraySC(NULL) { } @@ -202,7 +204,10 @@ RenderProbeMgr::RenderProbeMgr() mLastShader(nullptr), mLastConstants(nullptr), mProbesDirty(false), - mHasSkylight(false) + mHasSkylight(false), + mSkylightCubemapIdx(-1), + mCubeMapCount(0), + mDefaultSkyLight(nullptr) { mEffectiveProbeCount = 0; mMipCount = 0; @@ -376,7 +381,7 @@ void RenderProbeMgr::unregisterProbe(U32 probeIdx) mRegisteredProbes.erase(probeIdx); //rebuild our probe data - _setupStaticParameters(); + mProbesDirty = true; } // @@ -409,7 +414,7 @@ void RenderProbeMgr::_setupStaticParameters() U32 probeCount = mRegisteredProbes.size(); mEffectiveProbeCount = 0; - mMipCount = 0; + mMipCount = 1; mHasSkylight = false; mSkylightCubemapIdx = -1; @@ -429,11 +434,7 @@ void RenderProbeMgr::_setupStaticParameters() probeWorldToObjData.fill(MatrixF::Identity); probeBBMinData.fill(Point4F::Zero); probeBBMaxData.fill(Point4F::Zero); - probeConfigData.fill(Point4F::Zero); - - Vector cubemapIdxes; - - mMipCount = 1; + probeConfigData.fill(Point4F(-1,0,0,0)); for (U32 i = 0; i < probeCount; i++) { @@ -444,13 +445,12 @@ void RenderProbeMgr::_setupStaticParameters() if (!curEntry.mIsEnabled) continue; - U32 mips = mRegisteredProbes[0].mPrefilterCubemap.getPointer()->getMipMapLevels(); - mMipCount = mips != 0 && mips > mMipCount ? mips : 0; + U32 mips = mRegisteredProbes[i].mPrefilterCubemap.getPointer()->getMipMapLevels(); + mMipCount = mips != 0 && mips >= mMipCount ? mips : 0; - if (curEntry.mProbeShapeType == ProbeRenderInst::ProbeShapeType::Skylight || curEntry.mIsSkylight) + if (curEntry.mIsSkylight) { mSkylightCubemapIdx = curEntry.mCubemapIndex; - mHasSkylight = true; continue; } @@ -471,25 +471,32 @@ void RenderProbeMgr::_setupStaticParameters() curEntry.mAtten, curEntry.mCubemapIndex); - cubemapIdxes.push_back(i); - mEffectiveProbeCount++; } mProbesDirty = false; } -void RenderProbeMgr::updateProbeTexture(U32 probeIdx) +void RenderProbeMgr::updateProbeTexture(ProbeRenderInst* probeInfo) { - if (probeIdx >= mRegisteredProbes.size()) + if (probeInfo->mIrradianceCubemap.isNull() || !probeInfo->mIrradianceCubemap->isInitialized()) + { + Con::errorf("RenderProbeMgr::updateProbeTexture() - tried to update a probe's texture with an invalid or uninitialized irradiance map!"); return; + } - const U32 cubeIndex = mRegisteredProbes[probeIdx].mCubemapIndex; - mIrradianceArray->updateTexture(mRegisteredProbes[probeIdx].mIrradianceCubemap, cubeIndex); - mPrefilterArray->updateTexture(mRegisteredProbes[probeIdx].mPrefilterCubemap, cubeIndex); + if (probeInfo->mPrefilterCubemap.isNull() || !probeInfo->mPrefilterCubemap->isInitialized()) + { + Con::errorf("RenderProbeMgr::updateProbeTexture() - tried to update a probe's texture with an invalid or uninitialized specular map!"); + return; + } - Con::warnf("UpdatedProbeTexture - probeIdx: %u on cubeIndex %u, Irrad validity: %d, Prefilter validity: %d", probeIdx, cubeIndex, - mRegisteredProbes[probeIdx].mIrradianceCubemap->isInitialized(), mRegisteredProbes[probeIdx].mPrefilterCubemap->isInitialized()); + const U32 cubeIndex = probeInfo->mCubemapIndex; + mIrradianceArray->updateTexture(probeInfo->mIrradianceCubemap, cubeIndex); + mPrefilterArray->updateTexture(probeInfo->mPrefilterCubemap, cubeIndex); + + Con::warnf("UpdatedProbeTexture - probeIdx: %u on cubeIndex %u, Irrad validity: %d, Prefilter validity: %d", probeInfo->mProbeIdx, cubeIndex, + probeInfo->mIrradianceCubemap->isInitialized(), probeInfo->mPrefilterCubemap->isInitialized()); } void RenderProbeMgr::_setupPerFrameParameters(const SceneRenderState *state) @@ -669,7 +676,7 @@ void RenderProbeMgr::_update4ProbeConsts(const SceneData &sgData, if (curEntry.mIsSkylight) { - if (curEntry.mPrefilterCubemap.isValid() && curEntry.mPrefilterCubemap.isValid()) + if (curEntry.mPrefilterCubemap->isInitialized() && curEntry.mIrradianceCubemap->isInitialized()) { GFX->setCubeTexture(probeShaderConsts->mSkylightSpecularMap->getSamplerRegister(), curEntry.mPrefilterCubemap); GFX->setCubeTexture(probeShaderConsts->mSkylightIrradMap->getSamplerRegister(), curEntry.mIrradianceCubemap); @@ -739,7 +746,7 @@ void RenderProbeMgr::render( SceneRenderState *state ) _setupStaticParameters(); // Early out if nothing to draw. - if (!RenderProbeMgr::smRenderReflectionProbes || !state->isDiffusePass() || (mRegisteredProbes.size() == 0 || (mEffectiveProbeCount == 0 && !mHasSkylight))) + if (!RenderProbeMgr::smRenderReflectionProbes || !state->isDiffusePass() || (mEffectiveProbeCount == 0 && mSkylightCubemapIdx == -1)) { getProbeArrayEffect()->setSkip(true); return; @@ -765,23 +772,24 @@ void RenderProbeMgr::render( SceneRenderState *state ) String useDebugContrib = Con::getVariable("$Probes::showProbeContrib", "0"); mProbeArrayEffect->setShaderMacro("DEBUGVIZ_CONTRIB", useDebugContrib); + + if(mHasSkylight && mEffectiveProbeCount == 0) + mProbeArrayEffect->setShaderMacro("SKYLIGHT_ONLY", "1"); - if (mHasSkylight || mEffectiveProbeCount != 0) - { - mProbeArrayEffect->setTexture(3, mBRDFTexture); - mProbeArrayEffect->setCubemapArrayTexture(4, mPrefilterArray); - mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray); - } + mProbeArrayEffect->setTexture(3, mBRDFTexture); + mProbeArrayEffect->setCubemapArrayTexture(4, mPrefilterArray); + mProbeArrayEffect->setCubemapArrayTexture(5, mIrradianceArray); - mProbeArrayEffect->setShaderConst("$hasSkylight", (float)mHasSkylight); - if (mHasSkylight) - { - mProbeArrayEffect->setShaderConst("$skylightCubemapIdx", mSkylightCubemapIdx); - } - - mProbeArrayEffect->setShaderConst("$numProbes", (float)mEffectiveProbeCount); + mProbeArrayEffect->setShaderConst("$numProbes", (S32)mEffectiveProbeCount); + mProbeArrayEffect->setShaderConst("$skylightCubemapIdx", mSkylightCubemapIdx); mProbeArrayEffect->setShaderConst("$cubeMips", (float)mMipCount); + + //also set up some colors + Vector contribColors; + + contribColors.setSize(MAXPROBECOUNT); + if (mEffectiveProbeCount != 0) { if (useDebugContrib == String("1")) @@ -789,11 +797,6 @@ void RenderProbeMgr::render( SceneRenderState *state ) MRandomLCG RandomGen; RandomGen.setSeed(mEffectiveProbeCount); - //also set up some colors - Vector contribColors; - - contribColors.setSize(MAXPROBECOUNT); - for (U32 i = 0; i < mEffectiveProbeCount; i++) { //we're going to cheat here a little for consistent debugging behavior. The first 3 probes will always have R G and then B for their colors, every other will be random @@ -806,18 +809,18 @@ void RenderProbeMgr::render( SceneRenderState *state ) else contribColors[i] = Point4F(RandomGen.randF(0, 1), RandomGen.randF(0, 1), RandomGen.randF(0, 1), 1); } - - mProbeArrayEffect->setShaderConst("$probeContribColors", contribColors); } - - mProbeArrayEffect->setShaderConst("$inProbePosArray", probePositionsData); - mProbeArrayEffect->setShaderConst("$inRefPosArray", probeRefPositionsData); - mProbeArrayEffect->setShaderConst("$worldToObjArray", probeWorldToObjData); - mProbeArrayEffect->setShaderConst("$bbMinArray", probeBBMinData); - mProbeArrayEffect->setShaderConst("$bbMaxArray", probeBBMaxData); - mProbeArrayEffect->setShaderConst("$probeConfigData", probeConfigData); } + mProbeArrayEffect->setShaderConst("$probeContribColors", contribColors); + + mProbeArrayEffect->setShaderConst("$inProbePosArray", probePositionsData); + mProbeArrayEffect->setShaderConst("$inRefPosArray", probeRefPositionsData); + mProbeArrayEffect->setShaderConst("$worldToObjArray", probeWorldToObjData); + mProbeArrayEffect->setShaderConst("$bbMinArray", probeBBMinData); + mProbeArrayEffect->setShaderConst("$bbMaxArray", probeBBMaxData); + mProbeArrayEffect->setShaderConst("$probeConfigData", probeConfigData); + // Make sure the effect is gonna render. getProbeArrayEffect()->setSkip(false); diff --git a/Engine/source/renderInstance/renderProbeMgr.h b/Engine/source/renderInstance/renderProbeMgr.h index 8eba74431..911e05a21 100644 --- a/Engine/source/renderInstance/renderProbeMgr.h +++ b/Engine/source/renderInstance/renderProbeMgr.h @@ -292,7 +292,7 @@ public: U32 pass, GFXShaderConstBuffer *shaderConsts); - void updateProbeTexture(U32 probeIdx); + void updateProbeTexture(ProbeRenderInst* probeInfo); /// Debug rendering static bool smRenderReflectionProbes; diff --git a/Engine/source/util/settings.cpp b/Engine/source/util/settings.cpp index 96fd2d5c8..299898e8d 100644 --- a/Engine/source/util/settings.cpp +++ b/Engine/source/util/settings.cpp @@ -709,4 +709,4 @@ DefineEngineMethod(Settings, clearGroups, void, (), , "settingObj.clearGroups(); DefineEngineMethod(Settings, getCurrentGroups, const char*, (), , "settingObj.getCurrentGroups();") { return object->getCurrentGroups(); -} \ No newline at end of file +} diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs index 3a52199b4..bc70856ad 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Shaders.cs @@ -322,8 +322,6 @@ singleton ShaderData( PFX_ReflectionProbeArray ) samplerNames[3] = "$BRDFTexture"; samplerNames[4] = "$specularCubemapAR"; samplerNames[5] = "$irradianceCubemapAR"; - samplerNames[6] = "$skylightSpecularMap"; - samplerNames[7] = "$skylightIrradMap"; pixVersion = 2.0; }; @@ -345,7 +343,6 @@ singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock ) zEnable = false; zWriteEnable = false; - samplersDefined = true; samplerStates[0] = SamplerClampPoint; samplerStates[1] = SamplerClampPoint; @@ -353,6 +350,4 @@ singleton GFXStateBlockData( PFX_ReflectionProbeArrayStateBlock ) samplerStates[3] = SamplerClampPoint; samplerStates[4] = SamplerClampLinear; samplerStates[5] = SamplerClampLinear; - samplerStates[6] = SamplerClampLinear; - samplerStates[7] = SamplerClampLinear; }; \ No newline at end of file diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl index 2298c958c..12d8b3c36 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl @@ -19,7 +19,8 @@ uniform vec3 eyePosWorld; //cubemap arrays require all the same size. so shared mips# value uniform float cubeMips; -uniform float numProbes; +uniform int numProbes; + uniform samplerCubeArray specularCubemapAR; uniform samplerCubeArray irradianceCubemapAR; @@ -34,9 +35,7 @@ uniform vec4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten uniform vec4 probeContribColors[MAX_PROBES]; #endif -uniform samplerCube skylightSpecularMap; -uniform samplerCube skylightIrradMap; -uniform float hasSkylight; +uniform float skylightCubemapIdx; out vec4 OUT_col; @@ -56,6 +55,7 @@ void main() float alpha = 1; +#if SKYLIGHT_ONLY == 0 int i = 0; float blendFactor[MAX_PROBES]; float blendSum = 0; @@ -64,8 +64,9 @@ void main() float probehits = 0; //Set up our struct data float contribution[MAX_PROBES]; - if (alpha > 0) - { + + //if (alpha > 0) + //{ //Process prooooobes for (i = 0; i < numProbes; ++i) { @@ -83,6 +84,8 @@ void main() if (contribution[i]>0.0) probehits++; } + else + continue; contribution[i] = max(contribution[i],0); @@ -106,20 +109,21 @@ void main() } // Normalize blendVal -#if DEBUGVIZ_ATTENUATION == 0 //this can likely be removed when we fix the above normalization behavior - if (blendFacSum == 0.0f) // Possible with custom weight - { - blendFacSum = 1.0f; - } -#endif + if (blendFacSum == 0.0f) // Possible with custom weight + { + blendFacSum = 1.0f; + } float invBlendSumWeighted = 1.0f / blendFacSum; for (i = 0; i < numProbes; ++i) { blendFactor[i] *= invBlendSumWeighted; contribution[i] *= blendFactor[i]; + alpha -= contribution[i]; } } + else + alpha -= blendSum; #if DEBUGVIZ_ATTENUATION == 1 float contribAlpha = 1; @@ -142,12 +146,14 @@ void main() } //Skylight coloration for anything not covered by probes above - finalContribColor += vec3(0.3, 0.3, 0.3) * contribAlpha; + if(skylightCubemapIdx != -1) + finalContribColor += vec3(0.3, 0.3, 0.3) * contribAlpha; OUT_col = vec4(finalContribColor, 1); return; #endif - } + //} +#endif vec3 irradiance = vec3(0, 0, 0); vec3 specular = vec3(0, 0, 0); @@ -159,27 +165,27 @@ void main() float lod = 0; #endif +#if SKYLIGHT_ONLY == 0 alpha = 1; for (i = 0; i < numProbes; ++i) { float contrib = contribution[i]; if (contrib != 0) { - float cubemapIdx = probeConfigData[i].a; + int cubemapIdx = probeConfigData[i].a; vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], bbMinArray[i].xyz, bbMaxArray[i].xyz, inRefPosArray[i].xyz); irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib; specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib; - //irradiance += vec3(1,1,1) * contrib; - //specular += vec3(1,1,1) * contrib; alpha -= contrib; } } +#endif - if (hasSkylight == 1 && alpha > 0.001) + if (skylightCubemapIdx != -1 && alpha > 0.001) { - irradiance += textureLod(skylightIrradMap, surface.R, 0).xyz * alpha; - specular += textureLod(skylightSpecularMap, surface.R, lod).xyz * alpha; + irradiance += textureLod(irradianceCubemapAR, vec4(surface.R, skylightCubemapIdx), 0).xyz * alpha; + specular += textureLod(specularCubemapAR, vec4(surface.R, skylightCubemapIdx), lod).xyz * alpha; } #if DEBUGVIZ_SPECCUBEMAP == 1 && DEBUGVIZ_DIFFCUBEMAP == 0 diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl deleted file mode 100644 index fee0b8783..000000000 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl +++ /dev/null @@ -1,162 +0,0 @@ -//----------------------------------------------------------------------------- -// Copyright (c) 2012 GarageGames, LLC -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -//----------------------------------------------------------------------------- -#include "../../../gl/hlslCompat.glsl" -#include "shadergen:/autogenConditioners.h" -#include "farFrustumQuad.glsl" -#include "../../../gl/torque.glsl" -#include "../../../gl/lighting.glsl" -#line 27 - -in vec4 pos; -in vec4 wsEyeDir; -in vec4 ssPos; -in vec4 vsEyeDir; - -uniform sampler2D deferredBuffer; -uniform sampler2D colorBuffer; -uniform sampler2D matInfoBuffer; -uniform samplerCube cubeMap; -uniform samplerCube irradianceCubemap; -uniform sampler2D BRDFTexture; -uniform float cubeMips; - -uniform vec4 rtParams0; - -uniform vec3 probeWSPos; -uniform vec3 probeLSPos; -uniform vec4 vsFarPlane; - -uniform float radius; -uniform vec2 attenuation; - -uniform mat4 worldToObj; -uniform mat4 cameraToWorld; - -uniform vec3 eyePosWorld; -uniform vec3 bbMin; -uniform vec3 bbMax; - -uniform float useSphereMode; - -// Box Projected IBL Lighting -// Based on: http://www.gamedev.net/topic/568829-box-projected-cubemap-environment-mapping/ -// and https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ -vec3 boxProject(vec3 wsPosition, vec3 reflectDir, vec3 boxWSPos, vec3 boxMin, vec3 boxMax) -{ - vec3 nrdir = reflectDir; - vec3 offset = wsPosition; - vec3 plane1vec = (boxMax - offset) / nrdir; - vec3 plane2vec = (boxMin - offset) / nrdir; - - vec3 furthestPlane = max(plane1vec, plane2vec); - float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z); - vec3 posonbox = offset + nrdir * dist; - - return posonbox - boxWSPos; -} - -vec3 iblBoxSpecular(vec3 normal, vec3 wsPos, float roughness, vec3 surfToEye, - sampler2D brdfTexture, - samplerCube radianceCube, - vec3 boxPos, - vec3 boxMin, - vec3 boxMax) -{ - float ndotv = clamp(dot(normal, surfToEye), 0.0, 1.0); - - // BRDF - vec2 brdf = textureLod(brdfTexture, vec2(roughness, ndotv),0).xy; - - // Radiance (Specular) - float maxmip = pow(cubeMips+1,2); - float lod = roughness*maxmip; - vec3 r = reflect(surfToEye, normal); - vec3 cubeR = normalize(r); - cubeR = boxProject(wsPos, cubeR, boxPos, boxMin, boxMax); - - vec3 radiance = textureLod(radianceCube, cubeR, lod).xyz * (brdf.x + brdf.y); - - return radiance; -} - -float defineBoxSpaceInfluence(vec3 surfPosWS, vec3 probePos, float radius, float atten) -{ - vec3 surfPosLS = tMul( worldToObj, vec4(surfPosWS,1.0)).xyz; - - vec3 boxMinLS = probePos-(vec3(1,1,1)*radius); - vec3 boxMaxLS = probePos+(vec3(1,1,1)*radius); - - float boxOuterRange = length(boxMaxLS - boxMinLS); - float boxInnerRange = boxOuterRange / atten; - - vec3 localDir = vec3(abs(surfPosLS.x), abs(surfPosLS.y), abs(surfPosLS.z)); - localDir = (localDir - boxInnerRange) / (boxOuterRange - boxInnerRange); - - return max(localDir.x, max(localDir.y, localDir.z)) * -1; -} -out vec4 OUT_col; - -void main() -{ - - // Compute scene UV - vec2 uvScene = getUVFromSSPos( ssPos.xyz/ssPos.w, rtParams0 ); - - //eye ray WS/LS - vec3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, vsEyeDir.xyz, vsFarPlane ); - vec3 wsEyeRay = tMul(cameraToWorld, vec4(vsEyeRay, 0)).xyz; - - //unpack normal and linear depth - vec4 normDepth = deferredUncondition(deferredBuffer, uvScene); - - //create surface - Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer, - uvScene, eyePosWorld, wsEyeRay, cameraToWorld); - float blendVal = 1.0; - if(useSphereMode>0) - { - vec3 L = probeWSPos - surface.P; - blendVal = 1.0-length(L)/radius; - clip(blendVal); - } - else - { - float tempAttenVal = 3.5; - blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal); - clip(blendVal); - float compression = 0.05; - blendVal=(1.0-compression)+blendVal*compression; - } - //render into the bound space defined above - vec3 surfToEye = normalize(surface.P - eyePosWorld); - vec3 irradiance = textureLod(irradianceCubemap, surface.N,0).xyz; - vec3 specular = iblBoxSpecular(surface.N, surface.P, surface.roughness, surfToEye, BRDFTexture, cubeMap, probeWSPos, bbMin, bbMax); - vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); - specular *= F; - //energy conservation - vec3 kD = vec3(1.0) - F; - kD *= 1.0 - surface.metalness; - //final diffuse color - vec3 diffuse = kD * irradiance * surface.baseColor.rgb; - - OUT_col = vec4(diffuse + specular * surface.ao, blendVal); -} diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl deleted file mode 100644 index 5d48e6613..000000000 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl +++ /dev/null @@ -1,32 +0,0 @@ -#include "shadergen:/autogenConditioners.h" -#include "../../torque.hlsl" - -// This is the shader input -struct Vert -{ - float4 position : POSITION; - float2 uv0 : TEXCOORD0; - float3 wsEyeRay : TEXCOORD1; -}; - -// This is the shader output data. -struct Conn -{ - float4 position : POSITION; - float2 uv0 : TEXCOORD0; - float3 wsEyeRay : TEXCOORD1; -}; - -// Render Target Paramaters -float4 rtParams0; - -Conn main(Vert IN, - uniform float4x4 modelView : register(C0)) -{ - Conn OUT; - OUT.position = IN.position; - OUT.uv0 = viewportCoordToRenderTarget( IN.uv0, rtParams0 ); - OUT.wsEyeRay = IN.wsEyeRay; - return OUT; -} - diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl index 9ded5bd1b..df53fa3c9 100644 --- a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl @@ -16,7 +16,8 @@ uniform float3 eyePosWorld; //cubemap arrays require all the same size. so shared mips# value uniform float cubeMips; -uniform float numProbes; +uniform int numProbes; + TORQUE_UNIFORM_SAMPLERCUBEARRAY(specularCubemapAR, 4); TORQUE_UNIFORM_SAMPLERCUBEARRAY(irradianceCubemapAR, 5); @@ -31,7 +32,6 @@ uniform float4 probeConfigData[MAX_PROBES]; //r,g,b/mode,radius,atten uniform float4 probeContribColors[MAX_PROBES]; #endif -uniform float hasSkylight; uniform float skylightCubemapIdx; float4 main(PFXVertToPix IN) : SV_TARGET @@ -46,11 +46,12 @@ float4 main(PFXVertToPix IN) : SV_TARGET //early out if emissive if (getFlag(surface.matFlag, 0)) { - discard; + return TORQUE_TEX2D(colorBuffer, IN.uv0.xy); } float alpha = 1; +#if SKYLIGHT_ONLY == 0 int i = 0; float blendFactor[MAX_PROBES]; float blendSum = 0; @@ -59,8 +60,9 @@ float4 main(PFXVertToPix IN) : SV_TARGET float probehits = 0; //Set up our struct data float contribution[MAX_PROBES]; - if (alpha > 0) - { + + //if (alpha > 0) + //{ //Process prooooobes for (i = 0; i < numProbes; ++i) { @@ -78,6 +80,8 @@ float4 main(PFXVertToPix IN) : SV_TARGET if (contribution[i]>0.0) probehits++; } + else + continue; contribution[i] = max(contribution[i],0); @@ -90,34 +94,32 @@ float4 main(PFXVertToPix IN) : SV_TARGET // Weight1 = normalized inverted NDF, so we have 1 at center, 0 at boundary // and respect constraint A. - if (probehits>1.0) - { - for (i = 0; i < numProbes; i++) - { - blendFactor[i] = ((contribution[i] / blendSum)) / probehits; - blendFactor[i] *= ((contribution[i]) / invBlendSum); - blendFactor[i] = saturate(blendFactor[i]); - blendFacSum += blendFactor[i]; - } + if (probehits > 1.0) + { + for (i = 0; i < numProbes; i++) + { + blendFactor[i] = ((contribution[i] / blendSum)) / probehits; + blendFactor[i] *= ((contribution[i]) / invBlendSum); + blendFactor[i] = saturate(blendFactor[i]); + blendFacSum += blendFactor[i]; + } - // Normalize blendVal -#if DEBUGVIZ_ATTENUATION == 0 //this can likely be removed when we fix the above normalization behavior - if (blendFacSum == 0.0f) // Possible with custom weight - { - blendFacSum = 1.0f; - } -#endif + // Normalize blendVal + if (blendFacSum == 0.0f) // Possible with custom weight + { + blendFacSum = 1.0f; + } - float invBlendSumWeighted = 1.0f / blendFacSum; - for (i = 0; i < numProbes; ++i) - { - blendFactor[i] *= invBlendSumWeighted; - contribution[i] *= blendFactor[i]; - alpha -= contribution[i]; - } + float invBlendSumWeighted = 1.0f / blendFacSum; + for (i = 0; i < numProbes; ++i) + { + blendFactor[i] *= invBlendSumWeighted; + contribution[i] *= blendFactor[i]; + alpha -= contribution[i]; + } } else - alpha -= blendSum; + alpha -= blendSum; #if DEBUGVIZ_ATTENUATION == 1 float contribAlpha = 1; @@ -139,11 +141,13 @@ float4 main(PFXVertToPix IN) : SV_TARGET } //Skylight coloration for anything not covered by probes above - finalContribColor += float3(0.3, 0.3, 0.3) * contribAlpha; + if(skylightCubemapIdx != -1) + finalContribColor += float3(0.3, 0.3, 0.3) * contribAlpha; return float4(finalContribColor, 1); #endif - } + //} +#endif float3 irradiance = float3(0, 0, 0); float3 specular = float3(0, 0, 0); @@ -155,6 +159,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET float lod = 0; #endif +#if SKYLIGHT_ONLY == 0 alpha = 1; for (i = 0; i < numProbes; ++i) { @@ -169,8 +174,9 @@ float4 main(PFXVertToPix IN) : SV_TARGET alpha -= contrib; } } +#endif - if (hasSkylight && alpha > 0.001) + if(skylightCubemapIdx != -1 && alpha >= 0.001) { irradiance += TORQUE_TEXCUBEARRAYLOD(irradianceCubemapAR, surface.R, skylightCubemapIdx, 0).xyz * alpha; specular += TORQUE_TEXCUBEARRAYLOD(specularCubemapAR, surface.R, skylightCubemapIdx, lod).xyz * alpha; @@ -197,6 +203,5 @@ float4 main(PFXVertToPix IN) : SV_TARGET float3 diffuse = kD * irradiance * surface.baseColor.rgb; float4 finalColor = float4(diffuse + specular * surface.ao, 1.0); -//finalColor.rgb += abs(surface.N); return finalColor; } diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs index fd6f85278..49c1941c3 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetBrowser.cs @@ -150,7 +150,7 @@ function AssetBrowser::showDialog( %this, %AssetTypeFilter, %selectCallback, %ta AssetBrowser.fieldTargetObject = %targetObj; AssetBrowser.fieldTargetName = %fieldName; - Canvas.add(AssetBrowser); + Canvas.pushDialog(AssetBrowser); AssetBrowser.setVisible(1); AssetBrowserWindow.setVisible(1); AssetBrowserWindow.selectWindow(); diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs index b63f5dd22..299ecd030 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetImport.cs @@ -497,6 +497,9 @@ function ImportAssetWindow::onWake(%this) return; $AssetBrowser::importConfigsFile = "tools/assetBrowser/assetImportConfigs.xml"; + $AssetBrowser::currentImportConfig = ""; + new Settings(AssetImportSettings) { file = $AssetBrowser::importConfigsFile; }; + AssetImportSettings.read(); %this.reloadImportOptionConfigs(); } @@ -510,17 +513,15 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) if(%xmlDoc.loadFile($AssetBrowser::importConfigsFile)) { //StateMachine element - %xmlDoc.pushFirstChildElement("AssetImportConfigs"); + %xmlDoc.pushFirstChildElement("AssetImportSettings"); - //Configs + //Config Groups %configCount = 0; while(%xmlDoc.pushChildElement(%configCount)) { - %configObj = new ScriptObject(){}; - - %configObj.Name = %xmlDoc.attribute("Name"); + %configName = %xmlDoc.attribute("name"); - %xmlDoc.pushFirstChildElement("Mesh"); + /*%xmlDoc.pushFirstChildElement("Mesh"); %configObj.ImportMesh = %xmlDoc.attribute("ImportMesh"); %configObj.DoUpAxisOverride = %xmlDoc.attribute("DoUpAxisOverride"); %configObj.UpAxisOverride = %xmlDoc.attribute("UpAxisOverride"); @@ -583,12 +584,12 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) %configObj.VolumeAdjust = %xmlDoc.attribute("VolumeAdjust"); %configObj.PitchAdjust = %xmlDoc.attribute("PitchAdjust"); %configObj.Compressed = %xmlDoc.attribute("Compressed"); - %xmlDoc.popElement(); + %xmlDoc.popElement();*/ %xmlDoc.popElement(); %configCount++; - ImportAssetWindow.importConfigsList.add(%configObj); + ImportAssetWindow.importConfigsList.add(%configName); } %xmlDoc.popElement(); @@ -596,8 +597,8 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) for(%i = 0; %i < ImportAssetWindow.importConfigsList.count(); %i++) { - %configObj = ImportAssetWindow.importConfigsList.getKey(%i); - ImportAssetConfigList.add(%configObj.Name); + %configName = ImportAssetWindow.importConfigsList.getKey(%i); + ImportAssetConfigList.add(%configName); } %importConfigIdx = ImportAssetWindow.activeImportConfigIndex; @@ -607,7 +608,7 @@ function ImportAssetWindow::reloadImportOptionConfigs(%this) ImportAssetConfigList.setSelected(%importConfigIdx); } -function ImportAssetWindow::setImportOptions(%this, %optionsObj) +function ImportAssetWindow::setImportOptions(%this, %configName) { //Todo, editor + load from files for preconfigs diff --git a/Templates/BaseGame/game/tools/gui/profiles.ed.cs b/Templates/BaseGame/game/tools/gui/profiles.ed.cs index bb750611c..16e5f4194 100644 --- a/Templates/BaseGame/game/tools/gui/profiles.ed.cs +++ b/Templates/BaseGame/game/tools/gui/profiles.ed.cs @@ -37,7 +37,7 @@ new GuiControlProfile (ToolsGuiDefaultProfile) mouseOverSelected = false; // fill color - opaque = true; + opaque = false; fillColor = "50 50 50"; fillColorHL = "91 101 116"; fillColorSEL = "91 101 116"; diff --git a/Templates/BaseGame/game/tools/settings.xml b/Templates/BaseGame/game/tools/settings.xml index 050bbb71f..be6fd5412 100644 --- a/Templates/BaseGame/game/tools/settings.xml +++ b/Templates/BaseGame/game/tools/settings.xml @@ -1,94 +1,128 @@ + + Grid_512_Orange + + + data/FPSGameplay/levels + + + 5 + + + 25 + + + - 0 - 1 screenCenter - 6 + 0 WorldEditorInspectorPlugin + 1 40 - 50 AssetWork_Debug.exe + 6 + 50 + + 255 255 255 255 + 100 100 100 255 + 255 255 0 255 + 255 255 0 255 + 0 0 255 255 + 255 0 0 255 + 0 255 0 255 + + + 48 48 48 255 + 255 255 255 255 + 215 215 215 255 + 180 180 180 255 + 50 50 50 255 + + + 100 + 0 + 0 + 0 + 1 + 2 + 1 + + + 51 51 51 100 + 102 102 102 100 + 1 + 255 255 255 100 + 0 + + + tools/worldEditor/images/DefaultHandle + tools/worldEditor/images/SelectHandle + tools/worldEditor/images/LockedHandle + + + http://www.garagegames.com/products/torque-3d/forums + ../../../Documentation/Official Documentation.html + ../../../Documentation/Torque 3D - Script Manual.chm + http://www.garagegames.com/products/torque-3d/documentation/user + - 8 1 0 255 20 - - - ../../../Documentation/Torque 3D - Script Manual.chm - http://www.garagegames.com/products/torque-3d/documentation/user - ../../../Documentation/Official Documentation.html - http://www.garagegames.com/products/torque-3d/forums + 8 - 1 1 1 + 1 1 1 + + + 0.8 + 100 + 0.8 + 15 + 0 + 0 + 1 - 255 255 255 100 - 0 - 51 51 51 100 - 102 102 102 100 - 1 - - - 2 - 0 - 0 - 1 - 1 - 0 - 100 - - - 48 48 48 255 - 215 215 215 255 - 180 180 180 255 - 255 255 255 255 - 50 50 50 255 - - - 0 0 255 255 - 0 255 0 255 - 255 0 0 255 - 255 255 0 255 - 100 100 100 255 - 255 255 255 255 - 255 255 0 255 - - - tools/worldEditor/images/SelectHandle - tools/worldEditor/images/LockedHandle - tools/worldEditor/images/DefaultHandle + 0 + 255 255 255 20 + 0 + 10 10 10 + 0 + 500 - 1024 768 tools/gui + 1024 768 0 0 0 + + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Torque 3D - Script Manual.chm + ../../../Documentation/Official Documentation.html + 1 - 1 - 1 1 8 + 1 + 1 2 1 0 - - ../../../Documentation/Torque 3D - Script Manual.chm - ../../../Documentation/Official Documentation.html - http://www.garagegames.com/products/torque-3d/documentation/user + + 0 1 @@ -97,37 +131,6 @@ Categorized - - 0 - - - - 0 - 1 - 100 - 15 - 0 - 0.8 - 0.8 - - 0 - 500 - 0 - 255 255 255 20 - 10 10 10 - 0 - - - - data/FPSGameplay/levels - - - 25 - - - - - Grid_512_Orange AIPlayer diff --git a/Templates/BaseGame/game/tools/worldEditor/main.cs b/Templates/BaseGame/game/tools/worldEditor/main.cs index fb985b66b..b524f00ae 100644 --- a/Templates/BaseGame/game/tools/worldEditor/main.cs +++ b/Templates/BaseGame/game/tools/worldEditor/main.cs @@ -135,7 +135,12 @@ function initializeWorldEditor() EVisibility.addOption( "Frustum Lock", "$Scene::lockCull", "" ); EVisibility.addOption( "Disable Zone Culling", "$Scene::disableZoneCulling", "" ); EVisibility.addOption( "Disable Terrain Occlusion", "$Scene::disableTerrainOcclusion", "" ); - + + EVisibility.addOption( "Probes: Attenuation", "$Probes::showAttenuation", "" ); + EVisibility.addOption( "Probes: Specular Cubemaps", "$Probes::showSpecularCubemaps", "" ); + EVisibility.addOption( "Probes: Diffuse Cubemaps", "$Probes::showDiffuseCubemaps", "" ); + EVisibility.addOption( "Probes: Contribution", "$Probes::showProbeContrib", "" ); + EVisibility.addOption( "Colorblindness: Protanopia", "$CBV_Protanopia", "toggleColorBlindnessViz" ); EVisibility.addOption( "Colorblindness: Protanomaly", "$CBV_Protanomaly", "toggleColorBlindnessViz" ); EVisibility.addOption( "Colorblindness: Deuteranopia", "$CBV_Deuteranopia", "toggleColorBlindnessViz" ); diff --git a/Templates/Full/game/Full.torsion.opt b/Templates/Full/game/Full.torsion.opt index f41687c47..2e498d182 100644 --- a/Templates/Full/game/Full.torsion.opt +++ b/Templates/Full/game/Full.torsion.opt @@ -8,13 +8,11 @@ art\main.cs core\main.cs -..\..\Empty\game\core\main.cs -..\..\BaseGame\game\core\main.cs core\scripts\client\postFx\MLAA.cs core\scripts\client\postFx\ssao.cs core\scripts\client\postFx\hdr.cs core\scripts\client\postFx\dof.cs core\scripts\client\postFx\caustics.cs -..\..\..\..\..\RnDBuildTest\My Projects\RnDTest\game\modules\TheFactory\components\FakeGISpotlight.cs +tools\worldEditor\main.cs From 07b28cb29acb704a2af86a81ff9dcddc83bb1ec7 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 17 Jun 2019 02:30:45 -0500 Subject: [PATCH 3/3] GFX card profile config file logging moved to debug only WIP mode of guiSliderCtrl to be a filled rectangle instead of a textured UI Fixed bug with guiTextEditCtrl losing focus updating history passing malformed strings Updated WIP options menu Editor/Project settings WIP Updated editor theme to be consistent, and feed off the editor settings Updated popup menus to reference renamed profiles Added more in-progress modules for examples/stress testing --- Engine/source/gfx/gfxCardProfile.cpp | 5 + Engine/source/gui/controls/guiSliderCtrl.cpp | 44 +- Engine/source/gui/controls/guiSliderCtrl.h | 3 + .../source/gui/controls/guiTextEditCtrl.cpp | 2 +- Engine/source/gui/editor/popupMenu.cpp | 2 +- Engine/source/postFx/postEffect.cpp | 2 +- Templates/BaseGame/game/core/Core.cs | 3 + .../lighting/scripts/advancedLighting_Init.cs | 6 - .../advanced/gl/reflectionProbeP.glsl | 162 ++++++++ .../advanced/gl/reflectionProbeV.glsl | 32 ++ Templates/BaseGame/game/core/settings.xml | 13 + .../ui/art/optionsMenuSliderBitmapArray.png | Bin 0 -> 2247 bytes .../game/data/ui/art/slider - Copy.png | Bin 0 -> 908 bytes .../guis/graphicsMenuSettingsSlider.taml | 4 +- .../game/data/ui/scripts/optionsMenu.cs | 72 +++- .../BaseGame/game/data/ui/scripts/profiles.cs | 7 + .../assetBrowser/_assetImportConfigs.xml | 34 ++ .../tools/assetBrowser/guis/assetBrowser.gui | 12 +- .../tools/assetBrowser/guis/assetImport.gui | 6 +- .../tools/assetBrowser/guis/editAsset.gui | 2 +- .../tools/assetBrowser/guis/editModule.gui | 2 +- .../game/tools/assetBrowser/guis/newAsset.gui | 2 +- .../BaseGame/game/tools/assetBrowser/main.cs | 1 + .../convexEditor/convexEditorToolbar.ed.gui | 2 +- .../editorClasses/gui/images/rollout.png | Bin 586 -> 6247 bytes .../gui/panels/navPanelProfiles.ed.cs | 51 --- .../game/tools/gui/editorSettingsWindow.ed.cs | 217 ++++++++-- .../BaseGame/game/tools/gui/images/button.png | Bin 1153 -> 2944 bytes .../BaseGame/game/tools/gui/images/tab.png | Bin 495 -> 4142 bytes .../BaseGame/game/tools/gui/images/window.png | Bin 861 -> 5308 bytes .../messageBoxOKCancelDetailsDlg.ed.gui | 2 +- .../BaseGame/game/tools/gui/profiles.ed.cs | 381 +++++++++++------- .../game/tools/guiEditor/gui/guiEditor.ed.gui | 6 +- .../guiEditor/scripts/guiEditorCanvas.ed.cs | 2 +- .../tools/navEditor/NavEditorSettingsTab.gui | 2 +- Templates/BaseGame/game/tools/settings.xml | 264 ++++++------ .../shapeEditor/gui/ShapeEditorToolbar.ed.gui | 2 +- .../tools/worldEditor/gui/EditorGui.ed.gui | 4 +- .../tools/worldEditor/gui/ToolsToolbar.ed.gui | 4 +- .../worldEditor/gui/WorldEditorToolbar.ed.gui | 12 +- .../gui/WorldEditorTreeWindow.ed.gui | 1 + .../gui/guiWorldEditorCreatorWindow.ed.gui | 1 + .../tools/worldEditor/scripts/lightViz.cs | 7 - .../tools/worldEditor/scripts/menus.ed.cs | 13 +- 44 files changed, 972 insertions(+), 415 deletions(-) create mode 100644 Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl create mode 100644 Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl create mode 100644 Templates/BaseGame/game/core/settings.xml create mode 100644 Templates/BaseGame/game/data/ui/art/optionsMenuSliderBitmapArray.png create mode 100644 Templates/BaseGame/game/data/ui/art/slider - Copy.png create mode 100644 Templates/BaseGame/game/tools/assetBrowser/_assetImportConfigs.xml diff --git a/Engine/source/gfx/gfxCardProfile.cpp b/Engine/source/gfx/gfxCardProfile.cpp index c223aca11..066dd3b3a 100644 --- a/Engine/source/gfx/gfxCardProfile.cpp +++ b/Engine/source/gfx/gfxCardProfile.cpp @@ -41,17 +41,22 @@ void GFXCardProfiler::loadProfileScript(const char* aScriptName) void *data = NULL; U32 dataSize = 0; + Torque::FS::ReadFile( scriptName.c_str(), data, dataSize, true ); if(data == NULL) { +#if TORQUE_DEBUG Con::warnf(" - No card profile %s exists", scriptName.c_str()); +#endif return; } const char *script = static_cast(data); +#if TORQUE_DEBUG Con::printf(" - Loaded card profile %s", scriptName.c_str()); +#endif Con::evaluate(script, false, NULL); delete[] script; diff --git a/Engine/source/gui/controls/guiSliderCtrl.cpp b/Engine/source/gui/controls/guiSliderCtrl.cpp index ad9316216..d84d6311b 100644 --- a/Engine/source/gui/controls/guiSliderCtrl.cpp +++ b/Engine/source/gui/controls/guiSliderCtrl.cpp @@ -89,6 +89,7 @@ IMPLEMENT_CALLBACK( GuiSliderCtrl, onMouseDragged, void, (), (), GuiSliderCtrl::GuiSliderCtrl() : mRange( 0., 1.f ), mTicks( 10 ), + mRenderTicks(true), mSnap( false ), mValue( 0.5f ), mThumbSize( 8, 20 ), @@ -98,7 +99,9 @@ GuiSliderCtrl::GuiSliderCtrl() mDisplayValue( false ), mMouseOver( false ), mDepressed( false ), - mMouseDragged( false ) + mMouseDragged( false ), + mUseFillBar(false), + mFillBarColor(ColorI(255,255,255)) { } @@ -117,6 +120,12 @@ void GuiSliderCtrl::initPersistFields() addProtectedField( "value", TypeF32, Offset( mValue, GuiSliderCtrl ), _setValue, defaultProtectedGetFn, "The value corresponding to the current slider position." ); + addField("useFillBar", TypeBool, Offset(mUseFillBar, GuiSliderCtrl), + "Whether to render the tick marks."); + addField("fillBarColor", TypeColorI, Offset(mFillBarColor, GuiSliderCtrl), + "Whether to render the tick marks."); + addField("renderTicks", TypeBool, Offset(mRenderTicks, GuiSliderCtrl), + "Whether to render the tick marks."); endGroup( "Slider" ); @@ -365,9 +374,18 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect) GFXDrawUtil* drawUtil = GFX->getDrawUtil(); + if (mUseFillBar) + { + + drawUtil->drawRectFill(RectI(offset.x, offset.y, getWidth() * mValue, getHeight()), mFillBarColor); + + renderChildControls(offset, updateRect); + return; + } + if( mHasTexture ) { - if(mTicks > 0) + if(mTicks > 0 && mRenderTicks) { // TODO: tick marks should be positioned based on the bitmap dimensions. Point2I mid(ext.x, ext.y/2); @@ -443,11 +461,14 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect) PrimBuild::vertex2i( pos.x + mid.x, pos.y + mid.y ); // tick marks - for( U32 t = 0; t <= ( mTicks + 1 ); t++ ) + if (mRenderTicks) { - S32 x = (S32)( F32( mid.x - 1 ) / F32( mTicks + 1 ) * F32( t ) ); - PrimBuild::vertex2i( pos.x + x, pos.y + mid.y - mShiftPoint ); - PrimBuild::vertex2i( pos.x + x, pos.y + mid.y + mShiftPoint ); + for (U32 t = 0; t <= (mTicks + 1); t++) + { + S32 x = (S32)(F32(mid.x - 1) / F32(mTicks + 1) * F32(t)); + PrimBuild::vertex2i(pos.x + x, pos.y + mid.y - mShiftPoint); + PrimBuild::vertex2i(pos.x + x, pos.y + mid.y + mShiftPoint); + } } PrimBuild::end(); } @@ -462,11 +483,14 @@ void GuiSliderCtrl::onRender(Point2I offset, const RectI &updateRect) PrimBuild::vertex2i( pos.x + mid.x, pos.y + mid.y ); // tick marks - for( U32 t = 0; t <= ( mTicks + 1 ); t++ ) + if (mRenderTicks) { - S32 y = (S32)( F32( mid.y - 1 ) / F32( mTicks + 1 ) * F32( t ) ); - PrimBuild::vertex2i( pos.x + mid.x - mShiftPoint, pos.y + y ); - PrimBuild::vertex2i( pos.x + mid.x + mShiftPoint, pos.y + y ); + for (U32 t = 0; t <= (mTicks + 1); t++) + { + S32 y = (S32)(F32(mid.y - 1) / F32(mTicks + 1) * F32(t)); + PrimBuild::vertex2i(pos.x + mid.x - mShiftPoint, pos.y + y); + PrimBuild::vertex2i(pos.x + mid.x + mShiftPoint, pos.y + y); + } } PrimBuild::end(); mDisplayValue = false; diff --git a/Engine/source/gui/controls/guiSliderCtrl.h b/Engine/source/gui/controls/guiSliderCtrl.h index 9a70c512e..a8f8b667c 100644 --- a/Engine/source/gui/controls/guiSliderCtrl.h +++ b/Engine/source/gui/controls/guiSliderCtrl.h @@ -39,6 +39,7 @@ class GuiSliderCtrl : public GuiControl Point2F mRange; U32 mTicks; + bool mRenderTicks; bool mSnap; F32 mValue; RectI mThumb; @@ -51,6 +52,8 @@ class GuiSliderCtrl : public GuiControl bool mMouseOver; bool mMouseDragged; bool mHasTexture; + bool mUseFillBar; + ColorI mFillBarColor; enum { diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index 65bb331a6..076eddc90 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -1246,7 +1246,7 @@ void GuiTextEditCtrl::onLoseFirstResponder() //execute the validate command if( mValidateCommand.isNotEmpty() ) - evaluate( mValidateCommand ); + evaluate( mValidateCommand.c_str() ); onValidate_callback(); diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 9aef352ca..2c9765f09 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -286,7 +286,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */) Sim::findObject("PopUpMenuControl", backgroundCtrl); GuiControlProfile* profile; - Sim::findObject("GuiMenubarProfile", profile); + Sim::findObject("ToolsGuiMenuBarProfile", profile); if (!profile) return; diff --git a/Engine/source/postFx/postEffect.cpp b/Engine/source/postFx/postEffect.cpp index 2d1285102..3209192d4 100644 --- a/Engine/source/postFx/postEffect.cpp +++ b/Engine/source/postFx/postEffect.cpp @@ -1703,7 +1703,7 @@ void PostEffect::setShaderConst(const String &name, const F32 &val) void PostEffect::setShaderConst(const String& name, const int& val) { - PROFILE_SCOPE(PostEffect_SetShaderConst_Float); + PROFILE_SCOPE(PostEffect_SetShaderConst_Int); EffectConstTable::Iterator iter = mEffectConsts.find(name); if (iter == mEffectConsts.end()) diff --git a/Templates/BaseGame/game/core/Core.cs b/Templates/BaseGame/game/core/Core.cs index 99efdd706..af6f97b8a 100644 --- a/Templates/BaseGame/game/core/Core.cs +++ b/Templates/BaseGame/game/core/Core.cs @@ -27,6 +27,9 @@ function CoreModule::onCreate(%this) ModuleDatabase.LoadExplicit( "Core_GameObjects" ); ModuleDatabase.LoadExplicit( "Core_ClientServer" ); + new Settings(ProjectSettings) { file = "core/settings.xml"; }; + ProjectSettings.read(); + %prefPath = getPrefpath(); if ( isFile( %prefPath @ "/clientPrefs.cs" ) ) exec( %prefPath @ "/clientPrefs.cs" ); diff --git a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs index c7d357bb8..b34da6d84 100644 --- a/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs +++ b/Templates/BaseGame/game/core/lighting/scripts/advancedLighting_Init.cs @@ -47,18 +47,12 @@ function onActivateAdvancedLM() // Enable the offscreen target so that AL will work // with MSAA back buffers and for HDR rendering. AL_FormatToken.enable(); - - // Activate Deferred Shading - AL_DeferredShading.enable(); } function onDeactivateAdvancedLM() { // Disable the offscreen render target. AL_FormatToken.disable(); - - // Deactivate Deferred Shading - AL_DeferredShading.disable(); } function setAdvancedLighting() diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl new file mode 100644 index 000000000..fee0b8783 --- /dev/null +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl @@ -0,0 +1,162 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +#include "../../../gl/hlslCompat.glsl" +#include "shadergen:/autogenConditioners.h" +#include "farFrustumQuad.glsl" +#include "../../../gl/torque.glsl" +#include "../../../gl/lighting.glsl" +#line 27 + +in vec4 pos; +in vec4 wsEyeDir; +in vec4 ssPos; +in vec4 vsEyeDir; + +uniform sampler2D deferredBuffer; +uniform sampler2D colorBuffer; +uniform sampler2D matInfoBuffer; +uniform samplerCube cubeMap; +uniform samplerCube irradianceCubemap; +uniform sampler2D BRDFTexture; +uniform float cubeMips; + +uniform vec4 rtParams0; + +uniform vec3 probeWSPos; +uniform vec3 probeLSPos; +uniform vec4 vsFarPlane; + +uniform float radius; +uniform vec2 attenuation; + +uniform mat4 worldToObj; +uniform mat4 cameraToWorld; + +uniform vec3 eyePosWorld; +uniform vec3 bbMin; +uniform vec3 bbMax; + +uniform float useSphereMode; + +// Box Projected IBL Lighting +// Based on: http://www.gamedev.net/topic/568829-box-projected-cubemap-environment-mapping/ +// and https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ +vec3 boxProject(vec3 wsPosition, vec3 reflectDir, vec3 boxWSPos, vec3 boxMin, vec3 boxMax) +{ + vec3 nrdir = reflectDir; + vec3 offset = wsPosition; + vec3 plane1vec = (boxMax - offset) / nrdir; + vec3 plane2vec = (boxMin - offset) / nrdir; + + vec3 furthestPlane = max(plane1vec, plane2vec); + float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z); + vec3 posonbox = offset + nrdir * dist; + + return posonbox - boxWSPos; +} + +vec3 iblBoxSpecular(vec3 normal, vec3 wsPos, float roughness, vec3 surfToEye, + sampler2D brdfTexture, + samplerCube radianceCube, + vec3 boxPos, + vec3 boxMin, + vec3 boxMax) +{ + float ndotv = clamp(dot(normal, surfToEye), 0.0, 1.0); + + // BRDF + vec2 brdf = textureLod(brdfTexture, vec2(roughness, ndotv),0).xy; + + // Radiance (Specular) + float maxmip = pow(cubeMips+1,2); + float lod = roughness*maxmip; + vec3 r = reflect(surfToEye, normal); + vec3 cubeR = normalize(r); + cubeR = boxProject(wsPos, cubeR, boxPos, boxMin, boxMax); + + vec3 radiance = textureLod(radianceCube, cubeR, lod).xyz * (brdf.x + brdf.y); + + return radiance; +} + +float defineBoxSpaceInfluence(vec3 surfPosWS, vec3 probePos, float radius, float atten) +{ + vec3 surfPosLS = tMul( worldToObj, vec4(surfPosWS,1.0)).xyz; + + vec3 boxMinLS = probePos-(vec3(1,1,1)*radius); + vec3 boxMaxLS = probePos+(vec3(1,1,1)*radius); + + float boxOuterRange = length(boxMaxLS - boxMinLS); + float boxInnerRange = boxOuterRange / atten; + + vec3 localDir = vec3(abs(surfPosLS.x), abs(surfPosLS.y), abs(surfPosLS.z)); + localDir = (localDir - boxInnerRange) / (boxOuterRange - boxInnerRange); + + return max(localDir.x, max(localDir.y, localDir.z)) * -1; +} +out vec4 OUT_col; + +void main() +{ + + // Compute scene UV + vec2 uvScene = getUVFromSSPos( ssPos.xyz/ssPos.w, rtParams0 ); + + //eye ray WS/LS + vec3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, vsEyeDir.xyz, vsFarPlane ); + vec3 wsEyeRay = tMul(cameraToWorld, vec4(vsEyeRay, 0)).xyz; + + //unpack normal and linear depth + vec4 normDepth = deferredUncondition(deferredBuffer, uvScene); + + //create surface + Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer, + uvScene, eyePosWorld, wsEyeRay, cameraToWorld); + float blendVal = 1.0; + if(useSphereMode>0) + { + vec3 L = probeWSPos - surface.P; + blendVal = 1.0-length(L)/radius; + clip(blendVal); + } + else + { + float tempAttenVal = 3.5; + blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal); + clip(blendVal); + float compression = 0.05; + blendVal=(1.0-compression)+blendVal*compression; + } + //render into the bound space defined above + vec3 surfToEye = normalize(surface.P - eyePosWorld); + vec3 irradiance = textureLod(irradianceCubemap, surface.N,0).xyz; + vec3 specular = iblBoxSpecular(surface.N, surface.P, surface.roughness, surfToEye, BRDFTexture, cubeMap, probeWSPos, bbMin, bbMax); + vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness); + specular *= F; + //energy conservation + vec3 kD = vec3(1.0) - F; + kD *= 1.0 - surface.metalness; + //final diffuse color + vec3 diffuse = kD * irradiance * surface.baseColor.rgb; + + OUT_col = vec4(diffuse + specular * surface.ao, blendVal); +} diff --git a/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl new file mode 100644 index 000000000..5d48e6613 --- /dev/null +++ b/Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl @@ -0,0 +1,32 @@ +#include "shadergen:/autogenConditioners.h" +#include "../../torque.hlsl" + +// This is the shader input +struct Vert +{ + float4 position : POSITION; + float2 uv0 : TEXCOORD0; + float3 wsEyeRay : TEXCOORD1; +}; + +// This is the shader output data. +struct Conn +{ + float4 position : POSITION; + float2 uv0 : TEXCOORD0; + float3 wsEyeRay : TEXCOORD1; +}; + +// Render Target Paramaters +float4 rtParams0; + +Conn main(Vert IN, + uniform float4x4 modelView : register(C0)) +{ + Conn OUT; + OUT.position = IN.position; + OUT.uv0 = viewportCoordToRenderTarget( IN.uv0, rtParams0 ); + OUT.wsEyeRay = IN.wsEyeRay; + return OUT; +} + diff --git a/Templates/BaseGame/game/core/settings.xml b/Templates/BaseGame/game/core/settings.xml new file mode 100644 index 000000000..7e6bf5e0b --- /dev/null +++ b/Templates/BaseGame/game/core/settings.xml @@ -0,0 +1,13 @@ + + + + + core/ + + + + + a + + + diff --git a/Templates/BaseGame/game/data/ui/art/optionsMenuSliderBitmapArray.png b/Templates/BaseGame/game/data/ui/art/optionsMenuSliderBitmapArray.png new file mode 100644 index 0000000000000000000000000000000000000000..bd41c15b7a53ec6e612b28c09b65978ca37000e1 GIT binary patch literal 2247 zcmV;&2srnNP)W&blM4peLP7w7 z|KIit?E(a4{|iyTvh1Jon@lD*HZ~}V`g0k;vnYz%+S-!KR+7Z(?MdV2c%`*9r4qkWpD z*Vfj2J|BW0dc9tyQl&i_%(uBGPoCVpd$*#ZqQAety}iA-xVR9vkW41MUN1?K>+9TL;1_o?48w5dtK!B#{{N8>r7<4!se!m|@Q3OHw@*C#+J`f0y zB z^|rRQ>h=2k7D^a~4F&@Y!yb<(6biZBZU6uZhe0Bdn3gp50s;Vjs!ypLaGY)2G0V#^|dcEW0?s+vpECz3IgEQz`1khj?HG1$z&}pEf+6dY;0^)DwX-2Vx(Xo!2Z_O z*7xt@?{LeMn^|&Hd`z~@!$jS_h!T{xpZoanVeXk@o@q3i3l}bQcXu0&Mu`(l zIu{g0xm+&0-JVD!gf=|+QbR!y#4xP6x%teQGdp+g4242-b949a-zP~jze5uQK^l#w zyu4g4mnRa5P$)!_B*QR5zEvufb#-+FK>z?SGcz+kKfkfDkw?unnM|&%ti0!sZ!R3Lt+ilT)@rq$ zK7G2atxd1jrwM@^IKc1sbKM0109viqY&H`FvHg(z_PO@|!Gi}W)j`T6&*Oq+SuXWg zR#pH2APB;2HfuB*(Rzj`4%jwNa;-&ocemAQS~=%Cyoh3%>moy$y29JWp6FS1CZ+NB9VwnrPAy5oSc%ryU1og*GWF33r>FU zcsxr>OR-oCMbV0iicGuBWfGP+Pl^Fxo0wHxTx>R*D=I27@tZLF(kJvn&>iUa!wx3(9Gd7v>_FOa=l0r_;$XmIzA7 z48Z2*=EB0lt5>f^Mn+OaU)($?SW1*EW(m(QiL@-t1x?f8aMvSwllZ zPfw3H5mDIg8HOQAl9L>yiCKWuNj^o(t*xzBu3V|DtxfM#JdJUb5RFEKG!ZZ#YrT8- z&f#!?Ah>7Go*OrA96NTb5dVZ}n)dm8tE;OJ1eKMQNf5K7P4Y*N9^J8H$I#Hw%a<=F zCnxLc>y1WZ8YxA*aRfmO27^kanw_0pTU+yZJjrCTrlyAPWeIOMBM73?>Gtp6-`(AP z{P^+QHv=B#2qLyc^uw+H$#E zb8~a`_4NjWA@>sWJ1x82?qD!zGMTEXs?q?EfrPnNT@VCGlQ=}}o@H5y#VzNDn>0-) zlS#Q;p5ec_WETv>tgo*}qfs2kQ4~!p)qw2Z$GL@c!LlsFFfy5pPpSd`K2QI%>tFPu V?)q1$s0{!B002ovPDHLkV1nhyLI(f< literal 0 HcmV?d00001 diff --git a/Templates/BaseGame/game/data/ui/art/slider - Copy.png b/Templates/BaseGame/game/data/ui/art/slider - Copy.png new file mode 100644 index 0000000000000000000000000000000000000000..92fee1e9c13401f0b9fb319b14ebd267b7c1c8a0 GIT binary patch literal 908 zcmV;719SX|P)BsNz zeu<3YC~{d@T`O@7=Bqd8zh+r&1N$TtpK!GELCNikCSDYg%%{_tjFWkfZXnes>n;@ zqR|aj)!gZHXh8b=y;^A;kRu8#6pO{!Mvtd3L02hDKJM?<79kE%E?3>4B+0?(MwHD# znh=bupw`5N2ruq9KZs6u_7))i@#~}<;40XaEJtI*eV$Cj55Bf2ineZ<81cX|$A?-K ziRQ$vUFqvirBbh8IBB!lrWT$p@_Epw4{y{Jk<89s7(yreE_ZXgJAlQLOs#F|`{D~e zk1JU{!ht}*1pQDv9-m=Z)*TLqIgIfHJjnm+Zki*YSv0N&+<5q!9OI!(a(m|ZDWCi2 z+7hQAJOK~#FZBQBsFq0$xe508a5Ng7>+0%qd%a%d^ZA(i`uZ`3VWtE40bY>a7M7V# zB!+jkHs_9=>37>2j-V5r7a4n=; z!uTf4JA}`P;v1uD=Z~Jdb2XVYA zW9_{!_Y>&<@ydWoCaW7|c%=l304u9lXbBBDP18sKV$fMbp11YLDqKf%e#(kCvbjnH z0IY2MSwNH|Nr;Cm_2f`8%fP&(pfq1j&P&EykrGAGkevASCV(r$>yDU`^BZRlB!U6C zWJs>$^wwoAh)RXbi7W=16Mq@GgpA26$sz+uYE0GPzMbJE%h#`yBRq)9| zM)ez$XR{;UB9VaZPe36jlnmZKpDj2gSsD4W{t>WPgB5pU{)$x*B(ajOltDF2!h9-! iq)BbrE0*;C1Q-Ck2#=cQD4UW100001gDw+ literal 0 HcmV?d00001 diff --git a/Templates/BaseGame/game/data/ui/scripts/guis/graphicsMenuSettingsSlider.taml b/Templates/BaseGame/game/data/ui/scripts/guis/graphicsMenuSettingsSlider.taml index 4bbc1c982..74a428114 100644 --- a/Templates/BaseGame/game/data/ui/scripts/guis/graphicsMenuSettingsSlider.taml +++ b/Templates/BaseGame/game/data/ui/scripts/guis/graphicsMenuSettingsSlider.taml @@ -89,7 +89,9 @@ isContainer="false" internalName="slider" canSave="true" - canSaveDynamicFields="false" /> + canSaveDynamicFields="false" + renderTicks="false" + useFillBar="true" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui index 48f049782..20500af05 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetBrowser.gui @@ -323,7 +323,7 @@ minExtent = "64 64"; horizSizing = "relative"; vertSizing = "height"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -345,7 +345,7 @@ minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -414,7 +414,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.showFilterPopup();"; @@ -530,7 +530,7 @@ minExtent = "16 16"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -657,7 +657,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; command = "AssetBrowser.toggleTagFilterPopup();"; @@ -798,7 +798,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiDefaultProfile"; + profile = "ToolsGuiDefaultProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui index f337c946f..d7e82723c 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/assetImport.gui @@ -85,7 +85,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "GuiScrollProfile"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -243,7 +243,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "GuiScrollProfile"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; @@ -574,7 +574,7 @@ minExtent = "8 2"; horizSizing = "width"; vertSizing = "height"; - profile = "GuiScrollProfile"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui index 45d411f20..483fe0d80 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editAsset.gui @@ -66,7 +66,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiScrollProfile"; + profile = "Tools"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui index 90ff639dd..dbe060f62 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/editModule.gui @@ -66,7 +66,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiScrollProfile"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui index 09fcb997d..379d6a521 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui +++ b/Templates/BaseGame/game/tools/assetBrowser/guis/newAsset.gui @@ -196,7 +196,7 @@ minExtent = "8 2"; horizSizing = "right"; vertSizing = "bottom"; - profile = "GuiScrollProfile"; + profile = "ToolsGuiScrollProfile"; visible = "1"; active = "1"; tooltipProfile = "GuiToolTipProfile"; diff --git a/Templates/BaseGame/game/tools/assetBrowser/main.cs b/Templates/BaseGame/game/tools/assetBrowser/main.cs index c5272e44a..394cd47f6 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/main.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/main.cs @@ -22,6 +22,7 @@ if( !isObject( ToolsGuiDefaultNonModalProfile ) ) new GuiControlProfile (ToolsGuiDefaultNonModalProfile : ToolsGuiDefaultProfile) { + opaque = false; modal = false; }; diff --git a/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui index bd76a265e..2e737c942 100644 --- a/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/convexEditor/convexEditorToolbar.ed.gui @@ -114,7 +114,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "menubarProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "bottom"; Position = "195 0"; diff --git a/Templates/BaseGame/game/tools/editorClasses/gui/images/rollout.png b/Templates/BaseGame/game/tools/editorClasses/gui/images/rollout.png index 8ce3f635fdf971502ed0c61f6766d3eef48874f0..39f7caa7eeed7189cd4acac772b33c4c0c47a12a 100644 GIT binary patch literal 6247 zcmV-t7?|gYP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3-Dbu2lItpC%BF@gJH4%c(WgJ=GHAXBQnrPk}K zZj~xm5C{Mf$W-(H{qIu$!@m@aS3aa1ON^R-zW8D*e`J0Bolm3v{=NU%bnP>b+m*A| z4$CITr#oNcypFGI54RJNzqYr>?JD)_I{CWLwd3o8PVOu>8<&ySg`7Rx&GlWC%c2_Z zmUI2zu9Nqj_3L+^aK;E+&sk-sGfwZ{_T0%~g)6S|8ToBolmq#x&N0! zQQ@w5E$VA2`!5b`T*~d!B0q`$1AnLeQ~1fc>Q2-KOKnOwz7%8e_%hxMQ_V7Se|FO` z(c5VgpVoHk_O|SjEw=BVc=<8QCPjRP%fzG;If;t>w#DrG7P%ic%iMVwjEz(w3UV2p7@Ku6<(iAE=DlQH-)6Q7FZ)_L2AfC(zt zftA)fG9lS)<=&i=%s$ozdp1*E2t*)h5}_f12$uK3NAfKLp{jxlK75UV@^5el54TWQO1HQv80kqDYbIb>MPf(9ADYcY;(=G z&|*t1x6*0{KHc}wV^2Nz((ACp4N8C-aioz)8FiWol%}6y#+hcGW!44OmRo*>6<1n$ zl~uo^X0Eh-h}v`H{yA#qikjVllH<}XYHUvF>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V+f000SaNLh0L01m_e01m_fl`9S# z00007bV*G`2jd1210poPp$ZxR008GnL_t(o!|j(r4uUWcML&c+8_)x2JOgn50B10I z0Mc%H0$iCGqhYF*8O)#kG%xA=>1#FvGmKWYtE*&ilk?cuRg#{`c@zLpmSq|`=i|?M z(Gx-d0OT-S+l3p4-Y#6zcB+7j*QyC9nmH{%aUe7R#c<=$qiH*Pa2jADI4v;Ip3?#o z?KwVQTZAhf6(vP|a@M<^j3!JIW?BjNBe*4RTg&V6Sg~AF2J#s5UE5N`zb}&}dZT#ppkg%gGWeS1cB3wOT4&9*C9meV=~6 zPovRL=@TJVE(}A25DbSyYPFh5r#p#j?smJeSS%QgMwH8CRZe%l+z_7UvD@wF^?E9N zB77-Vuh;2zyKFWa6+RIX2%8Vdi^;$fc1Kf>$+H$1wgf0WipwtTCF%9kILlqxEI^)mQJU` ze{42G(=_JuIiBY!6N3affc<{Y<#OSCKL1FwnJ5QvI-OK_e9G@CC0QbulO@xgunwg9 zt3hV0kC}fLt4vR8rscAK!AWb)y}rHi_vPj3jN>>QY&+Z2n#;+OZ;0<^@(uAUnU>Rm hRR3Vgj1`x82O}Z4ec diff --git a/Templates/BaseGame/game/tools/editorClasses/gui/panels/navPanelProfiles.ed.cs b/Templates/BaseGame/game/tools/editorClasses/gui/panels/navPanelProfiles.ed.cs index 4f7b12867..2b690ff79 100644 --- a/Templates/BaseGame/game/tools/editorClasses/gui/panels/navPanelProfiles.ed.cs +++ b/Templates/BaseGame/game/tools/editorClasses/gui/panels/navPanelProfiles.ed.cs @@ -28,7 +28,6 @@ singleton GuiControlProfile (NavPanelProfile) category = "Editor"; }; - singleton GuiControlProfile (NavPanel : NavPanelProfile) { bitmap = "./navPanel"; @@ -64,53 +63,3 @@ singleton GuiControlProfile (NavPanelYellow : NavPanelProfile) bitmap = "./navPanel_yellow"; category = "Editor"; }; -singleton GuiControlProfile (menubarProfile : NavPanelProfile) -{ - bitmap = "./menubar"; - category = "Editor"; - - fillColor = "48 48 48"; - fontColor = "215 215 215"; - fontColorHL = "150 150 150"; - borderColor = "34 34 34"; -}; -singleton GuiControlProfile (editorMenubarProfile : NavPanelProfile) -{ - bitmap = "./editor-menubar"; - category = "Editor"; -}; -singleton GuiControlProfile (editorMenu_wBorderProfile : NavPanelProfile) -{ - bitmap = "./menu-fullborder"; - category = "Editor"; -}; -singleton GuiControlProfile (inspectorStyleRolloutProfile : NavPanelProfile) -{ - bitmap = "./inspector-style-rollout"; - category = "Editor"; -}; -singleton GuiControlProfile (inspectorStyleRolloutListProfile : NavPanelProfile) -{ - bitmap = "./inspector-style-rollout-list"; - category = "Editor"; -}; -singleton GuiControlProfile (inspectorStyleRolloutDarkProfile : NavPanelProfile) -{ - bitmap = "./inspector-style-rollout-dark"; - category = "Editor"; -}; -singleton GuiControlProfile (inspectorStyleRolloutInnerProfile : NavPanelProfile) -{ - bitmap = "./inspector-style-rollout_inner"; - category = "Editor"; -}; -singleton GuiControlProfile (inspectorStyleRolloutNoHeaderProfile : NavPanelProfile) -{ - bitmap = "./inspector-style-rollout-noheader"; - category = "Editor"; -}; -singleton GuiControlProfile (IconDropdownProfile : NavPanelProfile) -{ - bitmap = "./icon-dropdownbar"; - category = "Editor"; -}; diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index 373739be3..ba15100ee 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -22,19 +22,31 @@ function ESettingsWindow::startup( %this ) { + new ArrayObject(EditorSettingsPageList); + new ArrayObject(GameSettingsPageList); + + %this.addEditorSettingsPage("Axis", "Axis Gizmo"); + %this.addEditorSettingsPage("General", "General Settings"); + %this.addEditorSettingsPage("Camera", "Camera Settings"); + %this.addEditorSettingsPage("SceneEditor", "Scene Editor"); + %this.addEditorSettingsPage("ShapeEditor", "Shape Editor"); + %this.addEditorSettingsPage("NavEditor", "Navigation Editor"); + %this.addEditorSettingsPage("Theme", "Theme"); + + %this.addGameSettingsPage("GameGeneral", "General"); + %this.addGameSettingsPage("Gameplay", "Gameplay"); + %this.addGameSettingsPage("Paths", "Paths"); + %this.addGameSettingsPage("UI", "UI"); + %this.addGameSettingsPage("LevelDefaults", "Level Defaults"); + %this.addGameSettingsPage("GameOptions", "Game Options"); + %this.addGameSettingsPage("AssetManagement", "Asset Management"); + + %this.mode = "Editor"; } function ESettingsWindow::onWake( %this ) { - new ArrayObject(SettingsPageList); - %this.addSettingsPage("Axis", "Axis Gizmo"); - %this.addSettingsPage("General", "General Settings"); - %this.addSettingsPage("Camera", "Camera Settings"); - %this.addSettingsPage("SceneEditor", "Scene Editor"); - %this.addSettingsPage("ShapeEditor", "Shape Editor"); - %this.addSettingsPage("NavEditor", "Navigation Editor"); - ESettingsWindowList.setSelectedById( 1 ); } function ESettingsWindow::hideDialog( %this ) @@ -47,7 +59,6 @@ function ESettingsWindow::ToggleVisibility() if ( ESettingsWindow.visible ) { ESettingsWindow.setVisible(false); - EditorSettings.write(); } else { @@ -59,19 +70,50 @@ function ESettingsWindow::ToggleVisibility() ESettingsWindowList.setSelectedById( 1 ); } -/*function ESettingsWindow::addTabPage( %this, %page ) +function ESettingsWindow::toggleProjectSettings(%this) { - ESettingsWindowTabBook.add( %page ); - ESettingsWindowList.addRow( ESettingsWindowTabBook.getSelectedPage(), %page.text ); - ESettingsWindowList.sort(0); -}*/ - -function ESettingsWindow::addSettingsPage(%this, %settingsPageName, %settingsPageText) -{ - SettingsPageList.add(%settingsPageName, %settingsPageText); + %this.ToggleVisibility(); - ESettingsWindowList.addRow( SettingsPageList.count(), %settingsPageText ); + %count = GameSettingsPageList.count(); + for(%i=0; %i < %count; %i++) + { + %settingsPageText = GameSettingsPageList.getValue(%i); + ESettingsWindowList.addRow( %i, %settingsPageText ); + } ESettingsWindowList.sort(0); + + ESettingsWindowList.setSelectedById( 1 ); + + %this.mode = "Project"; + ESettingsWindow.text = "Game Project Settings"; +} + +function ESettingsWindow::toggleEditorSettings(%this) +{ + %this.ToggleVisibility(); + + %count = EditorSettingsPageList.count(); + for(%i=0; %i < %count; %i++) + { + %settingsPageText = EditorSettingsPageList.getValue(%i); + ESettingsWindowList.addRow( %i, %settingsPageText ); + } + ESettingsWindowList.sort(0); + + ESettingsWindowList.setSelectedById( 1 ); + + %this.mode = "Editor"; + ESettingsWindow.text = "Editor Settings"; +} + +function ESettingsWindow::addEditorSettingsPage(%this, %settingsPageName, %settingsPageText) +{ + EditorSettingsPageList.add(%settingsPageName, %settingsPageText); +} + +function ESettingsWindow::addGameSettingsPage(%this, %settingsPageName, %settingsPageText) +{ + GameSettingsPageList.add(%settingsPageName, %settingsPageText); } //----------------------------------------------------------------------------- @@ -79,10 +121,49 @@ function ESettingsWindow::addSettingsPage(%this, %settingsPageName, %settingsPag function ESettingsWindowList::onSelect( %this, %id, %text ) { SettingsInspector.clearFields(); - %pageName = SettingsPageList.getKey(SettingsPageList.getIndexFromValue(%text)); + + if(ESettingsWindow.mode $= "Editor") + %pageName = EditorSettingsPageList.getKey(EditorSettingsPageList.getIndexFromValue(%text)); + else + %pageName = GameSettingsPageList.getKey(GameSettingsPageList.getIndexFromValue(%text)); + eval("ESettingsWindow.get" @ %pageName @ "Settings();"); } +//Read/write field functions +function SettingsInspector::addSettingsField(%this, %settingsFieldName, %labelText, %fieldType, %tooltip, %fieldData) +{ + %moddedSettingsFieldName = strreplace(%settingsFieldName, "/", "-"); + + if(ESettingsWindow.mode $= "Editor") + %this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", EditorSettings.value(%settingsFieldName), %fieldData, "changeEditorSetting"); + else + %this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", ProjectSettings.value(%settingsFieldName), %fieldData, "changeEditorSetting"); +} + +function SettingsInspector::changeEditorSetting(%this, %varName, %value) +{ + %varName = strreplace(%varName, "-", "/"); + + echo("Set " @ %varName @ " to be " @ %value); + + if(ESettingsWindow.mode $= "Editor") + EditorSettings.setValue(%varName, %value); + else + ProjectSettings.setValue(%varName, %value); + + //%id = ESettingsWindowList.getSelectedRow(); + //ESettingsWindowList.setSelectedRow(%id); + + if(ESettingsWindow.mode $= "Editor") + %success = EditorSettings.write(); + else + %success = ProjectSettings.write(); +} + +// +// COMMON EDITOR SETTINGS +// function ESettingsWindow::getAxisSettings(%this) { SettingsInspector.startGroup("Gizmo"); @@ -182,21 +263,89 @@ function ESettingsWindow::getShapeEditorSettings(%this) SettingsInspector.endGroup(); } -//Read/write field functions -function SettingsInspector::addSettingsField(%this, %settingsFieldName, %labelText, %fieldType, %tooltip, %fieldData) +function ESettingsWindow::getThemeSettings(%this) { - %moddedSettingsFieldName = strreplace(%settingsFieldName, "/", "-"); - %this.addCallbackField(%moddedSettingsFieldName, %labelText, %fieldType, "", EditorSettings.value(%settingsFieldName), %fieldData, "changeEditorSetting"); -} + SettingsInspector.startGroup("Colors"); + SettingsInspector.addSettingsField("Theme/headerColor", "Headerbar Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/windowBackgroundColor", "Window Background Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/tabsColor", "Tabs Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/tabsHLColor", "Tabs Highlight Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/tabsSELColor", "Tabs Selected Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/dividerDarkColor", "Divider Dark Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/dividerMidColor", "Divider Mid Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/dividerLightColor", "Divider Light Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/headerTextColor", "Header Text Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/fieldTextColor", "Field Text Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/fieldTextHLColor", "Field Text Highlight Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/fieldTextSELColor", "Field Text Selected Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/fieldBGColor", "Field Background Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/fieldBGHLColor", "Field Background Highlight Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/fieldBGSELColor", "Field Background Selected Color", "ColorI", ""); + + SettingsInspector.addSettingsField("Theme/tooltipBGColor", "Tooltip Background Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/tooltipTextColor", "Tooltip Text Highlight Color", "ColorI", ""); + SettingsInspector.addSettingsField("Theme/tooltipDivColor", "Tooltip Divider Color", "ColorI", ""); + SettingsInspector.endGroup(); +} +// +// COMMON GAME SETTINGS +// +function ESettingsWindow::getGameGeneralSettings(%this) +{ + SettingsInspector.startGroup("General"); + SettingsInspector.addSettingsField("General/ProjectName", "Project Name", "string", ""); + SettingsInspector.endGroup(); +} -function SettingsInspector::changeEditorSetting(%this, %varName, %value) +function ESettingsWindow::getPathsSettings(%this) { - %varName = strreplace(%varName, "-", "/"); + SettingsInspector.startGroup("Paths"); + SettingsInspector.addSettingsField("Paths/splashImagePath", "Splash Image", "filename", ""); + SettingsInspector.addSettingsField("Paths/iconImagePath", "Icon Image", "filename", ""); + SettingsInspector.addSettingsField("Paths/missingTexturePath", "Missing Texture Image", "filename", ""); + SettingsInspector.addSettingsField("Paths/noMaterialPath", "No Material Image", "filename", ""); + SettingsInspector.addSettingsField("Paths/errorMaterialMath", "Error Material Image", "filename", ""); + SettingsInspector.endGroup(); +} + +function ESettingsWindow::getUISettings(%this) +{ + SettingsInspector.startGroup("UI"); + SettingsInspector.addSettingsField("UI/playGUIName", "Play GUI Name", "string", ""); + SettingsInspector.addSettingsField("UI/mainMenuName", "Main Menu GUI Name", "string", ""); + SettingsInspector.endGroup(); +} + +function ESettingsWindow::getAssetManagementSettings(%this) +{ + SettingsInspector.startGroup("Modules"); + SettingsInspector.addSettingsField("AssetManagement/Modules/coreModulePath", "Core Module Path", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Modules/gameDataModulePath", "Game Data Module Path", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Modules/moduleExtension", "Module Extension", "string", ""); + SettingsInspector.endGroup(); - echo("Set " @ %varName @ " to be " @ %value); - - EditorSettings.setValue(%varName, %value); - - %id = ESettingsWindowList.getSelectedRow(); - ESettingsWindowList.setSelectedRow(%id); -} \ No newline at end of file + SettingsInspector.startGroup("Assets"); + SettingsInspector.addSettingsField("AssetManagement/Assets/assetExtension", "Asset Extension", "string", ""); + SettingsInspector.addSettingsField("AssetManagement/Assets/datablockCaching", "Cache Datablocks", "bool", ""); + //SettingsInspector.addSettingsField("AssetManagement/Assets/moduleExtension", "Module Extension", "string", ""); + SettingsInspector.endGroup(); +} + +function ESettingsWindow::getGameplaySettings(%this) +{ + SettingsInspector.startGroup("Game Modes"); + SettingsInspector.addSettingsField("Gameplay/GameModes/defaultModeName", "Default Gamemode Name", "string", ""); + SettingsInspector.endGroup(); +} + +function ESettingsWindow::getGameOptionsSettings(%this) +{ + SettingsInspector.startGroup("Game Modes"); + SettingsInspector.addSettingsField("Gameplay/GameModes/defaultModeName", "Default Gamemode Name", "string", ""); + SettingsInspector.endGroup(); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/images/button.png b/Templates/BaseGame/game/tools/gui/images/button.png index 1c7361e25e5f19d68d0029199ada0b836793d137..79c3e391b039259875611f9e86eff774afd1f0f7 100644 GIT binary patch delta 2938 zcmV-=3x)K734j-nBYy~5dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+O3#rvgEi8 zg#YstK7zP_AddrX5x#+s?++@yy}M_|;i|4uiH{^eWFi4|*#G(W3IF1iaxI~Vw%TjG zc$HpyGJdq{^?F_7RqpTS=6d__WjxfkKO}}S*ZjJz`ha2X3`gr zVtTinK6}I|+kf@>^(lVmtai?Roz6-PgsVP>dOOPfi;079=6hM?t$c*vdcQmGcG)#S zZE@5QuE9-@iH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GD!Jknz~iA|-^;eqRz<+8RIXTX;5>6~DCn36 z4<8kQhQ`KFa(`dv11%o@{fjzQ7MXnIe}UX7C{KZTcjdcXxV{2&PNU21DFXL9I%Yx} z(Wve;YVn=zEqWU9JIJ1#oaiEtQA9$?o}Pjl8|jA>KS-w_o6TNI!6|uJDn&CDtvV!( zuH-=^mE6xJ{_apB_F7?hI-SZQALk+VPk;dcQd{ugkdaD=00000NkvXXu0mjfl*|)v diff --git a/Templates/BaseGame/game/tools/gui/images/tab.png b/Templates/BaseGame/game/tools/gui/images/tab.png index 76080d74d1a508f68e6d04bc88b9eb806f4b50b2..b7b7c98717c835e4a540ec7c93c26af799ce5f53 100644 GIT binary patch delta 4125 zcmZXXS2)~_y2Z7G=)HHM%_yUVD8V2`XLO=7(c2&h{{#s_lu@Ji5+xa;cR>h7qC|-j zC3+jZ+uuIVbI!BRIq%JSZ`Q^7t*f<@9WSwcCL*A2%Wg)yc9;xzW{GIB8K{!;@aqaPvf$-y^MF7%dvlDru16b7v#1_J41Vz zcs}RWeb+@~FLdtC4BEW`)f_Ticvz*xyc`<1@KC%dYoIz>cx_|qbvu5;9H59xCREjoN=Sg)Ahcdell2xb^;GRlM{Rm@LPLj+*qedvc_cTxw3=Q*FL#ijfJgP z;4q*AyBJrLl%B4H$EfqWB}2|35qf>T+if14w&BD9wk0R=+8WZ9Gg%1KjGxD61Y1?B?qX7>#8-auo^0r) z-I?m%(>dCO8~EG~o3Cd6l?`VZK?}pGqED-`$AnI!CqA!vw4R;D(@SB5iB^$ljofH; zu1tq~wv{MY4xYzzcHapo)vr89Hc3H~`PIb@CYjuh(3G|4S?MyC`bYG8KSlM2+J9MZ zY4|nGnC^SVr_NdY$N=NryOf+YlBoV5)X945@-;Fuv&Qa3C{|@iSVm%%sxhM|5-@GwQziB0RVX=Tc}nEp%NKz4edgJr{JXWWf^5pEGW z!X2w4%yQ=JUFsTAK9D2tcXO;nBrY%RBL_80Nu-OZ?|2A+xHps zfb!U-84uXdugTgF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)PGy6 ziQ`oORyv&)s!R9M#L-gdNxc0)Ev+8xv|BESaPCJ67WMgHvw4al+ zA?)!W^&;A4`Y#S9|CIga5tDCp}yTSu7zQI>q;y+^3y?w+d6! KRjpC64gVLSU(8$p literal 495 zcmeAS@N?(olHy`uVBq!ia0vp^&Oltj!3HE(mix;BDVAa<&kznEsNqQI0P;BtJR*x3 z82FBWFymBhK53w!WQl7;NpOBzNqJ&XDnogBxn5>oc5!lIL8@MUQTpt6Hc|`>j5(ez zjv*Cu-rh3Ix*H(iaB=yAxf)&z-_&asCLV9y+jgHr)bC|<%}j;a{k+e&FemL$5N%#| z-7tY3%xAKZ@(^>(;+s``z+w#{JVzjpoJ2{d+BGZ&$tYy-$yT@(~V0CtQ>o z`$O}~Hs`~W|I}7V*+2hz?f0CrE${ce=R1_%A(+%6q3DK#D*wGtp6~wbT37kI*BvdE zrADqhR#8zSvwzxCh!NXz2^(>Hn=HbJKZ-K@Bym~?cFGTD3z?R~*+Tf-ML_N&|J$pP V&L^+VKL(5(22WQ%mvv4FO#q@{v@!qy diff --git a/Templates/BaseGame/game/tools/gui/images/window.png b/Templates/BaseGame/game/tools/gui/images/window.png index 4d264bb24044980f1968e62d94032d57a08243c1..9aff5d276027ca3e67a5877fd8cd2c7930720a75 100644 GIT binary patch literal 5308 zcmZu#WlS7ex5c5jOQ8(z#oZkSDKIz`O0nWlY@om(#a&yVxa&{~!{8KYkzyUR*g$a` ziaWgCmv{5!OWxYqYvru$>^~sTp%DQ!RY8AM@o)R%;r!(Qtt<~T zG*X{;MrOXC*I*_uZ%;>OHwPx)KraU-hX7~CzatCvxz65fGRcvTr<6WeD5jMD88;8X z!9o&y&FV~}nb`(Q9tSQ~*4D3U#2QtjH$9KbTcKC+2$8Gz1cVg^~E-xE?i5fstOahUz}!Lkey&s*PVpJi;ixUoPigK9qg zVCBDjNFjDPc|im_8oGZbc3HGVqW>9CL6aS(^e_wTLUajr-tlbzirRr z^K2b!NjM@m%pE{p6@~+fg8bW4{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z82FBWFymBhK53w!WQl7;NpOBzNqJ&XDnogBxn5>oc5!lIL8@MUQTpt6Hc|`>Ot(B; z978JRyq&u@?{a`d+x_=fZte;;l;G41>f1btJHai)!-FTZJT2i7+l`F;hOHciPLexW z*jhexDoM;@oN62W=(FLI_Dk}C(v!kZ{+zdT+v~-4RW&l#mpi*Mx*qbF?8vpkMB=yp z<5zt<^=|%T{##cc9y*`l#!Oi&(TRusmVeHR6!Q7ELrSqld{xwzsI}>D%YIuk@US)C zo_z9&gGwd%@n|{QmF9KXZJmxK#eH{xH?QF+`wRI;Y_-lXMGf z0{4cE3^|NuVhy?njxlXuy%E8%jbZi^<{P&YCOdvJ+u;b}OLHF(OGswC!IY!J5Z%xV z(&TB^u$R|NG9|wmzajIUZ)KXp)4pTs^R0CrlMPoZF*kgyh{+C^`#E}T*jvNZDnHLN zV49BANht^3r>=e-^!?AW - - Grid_512_Orange + + 72 70 68 255 + 234 232 230 255 + 100 98 96 255 + 96 94 92 255 + 59 58 57 255 + 50 49 48 255 + 72 70 68 255 + 50 49 48 255 + 240 240 240 255 + 59 58 57 255 + 236 234 232 255 + 50 49 48 255 + 37 36 35 255 + 178 175 172 255 + 43 43 43 255 + 17 16 15 255 + 255 255 255 255 + 32 31 30 255 + + + tools/gui + 1024 768 + + http://www.garagegames.com/products/torque-3d/documentation/user + ../../../Documentation/Torque 3D - Script Manual.chm + ../../../Documentation/Official Documentation.html + + + 1 + 2 + 8 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + + + 0 + 0 + 0 + + + Categorized + + + 0 + + + + 0 + 1 + 0.8 + 100 + 0.8 + 15 + 0 + + 0 + 0 + 0 + 500 + 10 10 10 + 255 255 255 20 + + + + 0 + 50 + AssetWork_Debug.exe + 40 + screenCenter + 6 + 1 + WorldEditorInspectorPlugin + + 255 255 0 255 + 255 0 0 255 + 255 255 255 255 + 255 255 0 255 + 0 0 255 255 + 0 255 0 255 + 100 100 100 255 + + + 1 + 100 + 0 + 0 + 0 + 1 + 2 + + + 1 + 0 + 255 + 20 + 8 + + + 50 50 50 255 + 215 215 215 255 + 48 48 48 255 + 255 255 255 255 + 180 180 180 255 + + + tools/worldEditor/images/DefaultHandle + tools/worldEditor/images/SelectHandle + tools/worldEditor/images/LockedHandle + + + 1 + 1 + 1 + 1 + 1 + + + 51 51 51 100 + 0 + 255 255 255 100 + 1 + 102 102 102 100 + + + ../../../Documentation/Official Documentation.html + ../../../Documentation/Torque 3D - Script Manual.chm + http://www.garagegames.com/products/torque-3d/documentation/user + http://www.garagegames.com/products/torque-3d/forums + + + + AIPlayer data/FPSGameplay/levels @@ -14,125 +152,7 @@ - - screenCenter - 0 - WorldEditorInspectorPlugin - 1 - 40 - AssetWork_Debug.exe - 6 - 50 - - 255 255 255 255 - 100 100 100 255 - 255 255 0 255 - 255 255 0 255 - 0 0 255 255 - 255 0 0 255 - 0 255 0 255 - - - 48 48 48 255 - 255 255 255 255 - 215 215 215 255 - 180 180 180 255 - 50 50 50 255 - - - 100 - 0 - 0 - 0 - 1 - 2 - 1 - - - 51 51 51 100 - 102 102 102 100 - 1 - 255 255 255 100 - 0 - - - tools/worldEditor/images/DefaultHandle - tools/worldEditor/images/SelectHandle - tools/worldEditor/images/LockedHandle - - - http://www.garagegames.com/products/torque-3d/forums - ../../../Documentation/Official Documentation.html - ../../../Documentation/Torque 3D - Script Manual.chm - http://www.garagegames.com/products/torque-3d/documentation/user - - - 1 - 0 - 255 - 20 - 8 - - - 1 - 1 - 1 - 1 - 1 - - - - 0.8 - 100 - 0.8 - 15 - 0 - 0 - 1 - - 0 - 255 255 255 20 - 0 - 10 10 10 - 0 - 500 - - - - tools/gui - 1024 768 - - 0 - 0 - 0 - - - http://www.garagegames.com/products/torque-3d/documentation/user - ../../../Documentation/Torque 3D - Script Manual.chm - ../../../Documentation/Official Documentation.html - - - 1 - 1 - 8 - 1 - 1 - 2 - 1 - 0 - - - 0 - - - 1 - 1 - - - Categorized - - - - AIPlayer + + Grid_512_Orange diff --git a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui index 0435e3837..ccaaf03fb 100644 --- a/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/shapeEditor/gui/ShapeEditorToolbar.ed.gui @@ -25,7 +25,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "menubarProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "bottom"; Position = "0 0"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui index f860bdd42..33433fa68 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui @@ -23,7 +23,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "menubarProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "bottom"; Position = "0 0"; @@ -313,7 +313,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "menubarProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "top"; Position = "0 578"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui index f57c39be7..1f15e5310 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/ToolsToolbar.ed.gui @@ -4,7 +4,7 @@ Enabled = "0"; internalName = "ToolsToolbar"; isContainer = "1"; - Profile = "editorMenubarProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = "0 31"; @@ -20,7 +20,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "bottom"; position = "4 3"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui index 79f34211d..95e48baaf 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorToolbar.ed.gui @@ -4,7 +4,7 @@ internalName = "WorldEditorToolbar"; Enabled = "1"; isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "right"; VertSizing = "bottom"; Position = "306 0"; @@ -21,7 +21,7 @@ canSaveDynamicFields = "0"; Enabled = "1"; isContainer = "1"; - Profile = "ToolsGuiDefaultProfile"; + Profile = "ToolsMenubarProfile"; HorizSizing = "width"; VertSizing = "bottom"; Position = "0 3"; @@ -83,7 +83,7 @@ new GuiControl(SnapToBar){ isContainer = "1"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsMenubarProfile"; Position = "116 3"; Extent = "123 27"; Padding = "4"; @@ -296,7 +296,7 @@ new GuiControl(ToggleButtonBar){ isContainer = "1"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsMenubarProfile"; Position = "313 3"; Extent = "65 27"; @@ -377,7 +377,7 @@ new GuiControl(ToggleNodeBar){ isContainer = "1"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsMenubarProfile"; Position = "386 3"; Extent = "63 27"; @@ -441,7 +441,7 @@ new GuiControl(PrefabBar){ isContainer = "1"; - profile = "ToolsGuiDefaultProfile"; + profile = "ToolsMenubarProfile"; Position = "386 3"; Extent = "63 27"; visible = true; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui index cae52e378..92966857f 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/WorldEditorTreeWindow.ed.gui @@ -274,6 +274,7 @@ canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; + profile = "ToolsGuiScrollProfile"; hovertime = "1000"; Docking = "Client"; Margin = "0 0 0 0"; diff --git a/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorCreatorWindow.ed.gui b/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorCreatorWindow.ed.gui index 03a3d6d8a..31652d293 100644 --- a/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorCreatorWindow.ed.gui +++ b/Templates/BaseGame/game/tools/worldEditor/gui/guiWorldEditorCreatorWindow.ed.gui @@ -79,6 +79,7 @@ canSave = "1"; Visible = "1"; tooltipprofile = "ToolsGuiToolTipProfile"; + profile = "ToolsGuiScrollProfile"; hovertime = "1000"; Docking = "Client"; Margin = "0 0 0 0"; diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/lightViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/lightViz.cs index 574063460..1b2e5de3d 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/lightViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/lightViz.cs @@ -51,13 +51,11 @@ function toggleColorBufferViz( %enable ) } else if ( %enable ) { - AL_DeferredShading.disable(); AL_ColorBufferVisualize.enable(); } else if ( !%enable ) { AL_ColorBufferVisualize.disable(); - AL_DeferredShading.enable(); } } @@ -360,12 +358,7 @@ function toggleBackbufferViz( %enable ) if ( %enable $= "" ) { $AL_BackbufferVisualizeVar = AL_DeferredShading.isEnabled() ? true : false; - AL_DeferredShading.toggle(); } - else if ( %enable ) - AL_DeferredShading.disable(); - else if ( !%enable ) - AL_DeferredShading.enable(); } function toggleColorBlindnessViz( %enable ) diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.cs index 7f87df251..43bb65ea4 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/menus.ed.cs @@ -116,7 +116,7 @@ function EditorGui::buildMenus(%this) extent = Canvas.extent.x SPC "20"; minExtent = "320 20"; horizSizing = "width"; - profile = "GuiMenuBarProfile"; + profile = "ToolsGuiMenuBarProfile"; }; // File Menu @@ -185,11 +185,12 @@ function EditorGui::buildMenus(%this) Item[9] = "Select..." TAB "" TAB "EditorGui.toggleObjectSelectionsWindow();"; item[10] = "-"; item[11] = "Audio Parameters..." TAB "" TAB "EditorGui.toggleSFXParametersWindow();"; - item[12] = "Editor Settings..." TAB "" TAB "ESettingsWindow.ToggleVisibility();"; - item[13] = "Snap Options..." TAB "" TAB "ESnapOptions.ToggleVisibility();"; - item[14] = "-"; - item[15] = "Game Options..." TAB "" TAB "Canvas.pushDialog(optionsDlg);"; - item[16] = "PostEffect Manager" TAB "" TAB "Canvas.pushDialog(PostFXManager);"; + item[12] = "Editor Settings..." TAB "" TAB "ESettingsWindow.toggleEditorSettings();"; + item[13] = "Game Settings..." TAB "" TAB "ESettingsWindow.toggleProjectSettings();"; + item[14] = "Snap Options..." TAB "" TAB "ESnapOptions.ToggleVisibility();"; + item[15] = "-"; + item[16] = "Game Options..." TAB "" TAB "Canvas.pushDialog(optionsDlg);"; + item[17] = "PostEffect Manager" TAB "" TAB "Canvas.pushDialog(PostFXManager);"; }; %this.menuBar.insert(%editMenu);