Files
Seele/res/shaders/lib/Material.slang
T

42 lines
871 B
Plaintext
Raw Normal View History

2020-06-02 11:46:18 +02:00
import Common;
import BRDF;
2023-11-05 10:36:01 +01:00
import MaterialParameter;
2024-06-18 19:19:05 +02:00
import Scene;
2020-06-02 11:46:18 +02:00
2024-04-26 19:32:38 +02:00
//interface IMaterial
//{
// associatedtype BRDF : IBRDF;
// BRDF prepare(MaterialParameter input);
//};
2024-06-18 19:19:05 +02:00
layout(set=4, binding=0)
Texture2D textureArray[];
layout(set=4, binding=1)
SamplerState samplerArray[];
layout(set=4, binding=2)
StructuredBuffer<float> floatArray;
Texture2D getMaterialTextureParameter(uint index)
{
return textureArray[pOffsets.textureOffset + index];
}
SamplerState getMaterialSamplerParameter(uint index)
{
return samplerArray[pOffsets.samplerOffset + index];
}
float getMaterialFloatParameter(uint index)
{
return floatArray[pOffsets.floatOffset + index];
}
float3 getMaterialVectorParameter(uint index)
{
return float3(
floatArray[pOffsets.floatOffset + index],
floatArray[pOffsets.floatOffset + index + 1],
floatArray[pOffsets.floatOffset + index + 2]
);
}