Difference between revisions of "Texture Usage"

From Second Life Wiki
Jump to navigation Jump to search
(OK, they added have a constant for that one.)
Line 4: Line 4:
Keep in mind that your average Second Life user has between 128MB to 256MB of memory on their video card.  You can see that it won't take much to fill that up if you toss a bunch of large textures onto your builds.  Bottom line is, you want to use the smallest texture possible.
Keep in mind that your average Second Life user has between 128MB to 256MB of memory on their video card.  You can see that it won't take much to fill that up if you toss a bunch of large textures onto your builds.  Bottom line is, you want to use the smallest texture possible.


Transparency:  Believe it or not, a clear texture causes a hit on the viewer also.  There are two things you can do to keep this to a minimum.  Create your own transparent texture to use - the free transparent textures available in Second Life are generally 256 x 256 pixels but you can upload one that is 8 x 8 to use instead.  Simply create a new texture of 8 x 8 pixels in your graphics application, and save it with nothing else added (as a 32-bit .tga or a .png).  You now have a transparent texture that should only use 256 Bytes of memory as opposed to the 256 x 256 transparent texture available free in world that will use 256KB of memory.
== Transparency ==


The other option is to script in transparency, rather than using a texture. Create a new empty script in your inventory, and add this to it:
Believe it or not, a clear texture also causes a hit on the Viewer. There are a few things you can do to keep this to a minimum, in order of most efficient to least:
 
=== Use the built-in "Transparency %" setting ===
 
# Right-click an object and select '''Edit'''.
# Optionally, click '''Select Face''' if you don't want to select the whole object, then click a face to select it.
# In the build tools palette, click '''Texture''' tab.
# Set '''Transparency %" to <code>100</code>.
 
This doesn't work in older viewers. You can also script this:
 
Create a new empty script in your inventory, and add this to it:
<lsl>
<lsl>
default
default
Line 19: Line 30:


Save it, then add it to the prim you want transparent.  You can then remove the script, and your prim will remain invisible.  Be warned however, that this still adds a memory hit to your build.
Save it, then add it to the prim you want transparent.  You can then remove the script, and your prim will remain invisible.  Be warned however, that this still adds a memory hit to your build.
=== Use the Library transparent texture ===
# Select '''Me''' menu > '''Inventory'''.
# Search your inventory for "default transparent". The texture you're looking for is '''*Default Transparent Texture'''.
=== Create your own transparent texture to use ===
The free transparent textures available in Second Life are generally 256 x 256 pixels but you can upload one that is 8 x 8 to use instead.  Simply create a new texture of 8 x 8 pixels in your graphics application, and save it with nothing else added (as a 32-bit .tga or a .png).  You now have a transparent texture that should only use 256 Bytes of memory as opposed to the 256 x 256 transparent texture available free in world that will use 256KB of memory.


If you're interested in seeing just exactly what's going on behind the scenes when you teleport into an area, hit ctl+shift+3 which will open up the texture console and you can watch the textures around you being loaded into your viewer.  Hit ctl+shift+3 again to close it.
If you're interested in seeing just exactly what's going on behind the scenes when you teleport into an area, hit ctl+shift+3 which will open up the texture console and you can watch the textures around you being loaded into your viewer.  Hit ctl+shift+3 again to close it.

Revision as of 08:11, 13 June 2012

We've all experienced it, dragging lag in texture heavy virtual environments. It's no fun, and any good developer wants to carefully balance a great looking build with a quick load time.

Keep in mind that your average Second Life user has between 128MB to 256MB of memory on their video card. You can see that it won't take much to fill that up if you toss a bunch of large textures onto your builds. Bottom line is, you want to use the smallest texture possible.

Transparency

Believe it or not, a clear texture also causes a hit on the Viewer. There are a few things you can do to keep this to a minimum, in order of most efficient to least:

Use the built-in "Transparency %" setting

  1. Right-click an object and select Edit.
  2. Optionally, click Select Face if you don't want to select the whole object, then click a face to select it.
  3. In the build tools palette, click Texture tab.
  4. Set Transparency %" to 100.

This doesn't work in older viewers. You can also script this:

Create a new empty script in your inventory, and add this to it: <lsl> default { state_entry() { llSetTexture(TEXTURE_TRANSPARENT, ALL_SIDES); }

} </lsl>

Save it, then add it to the prim you want transparent. You can then remove the script, and your prim will remain invisible. Be warned however, that this still adds a memory hit to your build.

Use the Library transparent texture

  1. Select Me menu > Inventory.
  2. Search your inventory for "default transparent". The texture you're looking for is *Default Transparent Texture.

Create your own transparent texture to use

The free transparent textures available in Second Life are generally 256 x 256 pixels but you can upload one that is 8 x 8 to use instead. Simply create a new texture of 8 x 8 pixels in your graphics application, and save it with nothing else added (as a 32-bit .tga or a .png). You now have a transparent texture that should only use 256 Bytes of memory as opposed to the 256 x 256 transparent texture available free in world that will use 256KB of memory.


If you're interested in seeing just exactly what's going on behind the scenes when you teleport into an area, hit ctl+shift+3 which will open up the texture console and you can watch the textures around you being loaded into your viewer. Hit ctl+shift+3 again to close it.