Don't click here unless you want to be banned.

LSL Wiki : texture

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

Texture


A texture is an image that can be applied ("texture-mapped") onto an object's surface, particle, or avatar. Images saved in JPEG, TGA, PNG and BMP format may be uploaded to Second Life as textures. These formats are converted to a variant of the JPEG2000 format (using the Kakadu library) and sent to the Second Life asset server when uploaded. There is a $L10 fee for each upload.

Note: Uploading textures less than 8x8 pixels may give an error: "KDU throwing an exception" for BMPs/TGAs and "LLImageJ2C uninitialized" for JPGs.

Textures are indexed in the user's inventory and can be used in a variety of ways in the viewer and editor modes of the client and via LSL. Dragging them onto a specific object face will place a texture on that face. Shift-dragging a texture from the inventory to a prim will apply it to all faces.

Because all uploaded images are decoded and converted to JPEG2000, it is inadvisable to convert textures into the JPEG format prior to uploading. JPEG is a lossy format and using it will potentially introduce unnecessary additional loss and distortion to the final uploaded texture. Uploading images in the TGA format is recommended.

A list of texture UUIDs used in the Second Life client (such as the ground textures) can be found here.

Function Description
llGetAlpha get the alpha of a face
llGetColor get the color of a face
llGetNumberOfSides get total number of sides
llGetPrimitiveParams get all primitive parameters
llGetTexture get the texture on a given side
llGetTextureOffset get the texture offset on a side
llGetTextureRot get the texture rotation on a side
llGetTextureScale get the texture scale of a side
llOffsetTexture set the texture offset
llRotateTexture rotate a texture
llScaleTexture resize (scales) a texture
llSetAlpha set the alpha of a face or prim
llSetPrimitiveParams set all primitive parameters
llSetColor set the color of a face or prim
llSetLinkAlpha set the alpha of a linked prim
llSetLinkColor set the color of a linked prim
llSetLinkPrimitiveParams set all primitive parameters of a linked prim
llSetLinkTexture set the texture of a linked prim
llSetTexture set a texture on a face or prim
llSetTextureAnim animates a texture

Note: llGetPrimitiveParams and llSetPrimitiveParams are capable of performing every function described above with the exception of llSetLinkAlpha, llSetLinkColor, and llSetTextureAnim.

Q: How do I determine which side of an object I apply a texture to?
A: See side.

Q: Can I set the texture of another prim in my linked object?
A: Yes, use llSetLinkPrimitiveParams andllSetLinkTexture.

Q: Can I set the texture of an object that's not linked to the one containing my script?
A: No. You can link it, if it's within range, but that's it. You can't change its scale, texture, nothing unless you use messaging. I.e. llSay and listen.

Q: How do I get the dimensions/aspect ratio of a texture?
A: You can get it from the texture picker. When images are uploaded they are resized down to the closest power of two (x & y are rounded down individually; they can be different).

Q: How do I get the dimensions/aspect ratio of a face?
A: llSetPrimitiveParams and a lot of math. Prim torture may make this impossible.

Q: Can you upload a gif image that will successfully play on a prim face?
A: No. All images are converted to JPEG2000, which does not animate. There are, however, methods of animating prim faces with clever use of llSetTextureAnim.

Q: Can a streaming video from a source on the internet be applied as a texture to an object? If not, can a compressed video file be applied?
A: See video. Specifically llParcelMediaCommandList.
AA: In viewer 2, it is now possible to directly stream videos from the internet on any prim face. Just enter the url and its done. No scripts are required now.


Functions | Inventory
There is no comment on this page. [Display comments/form]