Unity Web Shader IDE
Full source <CORE>/ShaderLibrary/DynamicScaling.hlsl HLSL 18 lines 9 symbols 0 includes Hide source Show source
DynamicScaling.hlsl <CORE>/ShaderLibrary/DynamicScaling.hlsl
Language
HLSL
Lines
18
Symbols
9
Includes
0
Open IDE root

<CORE>/ShaderLibrary/DynamicScaling.hlsl full source

#ifndef UNITY_DYNAMIC_SCALING_INCLUDED
#define UNITY_DYNAMIC_SCALING_INCLUDED

float2 DynamicScalingApplyScaleBias(float2 xy, float4 dynamicScalingScaleBias)
{
    return dynamicScalingScaleBias.zw + xy * dynamicScalingScaleBias.xy;
}

float2 DynamicScalingRemoveScaleBias(float2 xy, float4 dynamicScalingScaleBias)
{
    return (xy - dynamicScalingScaleBias.zw) / dynamicScalingScaleBias.xy;
}

#define DYNAMIC_SCALING_APPLY_SCALEBIAS(uv)  DynamicScalingApplyScaleBias(uv, _BlitScaleBias)
#define DYNAMIC_SCALING_REMOVE_SCALEBIAS(uv) DynamicScalingRemoveScaleBias(uv, _BlitScaleBias)

#endif // UNITY_DYNAMIC_SCALING_INCLUDED