Commit

r30980:f6b1dc9c6d32 public

Description:

FIRE-4178: Ported progressive draw distance stepping from Phoenix by Techwolf Lupindo, released under LGPL - Added additional feature to cancel stepping in progress if draw distance is changed manually

Commit status:

[Not Reviewed]

References:

Comments:

0 Commit comments 0 Inline Comments

Unresolved TODOs:

There are no unresolved TODOs

Author

-
Add another comment

r30980:f6b1dc9c6d32 -

@@ -19019,6 +19019,38
19019 <string>a3f48b85-c29f-1f97-ebb6-644b7c053512</string>
19019 <string>a3f48b85-c29f-1f97-ebb6-644b7c053512</string>
19020 </map>
19020 </map>
19021 <!-- End: Sounds for Prefs > Chat > Radar -->
19021 <!-- End: Sounds for Prefs > Chat > Radar -->
19022
19022 <key>FSSavedRenderFarClip</key>
19023 <map>
19024 <key>Comment</key>
19025 <string>Saved draw distance (used in case of logout during progressive draw distance stepping)</string>
19026 <key>Persist</key>
19027 <integer>1</integer>
19028 <key>Type</key>
19029 <string>F32</string>
19030 <key>Value</key>
19031 <real>0.0</real>
19032 </map>
19033 <key>FSRenderFarClipStepping</key>
19034 <map>
19035 <key>Comment</key>
19036 <string>Set to TRUE to increase performance via progressive draw distance stepping</string>
19037 <key>Persist</key>
19038 <integer>1</integer>
19039 <key>Type</key>
19040 <string>Boolean</string>
19041 <key>Value</key>
19042 <integer>0</integer>
19043 </map>
19044 <key>FSRenderFarClipSteppingInterval</key>
19045 <map>
19046 <key>Comment</key>
19047 <string>Interval in seconds between each draw distance increment</string>
19048 <key>Persist</key>
19049 <integer>1</integer>
19050 <key>Type</key>
19051 <string>U32</string>
19052 <key>Value</key>
19053 <integer>20</integer>
19054 </map>
19023 </map>
19055 </map>
19024 </llsd>
19056 </llsd>
@@ -483,9 +483,8
483 {
483 {
484 if(from_gesture)
484 if(from_gesture)
485 {
485 {
486 reportToNearbyChat("Due to the changes in code, it is no longer necessary to use this gesture.");
486 reportToNearbyChat(LLTrans::getString("DrawDistanceSteppingGestureObsolete"));
487 // We don't have this debug setting
487 gSavedSettings.setBOOL("FSRenderFarClipStepping", TRUE);
488 // gSavedSettings.setBOOL("RenderFarClipStepping",TRUE);
489 return false;
488 return false;
490 }
489 }
491 int drawDist;
490 int drawDist;
@@ -493,7 +492,9
493 {
492 {
494 gSavedSettings.setF32("RenderFarClip", drawDist);
493 gSavedSettings.setF32("RenderFarClip", drawDist);
495 gAgentCamera.mDrawDistance = drawDist;
494 gAgentCamera.mDrawDistance = drawDist;
496 reportToNearbyChat(std::string(llformat("Draw distance set to: %dm",drawDist)));
495 LLStringUtil::format_map_t args;
496 args["DISTANCE"] = llformat("%d", drawDist);
497 reportToNearbyChat(LLTrans::getString("FSCmdLineDrawDistanceSet", args));
497 return false;
498 return false;
498 }
499 }
499 }
500 }
@@ -4226,6 +4226,20
4226 //release geometry from old location
4226 //release geometry from old location
4227 gPipeline.resetVertexBuffers();
4227 gPipeline.resetVertexBuffers();
4228
4228
4229 // <FS:Ansariel> Draw Distance stepping
4230 if (gSavedSettings.getBOOL("FSRenderFarClipStepping"))
4231 {
4232 F32 draw_distance = gSavedSettings.getF32("RenderFarClip");
4233 if (gSavedDrawDistance < draw_distance)
4234 {
4235 gSavedDrawDistance = draw_distance;
4236 }
4237 gSavedSettings.setF32("FSSavedRenderFarClip", gSavedDrawDistance);
4238 gSavedSettings.setF32("RenderFarClip", 32.0f);
4239 gLastDrawDistanceStep = 32.0f;
4240 }
4241 // </FS:Ansariel>
4242
4229 // bit of a hack -KC
4243 // bit of a hack -KC
4230 KCWindlightInterface::instance().setTPing(true);
4244 KCWindlightInterface::instance().setTPing(true);
4231 }
4245 }
@@ -2470,6 +2470,19
2470 LLStartUp::setStartupState( STATE_STARTED );
2470 LLStartUp::setStartupState( STATE_STARTED );
2471 display_startup();
2471 display_startup();
2472
2472
2473 // <FS:Ansariel> Draw Distance stepping
2474 if (gSavedSettings.getBOOL("FSRenderFarClipStepping"))
2475 {
2476 // progressive draw distance stepping if requested.
2477 F32 dist1 = gSavedSettings.getF32("RenderFarClip");
2478 F32 dist2 = gSavedSettings.getF32("FSSavedRenderFarClip");
2479 gSavedDrawDistance = (dist1 >= dist2 ? dist1 : dist2);
2480 gSavedSettings.setF32("FSSavedRenderFarClip", gSavedDrawDistance);
2481 gSavedSettings.setF32("RenderFarClip", 32.0f);
2482 gLastDrawDistanceStep = 32.0f;
2483 }
2484 // </FS:Ansariel>
2485
2473 // Unmute audio if desired and setup volumes.
2486 // Unmute audio if desired and setup volumes.
2474 // Unmute audio if desired and setup volumes.
2487 // Unmute audio if desired and setup volumes.
2475 // This is a not-uncommon crash site, so surround it with
2488 // This is a not-uncommon crash site, so surround it with
@@ -95,6 +95,9
95 LLFrameTimer gTeleportDisplayTimer;
95 LLFrameTimer gTeleportDisplayTimer;
96 LLFrameTimer gTeleportArrivalTimer;
96 LLFrameTimer gTeleportArrivalTimer;
97 const F32 RESTORE_GL_TIME = 5.f; // Wait this long while reloading textures before we raise the curtain
97 const F32 RESTORE_GL_TIME = 5.f; // Wait this long while reloading textures before we raise the curtain
98 // <FS:Ansariel> Draw Distance stepping
99 F32 gSavedDrawDistance = 0.0f;
100 F32 gLastDrawDistanceStep = 0.0f;
98
101
99 BOOL gForceRenderLandFence = FALSE;
102 BOOL gForceRenderLandFence = FALSE;
100 BOOL gDisplaySwapBuffers = FALSE;
103 BOOL gDisplaySwapBuffers = FALSE;
@@ -564,6 +567,43
564 }
567 }
565 }
568 }
566
569
570 // <FS::Ansariel> Draw Distance stepping
571 // Progressively increase draw distance after TP when required.
572 static LLCachedControl<F32> renderFarClip(gSavedSettings, "RenderFarClip");
573 if (gSavedDrawDistance > 0.0f && gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
574 {
575 if (gLastDrawDistanceStep != (F32)renderFarClip)
576 {
577 gSavedDrawDistance = 0.0f;
578 gLastDrawDistanceStep = 0.0f;
579 gSavedSettings.setF32("FSSavedRenderFarClip", 0.0f);
580 }
581
582 if (gTeleportArrivalTimer.getElapsedTimeF32() >=
583 (F32)gSavedSettings.getU32("FSRenderFarClipSteppingInterval"))
584 {
585 gTeleportArrivalTimer.reset();
586 F32 current = gSavedSettings.getF32("RenderFarClip");
587 if (gSavedDrawDistance > current)
588 {
589 current *= 2.0;
590 if (current > gSavedDrawDistance)
591 {
592 current = gSavedDrawDistance;
593 }
594 gSavedSettings.setF32("RenderFarClip", current);
595 gLastDrawDistanceStep = current;
596 }
597 if (current >= gSavedDrawDistance)
598 {
599 gSavedDrawDistance = 0.0f;
600 gLastDrawDistanceStep = 0.0f;
601 gSavedSettings.setF32("FSSavedRenderFarClip", 0.0f);
602 }
603 }
604 }
605 // </FS::Ansariel>
606
567 //////////////////////////
607 //////////////////////////
568 //
608 //
569 // Prepare for the next frame
609 // Prepare for the next frame
@@ -42,4 +42,8
42 extern BOOL gResizeScreenTexture;
42 extern BOOL gResizeScreenTexture;
43 extern BOOL gWindowResized;
43 extern BOOL gWindowResized;
44
44
45 // <FS:Ansariel> Draw Distance stepping
46 extern F32 gSavedDrawDistance;
47 extern F32 gLastDrawDistanceStep;
48
45 #endif // LL_LLVIEWERDISPLAY_H
49 #endif // LL_LLVIEWERDISPLAY_H
@@ -24,6 +24,8
24 <check_box label="Partikeleffekte erzeugen, wenn Skripte kommunizieren" name="EffectScriptChatParticles" tool_tip="Falls aktiviert, werden Partikeleffekte um kommunizierende Objekte erzeugt."/>
24 <check_box label="Partikeleffekte erzeugen, wenn Skripte kommunizieren" name="EffectScriptChatParticles" tool_tip="Falls aktiviert, werden Partikeleffekte um kommunizierende Objekte erzeugt."/>
25 <check_box name="UseLSLBridge" label="LSL-Client-Brücke aktivieren" tool_tip="Erlaub dem Viewer die Nutzung eines geskripteten Objektes (Brücke), um weitergehende Funktionen anzubieten."/>
25 <check_box name="UseLSLBridge" label="LSL-Client-Brücke aktivieren" tool_tip="Erlaub dem Viewer die Nutzung eines geskripteten Objektes (Brücke), um weitergehende Funktionen anzubieten."/>
26 <check_box name="UseLSLFlightAssist" label="Flug-Assistent der Brücke aktivieren" tool_tip="Aktiviert ein Skript, dass Fliegen und Schweben in größeren Höhen ermöglicht."/>
26 <check_box name="UseLSLFlightAssist" label="Flug-Assistent der Brücke aktivieren" tool_tip="Aktiviert ein Skript, dass Fliegen und Schweben in größeren Höhen ermöglicht."/>
27 <check_box label="Aktiviere progressives Draw-Distance-Stepping" name="FSRenderFarClipStepping" tool_tip="Falls aktiviert wird Firestorm nach einem Teleport die Draw Distance progressiv erhöhen." width="270"/>
28 <slider name="progressive_draw_distance_interval" tool_tip="Intervall in Sekunden zwischen den jeweiligen Erhöhungen der Draw Distance."/>
27 </panel>
29 </panel>
28
30
29
31
@@ -5417,4 +5417,11
5417 <string name="LoadCameraPositionOutsideDrawDistance">
5417 <string name="LoadCameraPositionOutsideDrawDistance">
5418 Kamerasicht kann nicht wiederhergestellt werden, da sich die Kameraposition außerhalb der Draw Distance befindet.
5418 Kamerasicht kann nicht wiederhergestellt werden, da sich die Kameraposition außerhalb der Draw Distance befindet.
5419 </string>
5419 </string>
5420
5421 <string name="DrawDistanceSteppingGestureObsolete">
5422 Aufgrund von Änderungen im Code ist es nicht mehr notwendig, diese Geste zu benutzen. Progressives Draw-Distance-Stepping wurde aktiviert.
5423 </string>
5424 <string name="FSCmdLineDrawDistanceSet">
5425 Draw Distance wurde auf [DISTANCE]m gesetzt.
5426 </string>
5420 </strings>
5427 </strings>
@@ -203,6 +203,33
203 top_pad="5"
203 top_pad="5"
204 width="350" />
204 width="350" />
205
205
206 <check_box
207 control_name="FSRenderFarClipStepping"
208 height="16"
209 label="Enable progressive draw distance stepping"
210 layout="topleft"
211 left="15"
212 name="FSRenderFarClipStepping"
213 tool_tip="If enabled, Firestorm will use a progressive draw distance stepping after teleporting."
214 initial_value="true"
215 top_pad="5"
216 width="250" />
217 <slider
218 name="progressive_draw_distance_interval"
219 control_name="FSRenderFarClipSteppingInterval"
220 enabled_control="FSRenderFarClipStepping"
221 decimal_digits="0"
222 left_pad="5"
223 top_delta="0"
224 follows="left|top"
225 height="18"
226 increment="1"
227 initial_val="20"
228 max_val="30"
229 min_val="5"
230 width="150"
231 tool_tip="Interval in seconds between each draw distance increment"/>
232
206 <check_box
233 <check_box
207 top_pad="15"
234 top_pad="15"
208 control_name="UseLSLBridge"
235 control_name="UseLSLBridge"
@@ -4143,4 +4143,7
4143
4143
4144 <string name="LoadCameraPositionNoneSaved">No camera view has been saved yet.</string>
4144 <string name="LoadCameraPositionNoneSaved">No camera view has been saved yet.</string>
4145 <string name="LoadCameraPositionOutsideDrawDistance">Can't restore camera view because the camera position is beyond draw distance.</string>
4145 <string name="LoadCameraPositionOutsideDrawDistance">Can't restore camera view because the camera position is beyond draw distance.</string>
4146
4147 <string name="DrawDistanceSteppingGestureObsolete">Due to the changes in code, it is no longer necessary to use this gesture. Progressive Draw Distance stepping has been enabled.</string>
4148 <string name="FSCmdLineDrawDistanceSet">Draw Distance set to [DISTANCE]m.</string>
4146 </strings>
4149 </strings>
You need to be logged in to leave comments. Login now