shaders are working for models

This commit is contained in:
Clément Le Bihan
2021-06-08 15:52:12 +02:00
parent 8a729414f5
commit 7bff82a5c9
4 changed files with 48 additions and 8 deletions

View File

@@ -106,4 +106,15 @@ namespace RAY::Drawables::Drawables3D {
{
DrawModelEx(*this->_model, this->_position, this->_rotationAxis, this->_rotationAngle, this->_scale, this->_color);
}
void Model::setShader(const RAY::Shader &shader)
{
this->_originalShader = this->_model->materials[0].shader;
this->_model->materials[0].shader = *shader.getShaderPtr();
}
void Model::resetShader()
{
this->_model->materials[0].shader = this->_originalShader;
}
}