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; }
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(); }
public void SetTexture(RTextureLayer TextureLayer, RTexture texture) { Textures[GetTextureLayerIndex(TextureLayer)] = texture; }
public void SetTexture(int TextureLayer, uint TextureId) { RTexture texture = RTextures.GetTexture(TextureId); Textures[GetTextureLayerIndex((RTextureLayer)TextureLayer)] = texture; }