0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SL に PBR Material がきた 座ったオブジェクトを消そう

Last updated at Posted at 2024-06-22

以下表題ご参考まで
旧来の Blinn-Phong Shading マテリアル と PBR マテリアルを一緒に透過設定するという感じ

string org_pbr_uuid ="";
string alpha_pbr_uuid ="7472bcba-5923-cf0b-4b9f-c6d8d397ceef";

default {
    state_entry(){
        org_pbr_uuid = llGetRenderMaterial(0);
        llSitTarget(<0.0, 0.0, 0.5>, ZERO_ROTATION);
    }
    changed(integer change){
        if (change & CHANGED_LINK) {
            key av = llAvatarOnSitTarget();
            if (av != NULL_KEY) {
                llSetAlpha(0,ALL_SIDES);
                llSetRenderMaterial(alpha_pbr_uuid, ALL_SIDES);
            } else {
                llSetAlpha(1,ALL_SIDES);
                llSetRenderMaterial(org_pbr_uuid, ALL_SIDES);
            }
        }
    }
}

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?