Fixed whatever was wrong with my shader

This commit is contained in:
2022-12-05 19:27:32 -08:00
parent c426dfe4d1
commit 0a4170ea3d
21 changed files with 284 additions and 61 deletions

View File

@ -22,9 +22,17 @@ namespace Dawn {
auto item = scene->createSceneItem();
auto meshRenderer = item->addComponent<MeshRenderer>();
auto material = item->addComponent<Material>();
auto asset = scene->game->assetManager.get<TextureAsset>("texture_penny");
auto param = material->getShader()->getParameterByName("u_Text");
material->textureValues[param] = &asset->texture;
auto meshHost = item->addComponent<MeshHost>();
auto tiledSprite = item->addComponent<TiledSprite>();
tiledSprite->setTileset(&scene->game->assetManager.get<TilesetAsset>("tileset_penny")->tileset);
tiledSprite->setSize(glm::vec2(2, 2));
auto pokerPlayer = item->addComponent<PokerPlayer>();
return item;