public void SetMaterialUniforms(Shader shader, GenericMaterial previousMaterial) { // TODO: Rework default texture creation. if (defaultTextures == null) { defaultTextures = new Resources.DefaultTextures(); } if (genericMaterial == null) { genericMaterial = Material.CreateGenericMaterial(); } genericMaterial.SetShaderUniforms(shader, previousMaterial); if (uniformBlock == null) { uniformBlock = new UniformBlock(shader, "MaterialParams") { BlockBinding = 1 }; Material.AddMaterialParams(uniformBlock); } // This needs to be updated more than once. Material.AddDebugParams(uniformBlock); uniformBlock.BindBlock(shader); }
public RModel() { var shader = ShaderContainer.GetShader("RModel"); if (shader.LinkStatusIsOk) { boneUniformBuffer = new SFGenericModel.Materials.UniformBlock(shader, "Bones"); } }