Пример #1
0
 internal RMaterial(string name)
 {
     Name     = name;
     Textures = new RTexture[MAX_MATERIAL_LAYERS];
     for (int i = 0; i < Textures.Length; i++)
     {
         Textures[i] = RTexture.defaultWhite;
     }
     Colors        = new RColor[MAX_MATERIAL_COLOR_LAYERS];
     Shininess     = 1;
     SpecularPower = 1;
     Shader        = RShader.basicShader;
 }
Пример #2
0
        public void SetSamplerValue(RTextureLayer layer, RTexture texture)
        {
            int unival = GetTexUniformValue(layer);
            int loc    = GetTexUniformLocation(layer);

            GL.Uniform1(loc, unival);
            REngine.CheckGLError();
            TextureUnit unit = (TextureUnit)(int)layer;

            GL.ActiveTexture(unit);
            REngine.CheckGLError();
            texture.Bind();
            REngine.CheckGLError();
        }
Пример #3
0
 public void SetTexture(RTextureLayer TextureLayer, RTexture texture)
 {
     Textures[GetTextureLayerIndex(TextureLayer)] = texture;
 }
Пример #4
0
        public void SetTexture(int TextureLayer, uint TextureId)
        {
            RTexture texture = RTextures.GetTexture(TextureId);

            Textures[GetTextureLayerIndex((RTextureLayer)TextureLayer)] = texture;
        }