x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UMaterialInstanceDynamic::SetTextureParameterValue generate crash in the render thread

Hello, I was trying to make some cool shader stuff and then I ran into a huge problem: in my Character::tick if I call PostProcessColoration->SetTextureParameterValue("ColorationData0", mapPlane->getRenderTarget()); I get a beautiful crash with this callstack:

 MachineId:D635B1AA6F430AEE0C5A119EBC4D8939
 EpicAccountId:35202c19cda0483591b9a24b911d0241
 
  SEGV_MAPERR at 0x3
 
 FGenericPlatformMisc::RaiseException(unsigned int) Address = 0x10b92e85b (filename not found) [in UE4Editor-Core.dylib]
 FOutputDeviceMacError::Serialize(wchar_t const*, ELogVerbosity::Type, FName const&) Address = 0x10baeb7c2 (filename not found) [in UE4Editor-Core.dylib]
 FOutputDevice::Logf(wchar_t const*, ...) Address = 0x10bb67207 (filename not found) [in UE4Editor-Core.dylib]
 FDebug::AssertFailed(char const*, char const*, int, wchar_t const*, ...) Address = 0x10bb6295b (filename not found) [in UE4Editor-Core.dylib]
 FUniformExpressionSet::CreateUniformBuffer(FMaterialRenderContext const&, FRHICommandList*, FLocalUniformBuffer*) const Address = 0x10e1c6a4a (filename not found) [in UE4Editor-Engine.dylib]
 FMaterialRenderProxy::EvaluateUniformExpressions(FUniformExpressionCache&, FMaterialRenderContext const&, FRHICommandList*) const Address = 0x10e1c50f4 (filename not found) [in UE4Editor-Engine.dylib]
 FMaterialRenderProxy::CacheUniformExpressions() Address = 0x10e1c790a (filename not found) [in UE4Editor-Engine.dylib]
 TGraphTask<FMaterialRenderProxy::CacheUniformExpressions_GameThread()::EURCMacro_FCacheUniformExpressionsCommand>::ExecuteTask(TArray<FBaseGraphTask*, FDefaultAllocator>&, ENamedThreads::Type) Address = 0x10e254ad0 (filename not found) [in UE4Editor-Engine.dylib]
 FNamedTaskThread::ProcessTasksNamedThread(int, bool) Address = 0x10b964f91 (filename not found) [in UE4Editor-Core.dylib]
 FNamedTaskThread::ProcessTasksUntilQuit(int) Address = 0x10b960a35 (filename not found) [in UE4Editor-Core.dylib]
 FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Address = 0x10b95d2d1 (filename not found) [in UE4Editor-Core.dylib]
 RenderingThreadMain(FEvent*) Address = 0x112723364 (filename not found) [in UE4Editor-RenderCore.dylib]
 FRenderingThread::Run() Address = 0x112735787 (filename not found) [in UE4Editor-RenderCore.dylib]
 FRunnableThreadPThread::Run() Address = 0x10b9ae948 (filename not found) [in UE4Editor-Core.dylib]
 FRunnableThreadPThread::_ThreadProc(void*) Address = 0x10b978661 (filename not found) [in UE4Editor-Core.dylib]
 _pthread_body Address = 0x7fff8e9b1aab (filename not found) [in libsystem_pthread.dylib]
 _pthread_body Address = 0x7fff8e9b19f7 (filename not found) [in libsystem_pthread.dylib]
 thread_start Address = 0x7fff8e9b11fd (filename not found) [in libsystem_pthread.dylib]

As you can see my code does not appear in this log it's only from the engine. my "PostProcessColoration" object is okay I can call: "PostProcessColoration->SetVectorParameterValue" without any problem. It's specific to the "SetTextureParameterValue" call. My mapPlane is not NULL. I get it using "UGameplayStatics::GetAllActorsOfClass" and it looks like this:

     AColourPlaneActor::AColourPlaneActor() {
         renderTarget = CreateDefaultSubobject<UTextureRenderTarget2D>(TEXT("RT"));
         renderTarget->InitAutoFormat(1024, 1024);
         renderTarget->OverrideFormat = EPixelFormat::PF_FloatRGB;
         renderTarget->ClearColor = FLinearColor( 1.f, 0.f, 0.f, 0.f );
         renderTarget->bNeedsTwoCopies = false;
         renderTarget->AddressX = TA_Wrap;
         renderTarget->AddressY = TA_Wrap;
         renderTarget->ClearColor = FLinearColor::Black;
         renderTarget->UpdateResourceImmediate(true);
     }
     
     UTextureRenderTarget2D* AColourPlaneActor::getRenderTarget() {
         return renderTarget;
     }
 
 
 UCLASS()
 class HANA_API AColourPlaneActor : public AStaticMeshActor
 {
     GENERATED_BODY()
 public:
     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=debug) UTextureRenderTarget2D* renderTarget;
     AColourPlaneActor();
     UTextureRenderTarget2D* getRenderTarget();
 };

I can see my renderTarget in the Editor without any problem. I’m confused: my material is ok, my texture is ok and the crash does not appear in my code. Is this a bug from the engine or from me ? I'm on OSX using a MBP 2015 with an AMD R9370X. thank you for your help. PS: updating in 4.14 does not help...

Product Version: UE 4.14
Tags:
more ▼

asked Nov 14 '16 at 04:11 PM in C++ Programming

avatar image

NeWincpp
16 2 9 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question