yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyMerge pull request #45 from tfoleyNV/emit-imported-parameters1716208fb

master
444 B23 linesraw
1//TEST_IGNORE_FILE:
2
3// We are declaring the uniform shader parameters
4// in this imported file, to ensure that they are
5// emitted correctly.
6
7cbuffer Uniforms
8{
9	float4x4 modelViewProjection;
10};
11
12float3 transformColor(float3 color)
13{
14	float3 result;
15
16	result.x = sin(20.0 * (color.x + color.y));
17	result.y = saturate(cos(color.z * 30.0));
18	result.z = sin(color.x * color.y * color.z * 100.0);
19
20	result = 0.5 * (result + 1);
21
22	return result;
23}