static void InitTextures()
        {
            //Cube maps
            PrefilterCubeArrayTexture = GLTextureCubeArray.FromDDS(new DDS($"Resources\\CubemapPrefilter.dds"));
            DynamicReflectionTexture  = GLTextureCubeArray.FromDDS(new DDS($"Resources\\CubemapHDR.dds"));

            DiffuseLightmapTexture = GLTextureCube.FromDDS(
                new DDS(new MemoryStream(Resources.CubemapLightmap)));

            //Shadows
            DepthShadowTexture        = GLTexture2D.FromBitmap(Resources.white);
            DepthShadowCascadeTexture = GLTexture2D.FromBitmap(Resources.white);
            StaticShadowTexture       = GLTexture2D.FromBitmap(Resources.white);

            //Extra
            ProjectionTexture = GLTexture2D.FromBitmap(Resources.white);
            LightPPTexture    = GLTexture2D.FromBitmap(Resources.black);

            UserData0Texture = GLTexture2D.FromBitmap(Resources.black);
            BrdfTexture      = GLTexture2D.FromGeneric(
                new DDS(new MemoryStream(Resources.brdf)), new ImageParameters());
            UserData3Texture = GLTexture2D.FromBitmap(Resources.black);
            TableTexture     = GLTexture2DArray.FromBitmap(Resources.white);
            UserData5Texture = GLTexture2D.FromBitmap(Resources.black);

            ColorBufferTexture = GLTexture2D.FromBitmap(Resources.black);
            DepthBufferTexture = GLTexture2D.FromBitmap(Resources.black);
            SSAOBufferTexture  = GLTexture2DArray.FromBitmap(Resources.white);
        }
예제 #2
0
 private void InitTextures()
 {
     IceToonTexture     = GLTexture2D.FromBitmap(Resources.black);
     LightPPTexture     = GLTexture2DArray.FromBitmap(Resources.white);
     LinearDepthTexture = GLTexture2D.FromBitmap(Resources.black);
     ShadowTexture      = GLTexture2D.FromBitmap(Resources.white);
     ProjectionTexture  = GLTexture2D.FromBitmap(Resources.white);
     ToonTexture        = GLTexture2D.FromGeneric(new DDS(new System.IO.MemoryStream(Resources.toon)));
 }
        static void InitTextures()
        {
            //Reflective cubemap
            CubeMapTexture = GLTextureCubeArray.FromDDS(new DDS($"Resources\\CubemapHDR.dds"));

            CubemapManager.InitDefault(CubeMapTexture);

            //Diffuse cubemap lighting
            //Map gets updated when an object moves using probe lighting.
            DiffuseLightmapTexture = GLTextureCube.FromDDS(
                new DDS(new MemoryStream(Resources.CubemapLightmap)),
                new DDS(new MemoryStream(Resources.CubemapLightmapShadow)));

            //Shadows
            //Channel usage:
            //Red - Dynamic shadows
            //Green - Static shadows (course)
            //Blue - Soft shading (under kart, dynamic AO?)
            //Alpha - Usually gray
            DepthShadowTexture = GLTexture2D.FromBitmap(Resources.white);

            DepthShadowCascadeTexture = GLTexture2D.FromBitmap(Resources.white);

            //Tire marks
            ProjectionTexture = GLTexture2D.FromBitmap(Resources.white);

            //Used for dynamic lights. Ie spot, point, kart lights
            //Dynamic lights are setup using the g buffer pass (normals) and depth information before material pass is drawn
            //Additional slices may be used for bloom intensity
            LightPPTexture = GLTexture2DArray.FromBitmap(Resources.black);

            //Depth information. Likely for shadows
            NormalizedLinearDepth = GLTexture2D.FromBitmap(Resources.black);

            //Adjust mip levels

            CubeMapTexture.Bind();
            GL.TexParameter(CubeMapTexture.Target, TextureParameterName.TextureBaseLevel, 0);
            GL.TexParameter(CubeMapTexture.Target, TextureParameterName.TextureMaxLevel, 13);
            CubeMapTexture.Unbind();

            DiffuseLightmapTexture.Bind();
            GL.TexParameter(DiffuseLightmapTexture.Target, TextureParameterName.TextureBaseLevel, 0);
            GL.TexParameter(DiffuseLightmapTexture.Target, TextureParameterName.TextureMaxLevel, 2);
            DiffuseLightmapTexture.Unbind();
        }