You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
19 lines
797 B
Plaintext
19 lines
797 B
Plaintext
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ColorUtils.hlsl: Some utility functions for dealing with colors.
|
|
=============================================================================*/
|
|
|
|
void ReplicateChannel(inout float4 BaseColor, half4 InComponentReplicate, half4 InComponentReplicateAlpha)
|
|
{
|
|
#if FEATURE_LEVEL >= FEATURE_LEVEL_SM4
|
|
//In SM4/5, doing a texture lookup from a G8 texture gives float4(value,0,0,0), so we need to replicate it to the other channels.
|
|
//On all other platforms, the value is replicated automatically.
|
|
if(any(InComponentReplicate != 0.0))
|
|
{
|
|
BaseColor = dot(BaseColor,InComponentReplicate);
|
|
}
|
|
#endif
|
|
BaseColor.a = dot(BaseColor,InComponentReplicateAlpha);
|
|
}
|