You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
734 B
18 lines
734 B
2 years ago
|
#ifndef UNITY_SHADER_VARIABLES_FUNCTIONS_DEPRECATED_INCLUDED
|
||
|
#define UNITY_SHADER_VARIABLES_FUNCTIONS_DEPRECATED_INCLUDED
|
||
|
|
||
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
||
|
|
||
|
// Deprecated: A confusingly named and duplicate function that scales clipspace to unity NDC range. (-w < x(-y) < w --> 0 < xy < w)
|
||
|
// Use GetVertexPositionInputs().positionNDC instead for vertex shader
|
||
|
// Or a similar function in Common.hlsl, ComputeNormalizedDeviceCoordinatesWithZ()
|
||
|
float4 ComputeScreenPos(float4 positionCS)
|
||
|
{
|
||
|
float4 o = positionCS * 0.5f;
|
||
|
o.xy = float2(o.x, o.y * _ProjectionParams.x) + o.w;
|
||
|
o.zw = positionCS.zw;
|
||
|
return o;
|
||
|
}
|
||
|
|
||
|
#endif // UNITY_SHADER_VARIABLES_FUNCTIONS_DEPRECATED_INCLUDED
|