yum-mirror/slang

Making it easier to work with shaders

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

Yong HeFix crash when private ctor is used for coercion. (#7858)52a45890b

master
554 B28 linesraw
1module bsdfs;
2__include lambert_diffuse_btdf;
3
4public struct BSDFContext
5{
6    float iorI;  ///< IOR from incidence medium
7    float iorT;  ///< IOR trom transmission medium
8    bool inited; ///< Flag to indicate if the struct was initialized
9
10    __init(float iorI_, float iorT_)
11    {
12        iorI = iorI_;
13        iorT = iorT_;
14        inited = true;
15    }
16
17    __init()
18    {
19        iorI = 1.f;
20        iorT = 1.f;
21        inited = false;
22    }
23}
24
25public interface IBSDF
26{
27    public float3 eval(const float3 wi, const float3 wo, BSDFContext bc);
28}