Scripting Second Life Materials Testing

We have a new aspect of Materials arriving, the ability to script materials as we script textures (diffuse map).

Simon Linden has posted in the Server Beta UG agenda about the coming Materials Scripting feature to allow script control of the new Materials. Quoting:

  • LSL support for materials is in testing
    • Certain Aditi regions (DRTSIM-253 channel, presently) have LSL support for materials
      • Regions “roller-test102” and “roller-test103” are on this channel
      • This is still a work-in-progress – testing is still underway
    • Materials can be added to object faces with llSetPrimitiveParams() functions
      • [PRIM_SPECULAR, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment]
      • [PRIM_NORMAL, integer face, string texture, vector repeats, vector offsets, float rotation_in_radians]
      • [PRIM_ALPHA_MODE, integer face, integer alpha_mode, integer alpha_cutoff]
        • Valid alpha_mode options are PRIM_ALPHA_MODE_NONE, PRIM_ALPHA_MODE_BLEND, PRIM_ALPHA_MODE_MASK, PRIM_ALPHA_MODE_EMISSIVE
    • Materials can be read with the various llGetPrimitiveParams() functions
      • [PRIM_SPECULAR, integer face] returns [string texture, vector repeats, vector offsets, float rotation_in_radians, vector color, integer glossy, integer environment]
      • [PRIM_NORMAL, integer face] returns [string texture, vector repeats, vector offsets, float rotation_in_radians]
      • [PRIM_ALPHA_MODE, integer face] returns [integer alpha_mode, integer alpha_cutoff]
  • Behavior for both getting and setting materials parameters should basically correspond to behavior with PRIM_TEXTURE
  • The color vectors use 0.0-1.0 as the range, as with llSetColor()
  • The integer parameters for PRIM_SPECULAR correspond to the same values that you see in the build tool
  • Components of a material can be ‘reset’ as follows:
    • PRIM_NORMAL and PRIM_SPECULAR settings are set to ‘default’ values by setting the texture to NULL_KEY
    • PRIM_ALPHA_MODE settings are set to ‘default’ values by setting the alpha_mode to PRIM_ALPHA_MODE_BLEND
      • mask_cutoff is actually reset to 0 unless the alpha mode is PRIM_ALPHA_MODE_MASK
    • When PRIM_NORMAL, PRIM_SPECULAR, and PRIM_ALPHA_MODE settings are all set to ‘default’ values, the material is deleted from that prim face, and LI may be updated accordingly
  • Known issues
    • There is a viewer rendering issue, where the face will not be rendered and you’ll see log spam (BUG-6187),
      • If the viewer has ALM enabled
      • and a prim face has a material on it
      • and PRIM_ALPHA_MODE is PRIM_ALPHA_MODE_BLEND (this is the default after a material is added)
      • and the diffuse texture does not have an alpha channel (e.g. plywood)
    • The version currently on Aditi lacks proper throttling, so there could be performance issues if scripts behave badly

You can test this new code in ADITI regions; “roller-test102” and “roller-test103”. These are mainland regions (meaning they are running the code currently on the main grid) in the ADITI grid.

Read more

Scale for VR?

In Second Life™ we talk about scale. Some of us are big on getting people and things to RL scales in our virtual world (VW). I’m a fan and I’ve written several articles about building to scale. Now people interested in Virtual Reality (VR) are thinking about scale at entirely new levels. The site Road to VR has an article up about how the fashion industry may use VR to allow people to model RL clothes in VR prior to purchase.

Second Life Fashion
Second Life Fashion

Imagine you could specify your avatar based on your RL shape… that could be a good or bad thing. :/ But, the fashion industry is thinking of using the idea to allow us to try on clothes in VR and decide if we like the fit. I suppose if it fits then we can order it and an Amazon drone will deliver it. Well, it is a dream at the moment. But, an Australian company has a proof of concept demo out for the Oculus Rift.

The idea is also to get away from sizes. Ladies know that sizes from various designers vary, often varying as a way to attempt to flatter the female ego. ‘Oh, I can wear a size 2…’ Personally the miss sizing for psychological advertizing just annoys me. 

Read more

Second Life News 2014-22

Yesterday afternoon at 3:25 PM PDT Linden Lab posted to the Grid Status page that a previously planned service outage would be scheduled for this Wednesday. From 6:00 AM to 7:00 AM, so as you read this, the work is complete and an all clear was posted at 6:51AM. During that time various backend services … Read more

Second Life Bits and News 2014-22

The Memorial Day holiday is over in the United States. I’m back and staff is back to work at the Lab.

Content UG 2014-21
Content UG 2014-21

Servers

This week there are no server rollouts.

I’ve seen a couple of comments about unusually intense griefing. But, I haven’t seen it happening in my travels, but SL is a big place. I know there are some places that get lots of attention from griefers. Other regions like mine seem to seldom see a griefer.

I do get noobies coming from a landing hub that get trapped in my house and can’t figure out how to get out. It is sort of like having flies in the house… they fly around bumping into the walls.

Read more

Second Life Materials Scripting 2014-21

What we can do to automate materials is limited by the lack of script functions to change materials. The legacy materials have scripting functions. Those however only change the older material properties. There is no script control for normal and specular maps.

Simon Linden is working on LSL functions for materials normal and specular maps. Maestro Linden has been testing them. This week (21) Simon did not see them ready for any testing in ADITI. But, that they have been working on them and playing with them is great news. 

Read more