돌고래 홈페이지
ID:
PW:


  운영자(2022-09-30 06:39:52, Hit : 20, Vote : 1
 ue4 Matrial Set

        AActor* pTargetActor = nullptr;
        TArray<AActor*> ActorList;
        UGameplayStatics::GetAllActorsWithTag(GetWorld(), FName(TEXT("CustomMat")), ActorList);
        
        for (int n = 0; n < ActorList.Num(); ++n)
        {
                if (ActorList[n]->GetName().Contains(TEXT("Sphere")))
                {
                        //DDD
                        UStaticMeshComponent* StaticMeshComponent = ActorList[n]->FindComponentByClass<UStaticMeshComponent>();
                        UMaterialInterface* Mat = StaticMeshComponent->GetMaterial(0);
                        if (Mat->GetName() != TEXT("redhlsl_mat"))
                                break;

                        FVector ChangeColor = FVector(0.0f, 1.0f, 0.0f);

                        UMaterialInstanceDynamic* matInstance = StaticMeshComponent->CreateDynamicMaterialInstance(0, Mat);
                        if (matInstance != nullptr)
                                matInstance->SetVectorParameterValue(FName(TEXT("RGBColor")), ChangeColor);

                        UE_LOG(LogTemp, Log, TEXT("Have Tag"));
                        break;
                }
        }

        //http://h2ostudio.egloos.com/m/5393559
        //https://ppatabox.tistory.com/123




UE4 Slate 튜토리얼 - 커스텀 컨트롤
ue4 Shader

Copyright 1999-2022 Zeroboard / skin by zero