Files
UnrealEngineUWP/Engine/Shaders/Private/OculusShaders.usf
Mike Beach 14d4bfaf3d Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3512802)
#lockdown Nick.Penwarden
#rb no.one

=====================================
 MAJOR FEATURES + CHANGES
=====================================

Change 3060975 by Ryan.Vance

	Integrating 3058175 from Oculus

Change 3466079 by Nick.Atamas

	Added rudimentary collision support to MrMesh.

Change 3468111 by Mike.Beach

	Give the SceneRender component's scene view a specific ViewActor (the component's owner). This lets us set bOnlyOwnerSee on components belonging to the same actor, and have it only showup in the render scene view.

Change 3468267 by Nick.Atamas

	Now using non-interleaved data in MRMeshComponent

Change 3468475 by Mike.Beach

	Initial checkin for new mixed reality plugin (WIP). New MixedReality capture component, intended to mimic a real world camera.

	Copying //Tasks/UE4/Dev-MixedReality to Dev-VR-Minimal (//UE4/Dev-VR-Minimal)

	#jira UEVR-795, UEVR-789

Change 3468483 by Mike.Beach

	Marking the new MixedReality plugin as experimental (as it is incomplete and a WIP)

Change 3468511 by Mike.Beach

	CIS fixes for fallout from CL 3468475.

Change 3469754 by Mike.Beach

	CIS compiler error fixes (fallout from CL 3468475).

Change 3470407 by Mike.Beach

	*sigh* more CIS fixes (fallout from 3468475)

Change 3471494 by Douglas.Copeland

	Test content for GearVR Stereo Layers

Change 3476135 by Jeff.Fisher

	UE-45661 Duplicate .so files in GoogleVR.
	-We want the version of each file from the android_x86 style folder, but in the android\x86 folder, and the APL.xml file needed to reference the new path rather than the old path.
	-This fix was also made in Release-4.16 for 4.16.2 in cl 3476133.
	#jira UE-45661
	#review-3474770

Change 3480446 by Dustin.Holmes

	Added support for Vive Tracker.
	#jira UEVR-792

Change 3480552 by Dustin.Holmes

	Added map and gamemode for calibration
	#jira UEVR-808

Change 3483325 by Nick.Atamas

	Merging //UE4/Partner-Google-VR to Dev-VR (//UE4/Dev-VR)

	Known issue with Mac build packaging.

Change 3485969 by Nick.Atamas

	Fixed double-spacing and formatting issues.
	Converted TangoEcefUtils.cpp to follow Epic coding standards.

Change 3486071 by Nick.Atamas

	Rename/move file(s) from Plugins/Runtime/Tango/... to Plugins/Runtime/GoogleTango/...

Change 3486078 by Nick.Atamas

	Fixed non-portable (wrong case) include path.

Change 3486906 by Jeff.Fisher

	Fixing build warning about a variable being shadowed.

Change 3487245 by Jeff.Fisher

	Fixing build break in some template source files from HeadMountedDisplayFunctionLibrary move.

Change 3487827 by Nick.Atamas

	Fixing the missing platforms header; should resolve CIS warning.

Change 3488808 by Keli.Hlodversson

	Fix vr.Debug.VisualizeTrackingSensors when ViewTarget->HasActiveCameraComponent() is true.
	Also switched to use GWorld instead of passing in the current World argument to the handler as the world pointer can change for instance if turning the setting on and loading another level in the editor.
	#jira UE-45949

Change 3490841 by Nick.Atamas

	Fixing more CIS and coding standard issues related to Tango.

Change 3491038 by Nick.Atamas

	Modified GoogleInstantPreview.Build.cs to use RuntimeDependencies instead of explicit dylib/dll copying.

Change 3492481 by Jeff.Fisher

	Fixing HeadMountedDisplayTypes.h shadowed member warning.

Change 3495157 by Mike.Beach

	New XR modular feature - XRDeviceAssets. Intended to give us access to device models so we can render arbitrary devices. Implements this for SteamVR.

	#jira UEVR-829

Change 3495205 by Mike.Beach

	CIS fix (fallout from 3495157) - missing leading 'template<>' for template specializations.

Change 3495213 by Mike.Beach

	Fixing the vr.SpectatorScreenMode CVar so that it's sink function doesn't override other CVar commands that set the mode themselves.

	#jira UEVR-790

Change 3495403 by Nick.Atamas

	- Disabled Google Tango support for Win32.
	- Disabled GoogleInstantPreview files being erroneously included while building game; it is only used by Editor.
	- Renamed Tango.uplugin -> GoogleTango.uplugin
	- Fixed self-assignment in TangoImageComponent.cpp

Change 3496225 by Mike.Beach

	Fixing CIS compiler error for non-editor builds (fallout from CL 3495157).

Change 3496981 by Nick.Atamas

	GoogleInstantPreview libraries are now checked into Binaries/ThirdParty/... so that no copying from .Build.cs is necessary.

