Skip to content

Specific particle types create heavy blobs of color in latest alchemy

Summary

Particles that use the following blend function parameters: PSYS_PART_BLEND_FUNC_SOURCE, PSYS_PART_BF_DEST_COLOR, PSYS_PART_BLEND_FUNC_DEST, PSYS_PART_BF_ONE ,

become ugly blobs of color when stacked up sufficiently when they did not in previous iterations of alchemy viewer.

Steps to reproduce

Make a linkset of 3 prims.

Make sure prim 2 and 3 occupy the same x,y,z coordinate.

Make prim 2 and 3 invisible and outside the bounds of prim 1.

Stuff this script in them:

vector NewColor() {
    float r = llFrand(1.0);
    float g = llFrand(1.0);
    float b = llFrand(1.0);
    float highest = r;
    if (g > highest) highest = g;
    if (b > highest) highest = b;
    float multiplier = 1.0 / highest;
    vector color = <r, g, b> * multiplier;
    return color;
}

vector PurifyColor(vector input) {
    float r = input.x;
    float g = input.y;
    float b = input.z;
    float lowest = r;
    
    if (g < lowest) lowest = g;
    
    if (b < lowest) lowest = b;
    
    if (!((r == b) && (b == g))) {
        if (lowest == r) r = 0;
        else if (lowest == b) b = 0;
        else g = 0;
    }
    
    if (r > 0.6) r = r + (1 - r) / 2;
    else r = 0;
    
    if (g > 0.6) g = g + (1 - g) / 2;
    else g = 0;
    
    if (b > 0.6) b = b + (1 - b) / 2;
    else b = 0;
    
    return <r,g,b>;
}

Particles() {
    vector color = llList2Vector(llGetLinkPrimitiveParams(3, [PRIM_COLOR, 0]), 0);
    vector pure = PurifyColor(color);
    llSetLinkPrimitiveParamsFast(2, [PRIM_POINT_LIGHT, TRUE, color, 1.0, 10.0, 0.0]);
    llLinkParticleSystem(2, [  
        PSYS_PART_FLAGS, PSYS_PART_EMISSIVE_MASK |  PSYS_PART_INTERP_COLOR_MASK |
             PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK ,
        PSYS_PART_MAX_AGE, 3,
        PSYS_PART_START_COLOR, color,
        PSYS_PART_END_COLOR, pure,
        PSYS_PART_START_SCALE,<0.2,0.2,0.05>,
        PSYS_PART_END_SCALE,<0.0001, 0.0001, 0.0001>, 
        PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE,
        PSYS_SRC_BURST_RATE, 0.03,
        PSYS_SRC_ACCEL, <0,0,0.12>,
        PSYS_SRC_BURST_PART_COUNT, 3,
        PSYS_SRC_BURST_RADIUS, 0.0,
        PSYS_SRC_BURST_SPEED_MIN, 0.05,
        PSYS_SRC_BURST_SPEED_MAX, 0.01,
        PSYS_PART_START_ALPHA, 0.8,
        PSYS_PART_END_ALPHA, 0.3,
        PSYS_PART_BLEND_FUNC_SOURCE, PSYS_PART_BF_DEST_COLOR,
        PSYS_PART_BLEND_FUNC_DEST, PSYS_PART_BF_ONE ,
        PSYS_SRC_TEXTURE, "97a662d2-ae5a-565e-ea2c-e37ee9607b04"
            ]);
    llLinkParticleSystem(3, [
                PSYS_PART_FLAGS,
                PSYS_PART_INTERP_COLOR_MASK 
                | PSYS_PART_INTERP_SCALE_MASK 
                | PSYS_PART_EMISSIVE_MASK,
                PSYS_PART_START_COLOR, color,
                PSYS_PART_END_COLOR, pure,
                PSYS_PART_START_ALPHA,0.500000,
                PSYS_PART_END_ALPHA,0.100000,
                PSYS_PART_START_SCALE,<0.2000, 0.4000, 0.00000>,
                PSYS_PART_END_SCALE,<0.10000, 0.80000, 0.00000>,
                PSYS_PART_MAX_AGE,3,
                PSYS_SRC_PATTERN,2,
                PSYS_SRC_TEXTURE,"ebc21f9d-826c-d150-2bf2-c204b5fc0751",
                PSYS_SRC_BURST_RATE,0.1,
                PSYS_SRC_BURST_PART_COUNT,1,
                PSYS_SRC_BURST_RADIUS,0.02,
                PSYS_SRC_BURST_SPEED_MIN,0.0,
                PSYS_SRC_BURST_SPEED_MAX,0.0, 
                PSYS_PART_BLEND_FUNC_SOURCE, PSYS_PART_BF_DEST_COLOR,
                PSYS_PART_BLEND_FUNC_DEST, PSYS_PART_BF_ONE ,
                PSYS_SRC_ACCEL, <0.0, 0.0, 0.5> ]);            
}

default
{
    state_entry() {
        Particles();
    }
    
    on_rez(integer n) {
        vector color = NewColor();
        llSetLinkColor(3, color, ALL_SIDES);
        llSetLinkColor(LINK_THIS, color, 0);
    }

    changed(integer change) {
        if (change & CHANGED_COLOR) {
            Particles();
        }
    }
}

What is the current bug behavior?

You get big ugly blobs of color see: http://wabbajack.ddns.net/web_images/particleBug.png

What is the expected correct behavior?

See: http://wabbajack.ddns.net/web_images/notSoBugged.png

Environment


Alchemy Project AgileAkita 6.5.3.1401 (64bit)
Release Notes

You are at 186.7, 34.1, 3,001.4 in Raiden located at simhost-0f6517a2dc564cae2.agni
SLURL: http://maps.secondlife.com/secondlife/Raiden/187/34/3001
(global coordinates 259,003.0, 255,522.0, 3,001.4)
Second Life Server 2022-01-06.567269
Retrieving...

CPU: AMD Ryzen 9 3900X 12-Core Processor             (3792.88 MHz)
Memory: 32682 MB
Concurrency: 24
OS Version: Microsoft Windows 10 64-bit (Build 19042.1526)
Graphics Card Vendor: ATI Technologies Inc.
Graphics Card: AMD Radeon RX 6800 XT

Windows Graphics Driver Version: 30.0.14011.3017
OpenGL Version: 4.6.14802 Compatibility Profile Context 21.12.1 30.0.14011.3017

Window size: 2560x1377
Font Size Adjustment: 96pt
UI Scaling: 1.5
Draw distance: 128m
Bandwidth: 3000kbit/s
LOD factor: 3.25
Render quality: 5
Advanced Lighting Model: Enabled
Texture memory: 3072MB
Texture cache: 2640MB / 8344MB (31.7% used)
Disk cache: 10239MB / 10240MB (100.0% used)

RestrainedLove API: RLV v3.4.3 / RLVa v2.4.2.1401
libcurl Version: libcurl/7.81.0 OpenSSL/3.0.1 zlib/1.2.11.zlib-ng c-ares/1.18.1 WinIDN nghttp2/1.46.0
J2C Decoder Version: OpenJPEG Runtime: 2.4.0
Audio Driver Version: FMOD Studio 2.02.05
Dullahan: 1.12.2
  CEF: 97.1.5+g2b00258+chromium-97.0.4692.71
  Chromium: 97.0.4692.71
LibVLC Version: 3.0.16
Voice Server Version: Vivox 4.10.0000.32327

Compiler Version: MSVC 193030706
Packets Lost: 103/1,382,114 (0.0%)
February 12 2022 21:07:23

Relevant logs and/or screenshots

(Attach or paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)