Multiple active cameras for 1 player

Hi @NikoKun,

I’m working on a game very similar to what you described. Asymmetrical, two players, one PC, one player on VR and the other using PC and monitor. I also getting the same error when trying to use this plugin. Have you ever managed to get yours working or come up with any other solutions?

Greatly appreciate any help.

Thank you

What would it take to make this method work with different resolution screens without dropping to like 10fps? Thanks

You need to rebuild the code so the plug-in is included, if your project doesn’t have a c++ code class, you can make a dummy one, rebuild and it should include the new actor after that, if not try deleting the saved and intermediate files and rebuilding and right clicking the project and saying rebuild visual studio files. once it works make sure you right click on teh window and tick off show plugin content or you wont see it

Thank you for this great plugin, I’m trying to make something similar, I need advice, I want to draw a UMG Widget in desktop window when player is in VR mode, something like the attached photo this is from Fantastic Contraption, when player is in VR mode another person or player can activate this menu in just desktop window and not in HMD…

This is the Render function in SteamVRRender.cpp :


void FSteamVRHMD::RenderTexture_RenderThread(FRHICommandListImmediate& RHICmdList, FTexture2DRHIParamRef BackBuffer, FTexture2DRHIParamRef SrcTexture) const
{
	check(IsInRenderingThread());

	if (WindowMirrorMode == 0)
	{
		return;
	}

	const uint32 ViewportWidth = BackBuffer->GetSizeX();
	const uint32 ViewportHeight = BackBuffer->GetSizeY();

	SetRenderTarget(RHICmdList, BackBuffer, FTextureRHIRef());
	RHICmdList.SetViewport(0, 0, 0, ViewportWidth, ViewportHeight, 1.0f);

	RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());
	RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
	RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());

	const auto FeatureLevel = GMaxRHIFeatureLevel;
	auto ShaderMap = GetGlobalShaderMap(FeatureLevel);

	TShaderMapRef<FScreenVS> VertexShader(ShaderMap);
	TShaderMapRef<FScreenPS> PixelShader(ShaderMap);

	static FGlobalBoundShaderState BoundShaderState;
	SetGlobalBoundShaderState(RHICmdList, FeatureLevel, BoundShaderState, RendererModule->GetFilterVertexDeclaration().VertexDeclarationRHI, *VertexShader, *PixelShader);

	PixelShader->SetParameters(RHICmdList, TStaticSamplerState<SF_Bilinear>::GetRHI(), SrcTexture);

	if (WindowMirrorMode == 1)
	{
		// need to clear when rendering only one eye since the borders won't be touched by the DrawRect below
		RHICmdList.Clear(true, FLinearColor::Black, false, 0, false, 0, FIntRect());

		RendererModule->DrawRectangle(
			RHICmdList,
			ViewportWidth / 4, 0,
			ViewportWidth / 2, ViewportHeight,
			0.1f, 0.2f,
			0.3f, 0.6f,
			FIntPoint(ViewportWidth, ViewportHeight),
			FIntPoint(1, 1),
			*VertexShader,
			EDRF_Default);
	}
	else if (WindowMirrorMode == 2)
	{
		RendererModule->DrawRectangle(
			RHICmdList,
			0, 0,
			ViewportWidth, ViewportHeight,
			0.0f, 0.0f,
			1.0f, 1.0f,
			FIntPoint(ViewportWidth, ViewportHeight),
			FIntPoint(1, 1),
			*VertexShader,
			EDRF_Default);
	}
}

I made some plugin, maybe it can help you GitHub - Batname/SpectatorWindow

@DenisDubinin thanks for creating the plugin. I am trying to compile it using engine version 4.19.2

but the build keeps failing.

This is the error I get
1>C:\Users\Admin\Downloads\SpectatorWindow-master\SpectatorWindow-master\Plugins\MultiWindow\Source\MultiWindow\Private\MV_SpectatorWindowActor.cpp(315): error C3861: ‘GetAndOrCreateGraphicsPipelineState’: identifier not found

Any help will be greatly appreciated. Thanks!

Hi everyone, I’m trying to use chaosgrid’s plugin with UE4.18.3, and still having rendering issues… I disabled motion blur and switched from AA to FXAA (which made things much better) but there are still some visual bugs, a little jittering I think. Has anyone faced that as well ? I don’t know anything about rendering settings so maybe I just missed something…
My other option would be to modify @DenisDubinin’s plugin to show a different camera but I don’t know if it is really doable and don’t understand much of the code for now.
Any help is welcomed !

@KaranMonster I made it work on version 4.18.3 with that pull request : Upgrade to 4.18.3 by fweidner · Pull Request #1 · Batname/SpectatorWindow · GitHub
I hope it works with 4.19 as well !

Hope this plugin can help you.
MultiWindows4UE4”: UE4MarketplaceSubmission_Public / MultiWindows4UE4_Public · GitLab

Hi,
Did you find any solution for this ?

It seems like need to update as per unreal version not working for 4.23!