diff --git a/README.md b/README.md index b7740ef7884c89e6bec157bb3df4ad0da4d3c458..196d8832481bc609785aa00e9efdc2e61a41ed13 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# THIS VERSION IS NOT WORKING RIGHT NOW - # HMD Simulator The HMD Simulator is an Unreal plugin that emulates a connected HMD and its controllers. Once the plugin is added to your project and enabled, you can [start in VR](Resources/VRLaunch.png) even if you do not have an HMD connected. @@ -27,8 +25,10 @@ As shown in the following image, if you want to control an action with the HMD S For the Unreal VR template, the following mappings could be used: **IMC_Default** -- IA_Grab_Left <-> HMDSimulator (L) Grip Button -- IA_Grab_Right <-> HMDSimulator (R) Grip Button +- IA_Grab_Left_Pressed <-> HMDSimulator (L) Grip Button +- IA_Grab_Right_Pressed <-> HMDSimulator (R) Grip Button +- IA_Grab_Left_Released <-> HMDSimulator (L) Grip Button +- IA_Grab_Right_Released <-> HMDSimulator (R) Grip Button - IA_Menu_Toggle_Left <-> HMDSimulator (L) Menu Button - IA_Menu_Toggle_Right <-> HMDSimulator (R) Menu Button diff --git a/Source/HMDSimulatorHMD/Private/SimulatedHMD.cpp b/Source/HMDSimulatorHMD/Private/SimulatedHMD.cpp index 5f4304b1cce47c0bb9adc67959ff860f73cee1fb..63b65d6a1da63b4aafe9fa411814adb3a6ab0bc7 100644 --- a/Source/HMDSimulatorHMD/Private/SimulatedHMD.cpp +++ b/Source/HMDSimulatorHMD/Private/SimulatedHMD.cpp @@ -250,13 +250,21 @@ void FSimulatedHMD::CopyTexture_RenderThread(FRHICommandListImmediate& RHICmdLis const bool bSameSize = DstRect.Size() == SrcRect.Size(); if (bSameSize) { - //FRHIBatchedShaderParameters& BatchedParameters, FRHISamplerState* SamplerStateRHI, FRHITexture* TextureRHI - - PixelShader->SetParameters(RHICmdList, TStaticSamplerState<SF_Point>::GetRHI(), SrcTexture); + FRHIBatchedShaderParametersAllocator* batch_allocator = RHICmdList.CreateBatchedShaderParameterAllocator(ERHIBatchedShaderParameterAllocatorPageSize::Small); + FRHIBatchedShaderParameters batch(*batch_allocator); + + PixelShader->SetParameters(batch, TStaticSamplerState<SF_Point>::GetRHI(), SrcTexture); + + RHICmdList.SetBatchedShaderParameters(PixelShader.GetPixelShader(), batch); } else { - PixelShader->SetParameters(RHICmdList, TStaticSamplerState<SF_Bilinear>::GetRHI(), SrcTexture); + FRHIBatchedShaderParametersAllocator* batch_allocator = RHICmdList.CreateBatchedShaderParameterAllocator(ERHIBatchedShaderParameterAllocatorPageSize::Small); + FRHIBatchedShaderParameters batch(*batch_allocator); + + PixelShader->SetParameters(batch, TStaticSamplerState<SF_Bilinear>::GetRHI(), SrcTexture); + + RHICmdList.SetBatchedShaderParameters(PixelShader.GetPixelShader(), batch); } RendererModule->DrawRectangle(