https://github.com/shader-slang/slang
Raw File
Tip revision: 393e25fd2e2b8c5ff82ff4c6b14a9d7152d37a5e authored by Tim Foley on 18 December 2017, 23:14:59 UTC
Work on getting rewriter + IR playing nice together. (#314)
Tip revision: 393e25f
pound-import.slang.h
//TEST_IGNORE_FILE:

// This file implements the "library" code
// that both the HLSL and GLSL shaders share.
//
// This code is written in Slang (more or less
// just HLSL), and will be translated as needed
// for each of the targets.

float3 transformColor(float3 color)
{
	float3 result;

	result.x = sin(20.0 * (color.x + color.y));
	result.y = saturate(cos(color.z * 30.0));
	result.z = sin(color.x * color.y * color.z * 100.0);

	result = 0.5 * (result + 1);

	return result;
}
back to top