#include "ShaderApiReflectionSupport.hlsl"
namespace ShaderFunctionReflectionReference {
///
/// SG.NodeReference.Static.Example
/// Static Example
/// Reference/Shader Functions
/// Static Example
/// Reference, Hint
///
///
///
/// .5,.5,.5,1
///
///
/// Multiplier
/// 1
///
/// 0, 1
///
UNITY_EXPORT_REFLECTION
void StaticExample(inout float3 color, float multiplier)
{
color *= multiplier;
}
///
/// SG.NodeReference.Dynamic.Example
/// Dynamic Example
/// Dot Product
/// Reference/Shader Functions
/// Dynamic Example
/// Reference, Hint
///
///
///
/// 0, 1
///
///
///
/// 1, 0
///
///
///
///
UNITY_EXPORT_REFLECTION
float DynamicExample(inout float a, float b, out float sum)
{
a *= b;
sum = a + b;
return dot(a, b);
}
///
/// SG.NodeReference.Precision.Example
/// Precision Example
/// Reference/Shader Functions
/// Precision Example
/// Reference, Hint
///
///
/// 1
///
///
/// 1
///
UNITY_EXPORT_REFLECTION
float PrecisionExample(float a, float b)
{
return dot(a, b);
}
///
/// SG.NodeReference.Reference.Example
/// Reference Example
/// Reference/Shader Functions
/// Reference Example
/// Reference, Hint
///
///
///
/// UV0
///
///
///
///
///
///
/// ObjectSpace
///
UNITY_EXPORT_REFLECTION
void ReferenceExample(inout float2 uv, inout float4 vc, inout float3 position)
{
}
///
/// SG.NodeReference.Linkage.Example
/// Linkage Example
/// Reference/Shader Functions
/// Linkage Example
/// Reference, Hint
///
///
/// Ambient Sky Color
///
///
/// Ambient Ground Color
///
///
/// Camera Direction WS
///
///
/// skyColor
///
///
/// groundColor
///
///
/// cameraDirectionWS
///
UNITY_EXPORT_REFLECTION
float3 LinkageExample(
float3 skyColor,
float3 groundColor,
bool overrideSkyColor,
bool overrideGroundColor,
float3 cameraDirectionWS,
bool overrideCameraDirectionWS)
{
if (!overrideSkyColor)
skyColor = unity_AmbientSky.xyz;
if (!overrideGroundColor)
groundColor = unity_AmbientGround.xyz;
if (!overrideCameraDirectionWS)
cameraDirectionWS = - UNITY_MATRIX_V[2].xyz;
float upFacing = dot(cameraDirectionWS, float3(0, 1, 0)) * 0.5 + 0.5;
return lerp(groundColor, skyColor, upFacing);
}
///
/// SG.NodeReference.Local.Example
/// Local Example
/// Reference/Shader Functions
/// Local Example
/// Reference, Hint
///
///
///
///
///
///
///
/// 1,1,1,1
///
UNITY_EXPORT_REFLECTION
void LocalExample(float4 vc, inout float3 color)
{
color *= vc;
}
///
/// SG.NodeReference.Texture.Example
/// Texture Example
/// Reference/Shader Functions
/// Texture Example
/// Reference, Hint
///
///
///
/// UV0
///
///
///
/// 1,1,1,1
///
UNITY_EXPORT_REFLECTION
float4 TextureExample(UnityTexture2D Tex, float2 uv, float4 color)
{
return Tex.Sample( Tex.samplerstate, uv) * color;
}
}