Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

[BUG-4455] Scripts using llSetTextureAnim and floating text changing on a timer causes objects texture to flash. Additionally if texture uses non default repeats, texture repeats randomly reset. #13197

Open
2 tasks
sl-service-account opened this issue Nov 14, 2013 · 4 comments

Comments

@sl-service-account
Copy link

sl-service-account commented Nov 14, 2013

Repro 1 - Default Texture Repeats

  1. Rez a sphere prim sized 1x1x1m

  2. Add a diffuse texture - "Fabric - Zebra skin" from Library works well for this.

  3. Add the following script to the sphere:

    default
    {
        state_entry()
        {
            llSay(0, "Hello, Avatar!");
        }
    
        touch_start(integer total_number)
        {
           llSetTextureAnim(ANIM_ON | LOOP , ALL_SIDES, 2, 2, 0.0, 4.0, 0.5);
        }
    }
  4. Touch sphere to start texture animation - observe behaviour is as expected.

  5. Add this 2nd script to sphere:

    string sim;
    string region;
    
     
    default
    {
        state_entry()
        {
            llSetTimerEvent(2.0);
        }
        timer()
        {
            string here = llGetRegionName();
            if(region != here)
            {
                sim = llGetSimulatorHostname();
                region = here;
            }
            llSetText(
                    "   REGION NAME : " + region + 
                  "\n  SIM HOSTNAME : " + sim + 
                  "\n TIME DILATION : " + (string)llGetRegionTimeDilation() +
                  "\n    REGION FPS : " + (string)llGetRegionFPS(),
                <0,1,0>, 1.0);
        }
    }
  6. Observe the prim

    Observed Behaviour

    The texture on the sphere will continue to animate but will periodically "flash"

    Expected Behaviour

    The texture should smoothly animate.

    Repro 2 - Non-Default Texture Repeats

  7. Edit sphere -> Texture tab.

  8. Set texture repeats to:
    Horizontal scale: 2.7
    Verical scale 5.8

  9. Observe sphere

    Observed Behaviour

    The texture on the sphere will still periodically "flash" but also the texture repeats randomly alternate between default and the values you set above.

    Other Information.

  • I am not sure if this is essentially the same bug as reported in BUG-3061 or BUG-4276
  • The "flashing" may be simular to BUG-85? (This was actually fixed though)

Links

Related

Original Jira Fields
Field Value
Issue BUG-4455
Summary Scripts using llSetTextureAnim and floating text changing on a timer causes objects texture to flash. Additionally if texture uses non default repeats, texture repeats randomly reset.
Type Bug
Priority Unset
Status Accepted
Resolution Accepted
Reporter Whirly Fizzle (whirly.fizzle)
Created at 2013-11-14T18:07:41Z
Updated at 2018-11-10T21:04:21Z
{
  'Business Unit': ['Platform'],
  'Date of First Response': '2013-11-14T13:25:56.801-0600',
  'System': 'SL Viewer',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': '.',
  'What were you doing when it happened?': 'Filling in....',
  'What were you expecting to happen instead?': '.',
}
@sl-service-account
Copy link
Author

MartinRJ Fayray commented at 2013-11-14T19:25:57Z

Reproduced with

Second Life 3.6.10 (283403) Nov 6 2013 01:05:47 (noupdateplease)
Release Notes

You are at 213.3, 236.1, 21.2 in DarkMyst Bayou located at sim9047.agni.lindenlab.com (216.82.41.223:13012)
SLURL: http://maps.secondlife.com/secondlife/DarkMyst%20Bayou/213/236/21
(global coordinates 153,045.0, 258,540.0, 21.2)
Second Life Server 13.10.25.282998
Retrieving...

CPU: AMD Phenom(tm) II X4 955 Processor (3214.45 MHz)
Memory: 16383 MB
OS Version: Microsoft Windows 8.1 64-bit (Build 9600)
Graphics Card Vendor: ATI Technologies Inc.
Graphics Card: AMD Radeon HD 7800 Series

Windows Graphics Driver Version: 8.17.0010.1247
OpenGL Version: 4.2.12614 Compatibility Profile Context 13.250.18.0

libcurl Version: libcurl/7.21.1 OpenSSL/0.9.8q zlib/1.2.5 c-ares/1.7.1
J2C Decoder Version: KDU v7.0
Audio Driver Version: FMOD Ex 4.44.12
Qt Webkit Version: 4.7.1 (version number hard-coded)
Voice Server Version: Not Connected
Built with MSVC version 1600
Packets Lost: 14/80,763 (0.0%)

@sl-service-account
Copy link
Author

Maestro Linden commented at 2013-11-19T17:48:29Z, updated at 2013-11-19T17:49:24Z

Hi Whirly, I believe this is just another case of BUG-3061, where a full object update (which would be sent when either sound volume changed or floating text changed, I believe) causes the rendered texture animation to reset to the first frame.

I modified your first script to use some handy labeled texture that's good for 2x2 animations, and the script also checks whether the texture repeats actually changed from the original:

default
{
    state_entry()
    {
        llSetTexture("04ae2596-5b7b-dc03-3425-0b34de2b4c78", ALL_SIDES);
    }
 
    touch_start(integer total_number)
    {
        vector original_repeats = llList2Vector(llGetPrimitiveParams([PRIM_TEXTURE, 0]), 2);
        llSetTextureAnim(ANIM_ON | LOOP , ALL_SIDES, 2, 2, 0.0, 4.0, 0.5);
        while(1)
        {
            vector repeats = llList2Vector(llGetPrimitiveParams([PRIM_TEXTURE, 0]), 2);
            if(repeats != original_repeats)
            {
                llSay(0, "Repeats changed on face 0! was: " + (string)original_repeats
                    + " became: " + (string)repeats);
            }
        }
    }
}

When I use this script in conjunction with the floating text one, I do see that the texture animation resets to frame 1 when the floating text is updated. The animation eventually appears to 'fail', but that seems to be just because the 1st frame's duration is 2 seconds, matching the floating text update rate. When I change the texture animation to update once a second, I see alternation between the first 2 animation frames (we never get to the first frame because the viewer resets the animation with the floating text update). The script never warns about the texture repeats changing - they remain at 1.0,1.0 always, since the 'repeats' are separate from what the viewer renders in the animation.

@sl-service-account
Copy link
Author

Maestro Linden commented at 2013-11-19T18:00:10Z

I think we can rephrase BUG-3061 more generally as 'full object updates cause texture animations to be reset to the first frame. Here's another example; I replaced the floating text script with a script that simply resizes the prim (triggering full updates). I see the same behavior with the animation being reset, in this case:

  
default
{
    state_entry()
    {
        llSetTimerEvent(2.0);
    }
    timer()
    {
        if(llGetScale() == 0.5*<1,1,1>) llSetScale(0.6*<1,1,1>);
        else llSetScale(0.5*<1,1,1>);
    }
}

@sl-service-account
Copy link
Author

Whirly Fizzle commented at 2018-11-10T18:41:34Z

Possibly related: https://community.secondlife.com/forums/topic/429676-textureanimation-on-object-funky-during-movement/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant