Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scale Texture & SetTextureAnimation...

Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
03-22-2005 09:59
I've been experimenting with llSetTextureAnimation on a lag-reducing mission. Ultimately, I want to replace any instance of llSetColor I have with llSetTextureAnimation.

My question: Is it possible to scale a texture (repeats per face) while using llSetTextureAnimation?

I seem to be getting myself into a catch-22...

I have a 10x10m square that is a flashing puzzle-piece dancefloor using llSetColor. The texture on the prim is repeated 4x4. I can use llSetTextureAnim with a texture split into colored frames to achieve the same effect... but its scaled all wrong.

If I scale the texture in photoshop ahead of time - so that I don't have to scale it in SL - I end up with a *gigantic* texture with a huge load time.... creating a new lag problem.

Anyone have any suggestions, considering my goal to reduce lag? Also - given the huge texture size - am I really better off using llSetTextureAnim over llSetColor from a lag persepctive?

Thanks!
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
03-22-2005 12:17
I've worked *a-lot* with llSetTextureAnim. Let me make sure I understand your situation before trying to help. You have a single prim, 10m x 10m in size, that has a grid pattern on it that is 4x4 squares(?) each with a differerent color and you want to have those 4 colored squares change color?
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
03-22-2005 12:46
llSetTextureAnim() seems to override any texture scale settings, unfortunately. The only exception that I'm aware of is if you're using SMOOTH type animations, and set the x and y frames both to 0. Unless this has changed recently?
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-22-2005 12:50
Travis, would you mind posting a picture of how it looks and how its supposed to look?
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
03-22-2005 13:55
Glad to, guys - thanks for the help :) I'm at work at the moment - but when I get in game later I'll upload some pics.

In brief tho - Yes, I have a grid. This grid is 5 squares by 5 squares. I use repeat on it - so that in world, it appears as 20 squares by 20 squares.

If I try to animate this - the best I can do is the original 5 square by 5 square texture.

I can go into photoshop - and just make a 20 square by 20 square texture myself - but the filesize will be 4x as large.... unless I significantly drop the original resolution - which makes it look like crap.

I'll post some pics later...

Travis
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
03-22-2005 14:06
My advice: Overlay a prim with this in it over your textured prim. Alpha the color-changing prim.

Lag redux at the expense of an added prim. Useful? :o
_____________________
---
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
03-22-2005 15:27
From: Jeffrey Gomez
My advice: Overlay a prim with this in it over your textured prim. Alpha the color-changing prim.

Lag redux at the expense of an added prim. Useful? :o


Possibly.... Thanks, Jeff :) My only concern here, is that from what I've heard, alpha textures introduce a whole set of new lag concerns on the client side. The question is - if I can't solve the problem completely.... Is the framerate hit in using an alpha texture not as bad as the server hit using llSetColor.

Actually, my original intention was to make each "frame" a different color - giving the flashing effect. But as you know - doing it that way gets me back to the scale problem.

What I've been attempting to do:

-Get rid of all llSetColor function calls
-Get rid of as many Alpha textures as possible
-Get rid of as much hovertext as possible (Client updates?)
-Reduce the number of textures I'm using
-Reduce the resolution of the textures I'm using

Travis
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
03-22-2005 15:50
Ok - as promised - here's a couple snapshots of what I'm trying to do. The first picture is with scale, the 2nd picture is without scale.





Gah - I can't seem to upload attachments :( Never had a reason to do it until now :(
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
03-22-2005 15:58
I think all of your concerns are valid. However, I don't think using textures set as alpha one time cause lag - on the other hand, setting the alpha multiple times, via llSetAlpha, will cause several sim updates and lag.

Another pro tip is to use the texture manager in the Debug menu. That will usually give you the stack memory your texture is using, allowing you to better regulate your texture resolution.

And, thank you. I'm glad to see someone do something like this. :)
_____________________
---
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
03-22-2005 17:49
I ended up just dealing with the lack of scale. Its actually doesn't look as bad as I thought it would - so probably just going to leave it that way until I come up with a better texture.

Thanks for the help eveyone - Jeff... didn't know about the debug menu option - that's gonna come in handy :)

For the purposes of the thread - if anyone has any ideas on how to overcome scale issues in general when using llSetTextureAnim, please post 'em here for the benefit of everyone else :)

Travis