materials are now created by specifying shaders

shader uniforms are added to materials
This commit is contained in:
devZoGok
2021-11-10 20:23:15 +02:00
parent 34e7a74bba
commit ec8dd7ac1e
17 changed files with 321 additions and 213 deletions
+3 -3
View File
@@ -51,12 +51,12 @@ int main(){
* Creates a material for text objects and
* attaches a diffuse texture with 2 images
*/
Material *textMat = new Material(Material::MATERIAL_TEXT);
textMat->setTexturingEnabled(true);
Material *textMat = new Material(PATH + "text");
textMat->addVariable("texturingEnabled", true);
string frames[]{TEX_PATH + "bricks.jpg", TEX_PATH + "defaultTexture.jpg"};
Texture *texture = new Texture(frames, 2);
textMat->addDiffuseMap(texture);
textMat->addVariable("textures[0]", texture);
for(int i = 0; i < numTexts; i++){
Text *text = new Text(FONT_PATH + fonts[i], texts[i]);