Jump to content

PRIM_ALPHA_MODE_MASK madness :(


Aminlove Faulkes
 Share

You are about to reply to a thread that has been inactive for 2578 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 Hello LSL masters,

So I'm trying to create a mesh animated object. 

The most common way to make this is to use llSetLinkAlpha and to switch from 0/100 visibility etc. The problem is that llSetLinkAlpha is using 'alpha blending' even if it's set to 100% invisible. This makes viewer to still try to sort the alphas and kills the framerate.  So my plan was to use PRIM_ALPHA_MODE_MASK which must switch to 'alpha testing' mode and it should ease the rendering.

my code:

llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE, face-1, TEXTURE_TRANSPARENT, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0,
PRIM_ALPHA_MODE, face-1, PRIM_ALPHA_MODE_MASK, 255,
PRIM_TEXTURE, face , "some non alpha texture uuid", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0,
PRIM_ALPHA_MODE, face, PRIM_ALPHA_MODE_NONE, 0]);

As you can see I'm animating texture faces instead of objects.

If I use llSetLinkAlpha everything works and It's very reliable.

But if use the code above a random face decide not to change parameters or PRIM_ALPHA_MODE is not changed at all.

It's very weird and I'm just not sure if it's a bug or I'm doing something wrong? Is there a clever workaround this ?

Thank you very much for spending time reading this.

Regards

 

 

Link to comment
Share on other sites

I've never had a reason to try this, but your solution looks like it ought to work.  I assume that you have tried breaking your SLPPF statement into two separate function calls, one for each face. That shouldn't make any difference, in theory, but sometimes practice doesn't know about theory.

Link to comment
Share on other sites

I get the feeling that most people with a common spec laptop would not see it any way. SL official veiwer practicaly burns up laptop graphics chips which is why a lot use firestorm and they struggle even then. Not sure what you call super fast but there is a threshold limit that you probably far exceeded any way.

Link to comment
Share on other sites

Hello Steph,

Thank you for responding. The speed of the timer was just for testing purposes.

I believe it's a bug in the official viewer.

Repo:

1. make a box with the official viewer

2. set all sides to the default transparent  texture (blending mode is set to alpha blending automatically)

3. make a new script with following code:

default
{
state_entry()
{
llSetPrimitiveParams([PRIM_ALPHA_MODE, ALL_SIDES, PRIM_ALPHA_MODE_MASK,255]);
}
}

Result: alpha mode is not changed at all with the official viewer but with firestorm it's set to mask mode with cutout 255

I'm planning to submit jira, but my low render cost idea just fell down. I tried lots of stuff to workaround it, but no luck :(

Regards

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2578 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...