Class ShadingLUT.KullaContyBRDF

java.lang.Object
org.boxutil.util.lut.ShadingLUT.KullaContyBRDF
Enclosing class:
ShadingLUT

public static final class ShadingLUT.KullaContyBRDF extends Object
  • Method Details

    • genApproximation

      public static int[] genApproximation(int sampleNum, byte sizeExponent, boolean useTextureStorage, boolean bit16)
      OpenGL 3.0+

      Real-time calculation.

      For how to sample the value in shader:

       glsl:
       float EMuVOM = texture(emuTex, vec2(NdotV, roughness)).x; // 1.0 - EMu; sampler2D
       float EMuLOM = texture(emuTex, vec2(NdotL, roughness)).x; // 1.0 - EMu; sampler2D
       float EAvg = texture(eavgTex, roughness).x; // just EAvg; sampler1D
       
       
      Returns:
      int[] = {EMu, EAvg};
    • genApproximation

      public static int[] genApproximation(boolean useTextureStorage)
      OpenGL 3.0+

      The Kulla-Conty Approximation 2D&1D texture, 64*64 / 64 half-float layout.

      For how to sample the value in shader:

       glsl:
       float EMuVOM = texture(emuTex, vec2(NdotV, roughness)).x; // 1.0 - EMu; sampler2D
       float EMuLOM = texture(emuTex, vec2(NdotL, roughness)).x; // 1.0 - EMu; sampler2D
       float EAvg = texture(eavgTex, roughness).x; // just EAvg; sampler1D
       
       
      Returns:
      int[] = {EMu, EAvg};