DRTVWR-559 Add RenderAutomaticReflectionProbes control. Tweak automatic exposure.
parent
f5fb3ae271
commit
6162b9208a
|
|
@ -10367,7 +10367,7 @@
|
|||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<real>1</real>
|
||||
<real>2</real>
|
||||
</map>
|
||||
<key>RenderExposure</key>
|
||||
<map>
|
||||
|
|
@ -10403,18 +10403,17 @@
|
|||
<key>Value</key>
|
||||
<real>0</real>
|
||||
</map>
|
||||
<key>RenderReflectionProbeTextureHackID</key>
|
||||
<key>RenderAutomaticReflectionProbes</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>HACK -- Any object with a diffuse texture with this ID will be treated as a user override reflection probe. (default is "Violet Info Hub" photo from Library)</string>
|
||||
<string>Automatic reflection probes control. 0 - disable, 1 - Terrain/water only, 2- Terrain/water + objects. Requires restart.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<string>6b186931-05da-eafa-a3ed-a012a33bbfb6</string>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
|
||||
<key>RenderReflectionRes</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ float lum(vec3 col)
|
|||
|
||||
void main()
|
||||
{
|
||||
float step = 1.0/32.0;
|
||||
float step = 1.0/16.0;
|
||||
|
||||
float start = step;
|
||||
float end = 1.0-step;
|
||||
|
|
@ -82,7 +82,7 @@ void main()
|
|||
|
||||
float L = lum(col);
|
||||
|
||||
float s = clamp(0.1/L, 0.5, 2.0);
|
||||
float s = clamp(0.1/L, 0.5, 2.5);
|
||||
|
||||
float prev = texture(exposureMap, vec2(0.5,0.5)).r;
|
||||
s = mix(prev, s, min(dt*2.0, 0.04));
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ vec3 toneMap(vec3 color)
|
|||
// this factor is based on the exposure correction of Krzysztof Narkowicz in his
|
||||
// implemetation of ACES tone mapping
|
||||
color *= 1.0/0.6;
|
||||
//color /= 0.6;
|
||||
color = toneMapACES_Hill(color);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -328,29 +328,20 @@ void LLReflectionMapManager::getReflectionMaps(std::vector<LLReflectionMap*>& ma
|
|||
|
||||
LLReflectionMap* LLReflectionMapManager::registerSpatialGroup(LLSpatialGroup* group)
|
||||
{
|
||||
#if 1
|
||||
if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_VOLUME)
|
||||
static LLCachedControl<S32> automatic_probes(gSavedSettings, "RenderAutomaticReflectionProbes", 2);
|
||||
if (automatic_probes > 1)
|
||||
{
|
||||
OctreeNode* node = group->getOctreeNode();
|
||||
F32 size = node->getSize().getF32ptr()[0];
|
||||
if (size >= 15.f && size <= 17.f)
|
||||
if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_VOLUME)
|
||||
{
|
||||
return addProbe(group);
|
||||
OctreeNode* node = group->getOctreeNode();
|
||||
F32 size = node->getSize().getF32ptr()[0];
|
||||
if (size >= 15.f && size <= 17.f)
|
||||
{
|
||||
return addProbe(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_TERRAIN)
|
||||
{
|
||||
OctreeNode* node = group->getOctreeNode();
|
||||
F32 size = node->getSize().getF32ptr()[0];
|
||||
if (size >= 15.f && size <= 17.f)
|
||||
{
|
||||
return addProbe(group);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1255,43 +1255,45 @@ U32 LLViewerRegion::getNumOfVisibleGroups() const
|
|||
|
||||
void LLViewerRegion::updateReflectionProbes()
|
||||
{
|
||||
#if 1
|
||||
const F32 probe_spacing = 32.f;
|
||||
const F32 probe_radius = sqrtf((probe_spacing * 0.5f) * (probe_spacing * 0.5f) * 3.f);
|
||||
const F32 hover_height = 2.f;
|
||||
|
||||
F32 start = probe_spacing * 0.5f;
|
||||
|
||||
U32 grid_width = REGION_WIDTH_METERS / probe_spacing;
|
||||
|
||||
mReflectionMaps.resize(grid_width * grid_width);
|
||||
|
||||
F32 water_height = getWaterHeight();
|
||||
LLVector3 origin = getOriginAgent();
|
||||
|
||||
for (U32 i = 0; i < grid_width; ++i)
|
||||
static LLCachedControl<S32> automatic_probes(gSavedSettings, "RenderAutomaticReflectionProbes", 2);
|
||||
if (automatic_probes > 0)
|
||||
{
|
||||
F32 x = i * probe_spacing + start;
|
||||
for (U32 j = 0; j < grid_width; ++j)
|
||||
const F32 probe_spacing = 32.f;
|
||||
const F32 probe_radius = sqrtf((probe_spacing * 0.5f) * (probe_spacing * 0.5f) * 3.f);
|
||||
const F32 hover_height = 2.f;
|
||||
|
||||
F32 start = probe_spacing * 0.5f;
|
||||
|
||||
U32 grid_width = REGION_WIDTH_METERS / probe_spacing;
|
||||
|
||||
mReflectionMaps.resize(grid_width * grid_width);
|
||||
|
||||
F32 water_height = getWaterHeight();
|
||||
LLVector3 origin = getOriginAgent();
|
||||
|
||||
for (U32 i = 0; i < grid_width; ++i)
|
||||
{
|
||||
F32 y = j * probe_spacing + start;
|
||||
|
||||
U32 idx = i * grid_width + j;
|
||||
|
||||
if (mReflectionMaps[idx].isNull())
|
||||
F32 x = i * probe_spacing + start;
|
||||
for (U32 j = 0; j < grid_width; ++j)
|
||||
{
|
||||
mReflectionMaps[idx] = gPipeline.mReflectionMapManager.addProbe();
|
||||
F32 y = j * probe_spacing + start;
|
||||
|
||||
U32 idx = i * grid_width + j;
|
||||
|
||||
if (mReflectionMaps[idx].isNull())
|
||||
{
|
||||
mReflectionMaps[idx] = gPipeline.mReflectionMapManager.addProbe();
|
||||
}
|
||||
|
||||
LLVector3 probe_origin = LLVector3(x, y, llmax(water_height, mImpl->mLandp->resolveHeightRegion(x, y)));
|
||||
probe_origin.mV[2] += hover_height;
|
||||
probe_origin += origin;
|
||||
|
||||
mReflectionMaps[idx]->mOrigin.load3(probe_origin.mV);
|
||||
mReflectionMaps[idx]->mRadius = probe_radius;
|
||||
}
|
||||
|
||||
LLVector3 probe_origin = LLVector3(x,y, llmax(water_height, mImpl->mLandp->resolveHeightRegion(x,y)));
|
||||
probe_origin.mV[2] += hover_height;
|
||||
probe_origin += origin;
|
||||
|
||||
mReflectionMaps[idx]->mOrigin.load3(probe_origin.mV);
|
||||
mReflectionMaps[idx]->mRadius = probe_radius;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry)
|
||||
|
|
|
|||
Loading…
Reference in New Issue