private static string GetLUTInput(PICALUTInput Input, PICALUTScale Scale, int LUT)
        {
            //TODO: CosLightSpot and CosPhi
            string InputStr;

            switch (Input)
            {
            default:
            case PICALUTInput.CosNormalHalf:  InputStr = "CosNormalHalf";  break;

            case PICALUTInput.CosViewHalf:    InputStr = "CosViewHalf";    break;

            case PICALUTInput.CosNormalView:  InputStr = "CosNormalView";  break;

            case PICALUTInput.CosLightNormal: InputStr = "CosLightNormal"; break;

            case PICALUTInput.CosLightSpot:   InputStr = "CosLightSpot";   break;

            case PICALUTInput.CosPhi:         InputStr = "CosPhi";         break;
            }

            string Output = $"texture(LUTs[{LUT}], vec2(({InputStr} + 1) * 0.5, 0)).r";

            if (Scale != PICALUTScale.One)
            {
                string ScaleStr = Scale.ToSingle().ToString(CultureInfo.InvariantCulture);

                Output = $"min({Output} * {ScaleStr}, 1)";
            }

            return(Output);
        }
Beispiel #2
0
 public PICALUTInSel(uint Param)
 {
     Dist0    = (PICALUTInput)((Param >> 0) & 7);
     Dist1    = (PICALUTInput)((Param >> 4) & 7);
     Specular = (PICALUTInput)((Param >> 8) & 7);
     Fresnel  = (PICALUTInput)((Param >> 12) & 7);
     ReflecR  = (PICALUTInput)((Param >> 16) & 7);
     ReflecG  = (PICALUTInput)((Param >> 20) & 7);
     ReflecB  = (PICALUTInput)((Param >> 24) & 7);
 }