Files
UnrealEngineUWP/Engine/Shaders/CommonViewUniformBuffer.usf
Guillaume Abadie bf8c47df64 Exposes the view property's inverse and the TanHalfFieldOfView view property in the material editor
#code_review: Martin.Mittring

[CL 2597659 by Guillaume Abadie in Main branch]
2015-06-23 15:19:21 -04:00

32 lines
819 B
Plaintext

// Copyright 1998-2015 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]);
}
/*
* @return 1 / tan(View.FieldOfViewWideAngles * .5)
*/
float2 GetCotanHalfFieldOfView()
{
return float2(View.ViewToClip[0][0], View.ViewToClip[1][1]);
}
float2 GetPrevCotanHalfFieldOfView()
{
return float2(View.PrevViewToClip[0][0], View.PrevViewToClip[1][1]);
}