Change 3497033 by Nick.Atamas

	Going back from GoogleTango/ to Tango/. It's a bigger change that previously thought.

Change 3498487 by Nick.Whiting

	Adding option to PIE settings to NOT minimize editor when doing VR PIE

Change 3499242 by Dustin.Holmes

	Fixed static analysis warning by updating the number of devices that can have their button states tracked.

Change 3499341 by Nick.Atamas

	Hopefully fixes Mac Editor CIS.

Change 3499395 by Arciel.Rekman

	Copying //UE4/Partner-Valve@3499365 to Dev-VR (//UE4/Dev-VR)

Change 3499550 by Ryan.Vance

	Fixing compile issue.

Change 3499678 by Nick.Atamas

	- Dummy Mesh Reconsturctor now sometimes generates empty blocks to test more scenarios.
	- Removed unused code in DummyMeshReconstructorModule
	- Removed unused variable in GoogleInstantPreview.Build.cs

Change 3499840 by Nick.Atamas

	std::string needed by google's online system.

Change 3499889 by Nick.Atamas

	Fixed static code analysis CIS fails.

Change 3500007 by Nick.Whiting

	Removing Vulkan RHI dependency on a plugin, refactoring it to use an interface to check to break the dependency

Change 3500027 by Nick.Whiting

	Fixing missing include file in SteamAudio

Change 3500030 by Nick.Whiting

	Changing cast from reinterp to static.  Copypasta fail

Change 3500078 by Nick.Whiting

	Speculative fix for the builder for an error that doesn't repro locally

Change 3500086 by Nick.Atamas

	More build fixups.

Change 3500096 by Nick.Atamas

	Copying //UE4/Partner-Google-VR-Minimal at CL3499964 to Dev-VR (//UE4/Dev-VR)

Change 3500107 by Nick.Atamas

	Does this fix CIS?

Change 3500121 by Nick.Atamas

	More CIS fixing, hopefully.

Change 3500129 by Nick.Atamas

	More CIS fixing.

Change 3500713 by Nick.Whiting

	Fix for Win32 build break

Change 3500887 by Arciel.Rekman

	Fixed copyright notices and compilation errors in Steam Audio.

	(Edigrating CL 3500131)

Change 3501010 by Arciel.Rekman

	Fix shadowing error.

Change 3501230 by Nick.Atamas

	Make warning go away.

Change 3501890 by Nick.Atamas

	Moving Tango->GoogleTango. Fixup pass in next CL.

Change 3501900 by Jeff.Fisher

	UE-46265 Crash attempting to Play in VR
	-Need to call UpdateSpectatorScreenMode_RenderThread in PreRenderViewFamily_RenderThread so that the mode is set before other renderthread work decides what to do based on the mode.
	#review-3501882
	#jira UE-46256

Change 3502152 by Nick.Whiting

	Oculus Unified Plugin.  OculusHMD plugin now supports both the Rift and the GearVR in one plugin.  Minor supporting engine modifications included

Change 3502199 by Nick.Atamas

	Checking in TangoQA project with fixed-up content to point at GoogleTango plugin.
	Known issue: crash when building cooking collision for bricks with no triangles.

Change 3502215 by Nick.Atamas

	Fixed UIScale curve.

Change 3502253 by Nick.Whiting

	Trying to fix up p4's botch of the merge

Change 3502930 by Mike.Beach

	Attempt to fix build errors (fallout from CL 3502873), using new (moved/renamed) PhysX cook util struct.

Change 3503559 by Jeff.Fisher

	UE-46300 Editor process crashes when opening with Oculus HMD plugged in
	-Reimplementing spectator screen for updated oculus plugin.
	#jira UE-46300
	#review-3503455

Change 3503685 by Jeff.Fisher

	TM-SpectatorScreen
	-made the scene capture component follow the camera orientation so i can make it look at different stuff.

Change 3503695 by Nick.Whiting

	Fixes for build breaks

Change 3503819 by Jeff.Fisher

	TM-SpectatorScreen
	-Adjusted scene capture and render target to get approximately correct color in the spectator screen.

Change 3503852 by Nick.Atamas

	- Fixed crash when sending a brick with 0 data.
	- Added implementation to ClearAllBricks.

Change 3503947 by Ryan.Vance

	Fixing overspecified method definitions.

Change 3505242 by Douglas.Copeland

	Added gamepad inputs to SpectatorScreen Level BP for more efficient test setup

Change 3505307 by Douglas.Copeland

	Re-saving Emmissive_Blue Material to resolve map warning

Change 3505704 by Ryan.Vance

	We can't pass a nullptr into RenderTexture_RenderThread. Instead of checking for a mirror window here, the RenderTexture_RenderThread implementation should do the right thing. Jeff's mirrorwindow/socialscreen refactoring should handle this correctly now.

Change 3505914 by Jeff.Fisher

	UE-46370 Ensure handled when restarting Editor after disabling Oculus plugin
	-remove scaling from the pose if necessary.  It appears that when running oculus rift through steamvr the tracking reference comes through at .99 scale.  We can't build a quat out of it unless it is normalized.
	#jira UE-46370
	#review-3505892

Change 3506650 by Jack.Porter

	External Texture fixes changes from Dev-Sequencer
	- fix ENGINE_API meaning singletons were existing in each module
	- fix crash releasing an External RHITexture resource.
	- Recache uniform expressions when external textures are registered and unregistered

Change 3506653 by Jack.Porter

	Remove external texture logging that was accidentally enabled.

Change 3507043 by Mike.Beach

	Fixing CIS content errors (copied material still referencing assets from a separate plugin) - redid the material.

Change 3507231 by Ryan.Vance

	#jira UE-46426

	Fail preinit on gearvr if bPackageForGearVR is false

Change 3507822 by Jeff.Fisher

	UE-46445 Player can't move through level by holding one grip button in Editor VR Mode
	-We were passing worldscalefactor, rather than worldscale into the get controller position function.  WorldScaleFactor is worldscale / 100, making it a unitless multiplier of the world scale.  So a *magical* 100 needs to be multipled back in here.  Oculus must have found that and fixed it, looks like it was broken for 4.16.
	#jira UE-46445

Change 3508167 by Jeff.Fisher

	Fixing CheckSlow at startup on Oculus.  The head pose orientation was being initialized to zero rather than identity, which isn't so useful.

Change 3509622 by Jeff.Fisher

	Adding commented out null check to commented out implementation of ShouldDisableHiddenAndVisibileAreaMeshForSpectatorScreen_RenderThread.

Change 3509983 by Jeff.Fisher

	Fixing vr.MirrorMode alias to vr.SpectatorScreenMode
	-was trying to use a cvar that no longer exists

Change 3510188 by Ryan.Vance

	#jira UE-46454

	We need to set the render target before applying cached render targets.

Change 3510231 by Mike.Beach

	Setting up redirects for the plugin, since it was renamed from "OculusLibrary" to "OculusHMD" - ensuring that projects don't loose references in Blueprints, etc.

	#jira UE-46462

Change 3510253 by Ryan.Vance

	#jira UE-46452

	We need to execute the clear before seting up  shader state for the copy.

Change 3511627 by Mike.Beach

	Correcting some CIS warnings - Updating misc. GetWorldFromContextObject() calls since the old signature was deprecated by the latest Framework integration.

Change 3511984 by Mike.Beach

	Fixing fallout from integration with Main (CL 3511845)... common shader file renamed (to .ush instead of .usf).

Change 3512797 by Mike.Beach

	Static analysis fix - making doubly sure that we're not indexing into out of bounds memory.

Change 3512802 by Mike.Beach

	Only warning about the OculusHMD module being unavailable when it isn't loaded (otherwise, we were extraneously warning when users didn't have a rift).

	#jira UE-46575


DONE!

[CL 3512933 by Mike Beach in Main branch]
2017-06-27 23:02:31 -04:00

77 lines
1.6 KiB
Plaintext

#include "Common.ush"
void MainVertexShader(
float4 InPosition : ATTRIBUTE0,
float2 InUV : ATTRIBUTE1,
out float2 OutUV : TEXCOORD0,
out float4 OutPosition : SV_POSITION
)
{
OutPosition = InPosition;
OutUV = InUV;
}
Texture2D<uint> TextureParameter;
void MainWhiteShader(
out float4 OutColor : SV_Target0
)
{
OutColor = float4(1, 1, 1, 1);
}
void MainBlackShader(
out float4 OutColor : SV_Target0
)
{
OutColor = float4(0, 0, 0, 0);
}
Texture2D InTexture;
TextureCube InTextureCube;
SamplerState InTextureSampler;
void MainAlphaInverseShader(
in float2 uv : TEXCOORD0,
out float4 OutColor : SV_Target0
)
{
float InverseAlpha = 1 - Texture2DSample(InTexture, InTextureSampler, uv).a;
OutColor = float4(0, 0, 0, InverseAlpha);
}
int CubeFaceIndex;
void MainForCubemap(
FScreenVertexOutput Input,
out float4 OutColor : SV_Target0
)
{
float u = Input.UV.x * 2. - 1.0;
float v = Input.UV.y * 2. - 1.0;
if(CubeFaceIndex == 0)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(1., v, u));
}
else if(CubeFaceIndex == 1)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(-1., v, -u));
}
else if(CubeFaceIndex == 2)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(u, 1., v));
}
else if(CubeFaceIndex == 3)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(u, -1., -v));
}
else if(CubeFaceIndex == 5)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(-u,v,1.));
}
else if(CubeFaceIndex == 4)
{
OutColor = TextureCubeSample(InTextureCube, InTextureSampler, float3(u,v,-1.));
}
}