diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-07-17 15:05:47 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-07-17 15:05:47 -0700 |
commit | f7f9601567ce089f3335407f1d3c7d32dbb18c60 (patch) | |
tree | 9805a5fae44ae463d25b2f42cd69bfa17acdb634 | |
parent | 53b2efd13143f85c447320fa35d192df466b16ca (diff) |
Got hero probes rendering from the camera.
DRTVWR-583
-rw-r--r-- | indra/llplugin/llpluginprocessparent.cpp | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 9 | ||||
-rw-r--r-- | indra/newview/llreflectionmapmanager.cpp | 26 |
3 files changed, 14 insertions, 23 deletions
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 756d0b5db8..f5966b71de 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -582,7 +582,7 @@ void LLPluginProcessParent::idle(void) params.args.add("-e"); params.args.add("tell application \"Terminal\""); params.args.add("-e"); - params.args.add(STRINGIZE("set win to do script \"gdb -pid " + params.args.add(STRINGIZE("set win to do script \"lldb -pid " << mProcess->getProcessID() << "\"")); params.args.add("-e"); params.args.add("do script \"continue\" in win"); diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index a63d445115..d8118fab82 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -117,8 +117,8 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 additive, vec3 atten); -vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, - float perceptualRoughness, +vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor, + float perceptualRoughness, float metallic, vec3 n, // normal vec3 v, // surface point to camera @@ -193,7 +193,7 @@ void main() if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 orm = texture(specularRect, tc).rgb; + vec3 orm = texture(specularRect, tc).rgb; float perceptualRoughness = orm.g; float metallic = orm.b; float ao = orm.r; @@ -298,7 +298,6 @@ void main() vec4 fogged = applyWaterFogViewLinear(pos.xyz, vec4(color, bloom)); color = fogged.rgb; #endif - frag_color.rgb = textureLod(heroProbes, vec4(norm.xyz, 0), 0).rgb; - //frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results + frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results frag_color.a = 0.0; } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index fe3ea15352..45489fb35b 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -333,20 +333,14 @@ void LLReflectionMapManager::update() { LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("rmmu - realtime"); - // update the closest dynamic probe realtime - // should do a full irradiance pass on "odd" frames and a radiance pass on "even" frames - mHeroProbe->autoAdjustOrigin(); - - // store and override the value of "isRadiancePass" -- parts of the render pipe rely on "isRadiancePass" to set - // lighting values etc + + mHeroProbe->mOrigin.load3(LLViewerCamera::instance().mOrigin.mV); bool radiance_pass = isRadiancePass(); - mRadiancePass = mRealtimeRadiancePass; + mRadiancePass = true; for (U32 i = 0; i < 6; ++i) { updateProbeFace(mHeroProbe, i, mHeroProbeResolution, mHeroArray); } - - mRealtimeRadiancePass = !mRealtimeRadiancePass; // restore "isRadiancePass" mRadiancePass = radiance_pass; @@ -713,12 +707,9 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, U { LL_PROFILE_GPU_ZONE("probe mip copy"); cubeArray->bind(0); - //glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, probe->mCubeIndex * 6 + face, 0, 0, res, res); + glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, sourceIdx * 6 + face, 0, 0, res, res); - //if (i == 0) - //{ - //glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, probe->mCubeIndex * 6 + face, 0, 0, res, res); - //} + cubeArray->unbind(); } mMipChain[i].flush(); @@ -732,7 +723,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face, U gReflectionMipProgram.unbind(); } - if (face == 5 && probe->mType != LLReflectionMap::ProbeType::REFLECTION) + if (face == 5) { mMipChain[0].bindTarget(); static LLStaticHashedString sSourceIdx("sourceIdx"); @@ -1330,10 +1321,11 @@ void LLReflectionMapManager::initReflectionMaps() mDefaultProbe->mProbeIndex = 0; touch_default_probe(mDefaultProbe); - mHeroProbeResolution = 512; + mHeroProbeResolution = 128; mHeroArray = new LLCubeMapArray(); - mHeroArray->allocate(mHeroProbeResolution, 3, 1); + // Revise when we have both water and mirrors in hero probes. + mHeroArray->allocate(mHeroProbeResolution, 3, 2, true); if (mHeroProbe.isNull()) { mHeroProbe = new LLReflectionMap(); |