'Time' Materials are not started from zero. It is Flickering at start.

Hello.

I’m having trouble with creating like Burning and Transition Materials using Time Node.

Please Watch this :sob:

fire

Burning Effect is not started from zero, started with ackward flickering and then goes normally.
And this ‘Start Timing’ is always different.

This is how i set the material graph,
and just created Dynamic Material with this, then initialized the ‘Speed’ value for beginning.

like this :

void UCR_InflamableActionComponent::DestroyWithFire(const float DeltaTime)
{
    PlasterBurnDynamicMaterial = UMaterialInstanceDynamic::Create(PlasterStaticMeshComponent->GetMaterial(0), GetOwner());
    ensureMsgf(PlasterBurnDynamicMaterial, TEXT("Missing UMaterialInstanceDynamic in %s"), *GetName());

    // Destroy Action with Burn Shader
    PlasterBurnDynamicMaterial->SetScalarParameterValue(TEXT("Speed"), BurnSpeed);
    PlasterBurnDynamicMaterial->SetScalarParameterValue(TEXT("Temperature"), BurnTemperature);
    PlasterStaticMeshComponent->SetMaterial(0, PlasterBurnDynamicMaterial);
}

Maybe the time is going through whatever i set the speed value, even if it was zero…?


And the another one (this one has same problem) :

transition

The Transition Material also started with flickering either as you can see.

This is the transition material graph, set the parameter with MPC param.

And using MPC value, i just set the key animation to the widget, and start animation when i needed.



Why this happens? and how i fix this? Please help me :sob:

As for the torchlight: can you disable the initial setting of Speed parameter in your code and see if the flickering still occurs?
Just set some default value to Speed in your material instead.

Thanks for the reply :smiley:

Speed parameter’s default value is zero.

So i think when i create this material with

UMaterialInstanceDynamic::Create(PlasterStaticMeshComponent->GetMaterial(0), GetOwner());

It would set all of the paramters to the default values.

    PlasterBurnDynamicMaterial->SetScalarParameterValue(TEXT("Speed"), 0);
    PlasterStaticMeshComponent->SetMaterial(0, PlasterBurnDynamicMaterial);
    PlasterBurnDynamicMaterial->SetScalarParameterValue(TEXT("Speed"), BurnSpeed);
    PlasterBurnDynamicMaterial->SetScalarParameterValue(TEXT("Temperature"), BurnTemperature);

And this kinda code doesn’t seem to affect at all… :sob:

I think i should not use ‘Time’ Graph. Time keeps going no matter what i set the ‘Speed’.
If i set ‘Speed’ to 1 at specific timing, it doesn’t start from 0.
Just start from in the middle of ‘Time’ going.