secondlife / secondlife/viewer

Prim floating text fades prematurely over distance from camera

Open
#3,598 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug team:viewer UX design
Dominant language
C++
Stars
299
Forks
146
Avg merge
1d 9h
Merged PRs (30d)
88

Description

Environment

Second Life Release 7.1.11.12363455226 (64bit)
Release Notes

You are at 206.4, 111.2, 22.2 in By Design located at simhost-06c9a56af17a2102e.agni
SLURL: http://maps.secondlife.com/secondlife/By%20Design/206/111/22
(global coordinates 261582.0, 246895.0, 22.2)
Second Life Preflight 2025-01-17.12835327626
Release Notes

CPU: Apple M1 Pro (2400 MHz)
Memory: 16384 MB
OS Version: macOS 15.3.0 Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:16 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6000 x86_64
Graphics Card Vendor: Apple
Graphics Card: Apple M1 Pro

OpenGL Version: 4.1 Metal - 89.3

Window size: 1174x752
Font Size Adjustment: 96pt
UI Scaling: 1
Draw distance: 96m
Bandwidth: 10000kbit/s
LOD factor: 1.125
Render quality: 1
Texture memory: 10922MB
Disk cache: Max size 1638.4 MB (65.6% used)
HiDPI display mode:

J2C Decoder Version: KDU v7.10.4
Audio Driver Version: OpenAL, version 1.1 ALSOFT 1.23.1 / OpenAL Community / OpenAL Soft: OpenAL Soft
Dullahan: 1.14.0.202408091638
CEF: 118.4.1+g3dd6078+chromium-118.0.5993.54
Chromium: 118.0.5993.54
LibVLC Version: 3.0.21
Voice Server Version: Secondlife WebRTC Gateway

Packets Lost: 61/11438 (0.5%)
February 20 2025 16:22:27

Description

Floating text on prims fades at a much shorter distance than the PrimTextMaxDrawDistance parameter would suggest. It appears that some 2nd, undocumented parameter is causing text to fade at 16m distance, even when PrimTextMaxDrawDistance is set to a large value.

In some cases (like for server testing), it would be valuable to allow higher-than-default values of PrimTextMaxDrawDistance to allow the user to see floating text at great distances, but this is currently not possible.

Reproduction steps

Repro:

  1. Login, and set the PrimTextMaxDrawDistance debug setting to its default value of 64m
  2. Rez a box and put the 'floating text test' script in it (shown below)
  3. Sit on the box and note the opacity of the 'camera distance' floating text above the object as you move your camera nearer or further from the object
  4. Set PrimTextMaxDrawDistance = 10 and repeat step (3)
  5. Set PrimTextMaxDrawDistance = 300 (any higher is clamped by the viewer) and repeat step (3)

Expected results:

  • With PrimTextMaxDrawDistance = 64, I expect floating text to become invisible when the object is >64m from the viewer camera position. At least that's what https://github.com/secondlife/jira-archive/issues/11995 seems to suggest.
  • Similarly, text should fade out around 10m when PrimTextMaxDrawDistance=10, or 300m when PrimTextMaxDrawDistance=300

Actual results:

  • With PrimTextMaxDrawDistance = 64, prim floating text starts to fade at around 12m distance, and is fully transparent at 16m
  • Setting PrimTextMaxDrawDistance to a smaller value like 10 causes floating text to toggle be either fully opaque or fully invisible at 11-12m distance (it's not 100% consistent)
  • Setting PrimTextMaxDrawDistance to its maximum value of 300 causes no change in behavior compared to the default of 64 - text is still invisible beyond 64m
floating text test
// When an avatar is seated on the object, set floating text to indicate camera distance from object

default
{
    state_entry()
    {
        llSitTarget(<0,0,1>, ZERO_ROTATION);
        llSetScale(<2,2,2>); // so it's visible from afar
        llSetTimerEvent(0.5);
    }
    
    changed(integer change)
    {
        if(change & CHANGED_LINK && llAvatarOnSitTarget() != NULL_KEY)
        {
            llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRACK_CAMERA);
        }
    }
    
    timer()
    {
        key a = llAvatarOnSitTarget();
        if(a != NULL_KEY) llSetText((string)a + " camera distance: "
            + (string)llVecDist(llGetCameraPos(), llGetPos()), <1,1,1>, 1);
        else llSetText("Nobody seated.", <1,1,1>, 1);
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the PrimTextMaxDrawDistance setting and the supplied floating-text test script, comparing values of 10, 64, and 300. Trace the viewer's prim floating-text rendering and distance-fade behavior. Done means text fades at the configured distance, including values above the default, without the reported 16m limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.