diff options
-rwxr-xr-x | indra/llcommon/llfasttimer.h | 1 | ||||
-rwxr-xr-x | indra/llcommon/llfasttimer_class.cpp | 19 | ||||
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 12 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl | 14 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 8 |
5 files changed, 36 insertions, 18 deletions
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index c177027f4e..2b25f2fabb 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -27,7 +27,6 @@ #ifndef LL_FASTTIMER_H #define LL_FASTTIMER_H -// Temporarily(?) de-inlined these functions to simplify diagnosis of problems. // Implementation of getCPUClockCount32() and getCPUClockCount64 are now in llfastertimer_class.cpp. // pull in the actual class definition diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index fba8a3bb57..0828635881 100755 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -64,6 +64,8 @@ BOOL LLFastTimer::sMetricLog = FALSE; LLMutex* LLFastTimer::sLogLock = NULL; std::queue<LLSD> LLFastTimer::sLogQueue; +#define USE_RDTSC 0 + #if LL_LINUX || LL_SOLARIS U64 LLFastTimer::sClockResolution = 1000000000; // Nanosecond resolution #else @@ -237,10 +239,23 @@ U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer #else // windows or x86-mac or x86-linux or x86-solaris U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer { +#if USE_RDTSC || !LL_WINDOWS //getCPUFrequency returns MHz and sCPUClockFrequency wants to be in Hz static U64 sCPUClockFrequency = U64(LLProcessorInfo().getCPUFrequency()*1000000.0); // we drop the low-order byte in our timers, so report a lower frequency +#else + // If we're not using RDTSC, each fasttimer tick is just a performance counter tick. + // Not redefining the clock frequency itself (in llprocessor.cpp/calculate_cpu_frequency()) + // since that would change displayed MHz stats for CPUs + static bool firstcall = true; + static U64 sCPUClockFrequency; + if (firstcall) + { + QueryPerformanceFrequency((LARGE_INTEGER*)&sCPUClockFrequency); + firstcall = false; + } +#endif return sCPUClockFrequency >> 8; } #endif @@ -497,7 +512,7 @@ void LLFastTimer::NamedTimer::resetFrame() llinfos << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << llendl; } call_count++; - + F64 iclock_freq = 1000.0 / countsPerSecond(); // good place to calculate clock frequency F64 total_time = 0; @@ -814,7 +829,7 @@ LLFastTimer::LLFastTimer(LLFastTimer::FrameState* state) // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing -#ifdef USE_RDTSC +#if USE_RDTSC U32 LLFastTimer::getCPUClockCount32() { U32 ret_val; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ef3803aed6..4e5ad60513 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1353,7 +1353,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>8.0</real> + <real>11.0</real> </map> <key>CameraFocalLength</key> @@ -1365,22 +1365,22 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>50</real> + <real>35</real> </map> - <key>CameraCoC</key> + <key>CameraCoCRatio</key> <map> <key>Comment</key> - <string>Camera circle of confusion for DoF effect (in millimeters)</string> + <string>Ratio of circle of confusion to vertical resolution for DoF effect.</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>F32</string> <key>Value</key> - <real>0.05</real> + <real>54</real> </map> - + <key>CertStore</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index 77e3e41ea4..02712e0a5b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -73,12 +73,14 @@ void main() { //pixel is behind far focal plane float w = 1.0; - float fd = far_focal_distance; + float fd = (depth[0]-far_focal_distance)*0.5+far_focal_distance; float sc = far_focal_distance - depth[0]; - sc /= -far_focal_distance; + sc /= near_focal_distance-far_focal_distance; + + sc = sqrt(sc); sc = min(sc, 8.0); - + while (sc > 1.0) { dofSample(diff,w, fd, sc,sc); @@ -104,8 +106,10 @@ void main() { //pixel is in front of near focal plane //diff.r = 1.0; float w = 1.0; - float sc = depth[0] - fd; - sc = min(-sc/fd*16.0, 8.0); + float sc = near_focal_distance-depth[0]; + sc /= near_focal_distance; + sc *= 8.0; + sc = min(sc, 8.0); fd = depth[0]; while (sc > 1.0) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1c91c528f7..f0446b024c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6161,8 +6161,9 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) subject_distance *= 1000.f; F32 fnumber = gSavedSettings.getF32("CameraFNumber"); F32 focal_length = gSavedSettings.getF32("CameraFocalLength"); - F32 coc = gSavedSettings.getF32("CameraCoC"); + F32 coc_ratio = gSavedSettings.getF32("CameraCoCRatio"); + F32 coc = coc_ratio/mScreen.getHeight(); F32 hyperfocal_distance = (focal_length*focal_length)/(fnumber*coc); @@ -6173,8 +6174,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) //adjust focal length for zoom F32 fov = LLViewerCamera::getInstance()->getView(); - F32 default_fov = LLViewerCamera::getInstance()->getDefaultFOV(); - focal_length *= default_fov/fov; + focal_length *= 1.f/fov; F32 near_focal_distance = hyperfocal_distance*subject_distance/(hyperfocal_distance+subject_distance); @@ -6196,7 +6196,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) if (channel > -1) { mScreen.bindTexture(0, channel); - gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } gGL.begin(LLRender::TRIANGLE_STRIP); |