Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simpler method of refresh/texturing. #19

Open
Dannington opened this issue Nov 10, 2016 · 1 comment
Open

Simpler method of refresh/texturing. #19

Dannington opened this issue Nov 10, 2016 · 1 comment

Comments

@Dannington
Copy link

Hi - it seems that the node which refreshes the texture from the spout stream is doing quite a lot - is it creating a material instance every time?

I'm actually using it to just get a texture which i'm feeding into a material which i've previously made, so to do that I need to call 'Spout Receiver' followed by 'Spout Info From' to get the 'Sender Struct Texture Color' which I need to apply to my material using 'Set Texture Parameter Value' each frame.

Would it be easier to initially get the texture reference, apply it to the material, then just use some kind of 'Refresh Spout' node each tick. BLUI runs like this. The same would apply to the pre-made material - you shouldn't need to make a whole material for each frame, just update the referenced texture.

What do you think?

Thanks for the plugin!

Dan

@AleDel
Copy link
Owner

AleDel commented Nov 15, 2016

the material instance is created when check this and call the ResetTexture function:

if (!SenderStruct->MaterialInstanceColor || SenderStruct->TextureColor == nullptr ||SenderStruct->MaterialInstanceColor == nullptr){

        //TextureColor = new
        UE_LOG(SpoutLog, Warning, TEXT("No material intance, creating...//////"));
        // Prepara Textura, Set the texture update region
        Width = SenderStruct->w;
        Height = SenderStruct->h;
        SenderStruct->UpdateRegions = new FUpdateTextureRegion2D(0, 0, 0, 0, Width, Height);
        ResetTexture(SenderStruct->TextureColor, SenderStruct->MaterialInstanceColor, SenderStruct);
}

let me think about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants