Files
UnrealEngineUWP/Engine/Shaders/CommonViewUniformBuffer.usf
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

33 lines
1.1 KiB
Plaintext

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
CommonViewUniformBuffer.usf: Common view uniform buffer specifics
=============================================================================*/
/*
* @return tan(View.FieldOfViewWideAngles * .5)
*/
float2 GetTanHalfFieldOfView()
{
return float2(View.ClipToView[0][0], View.ClipToView[1][1]);
}
float2 GetPrevTanHalfFieldOfView()
{
return float2(View.PrevClipToView[0][0], View.PrevClipToView[1][1]);
}
// might be used by Custom material expressions (still best to wrap the custom node in a material function)
// @return 1 / tan(View.FieldOfViewWideAngles * .5)
float2 GetCotanHalfFieldOfView()
{
return float2(View.ViewToClip[0][0], View.ViewToClip[1][1]);
}
// might be used by Custom material expressions (still best to wrap the custom node in a material function)
// @return previous 1 / tan(View.FieldOfViewWideAngles * .5)
float2 GetPrevCotanHalfFieldOfView()
{
return float2(View.PrevViewToClip[0][0], View.PrevViewToClip[1][1]);
}