blob: d39d5004bb9dc2884dc7b351e87abf2a1d9296c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "foliage.h"
#include "gfx/gl/sceneShader.h"
#include "gfx/gl/shadowMapper.h"
#include "gfx/models/texture.h"
bool
Foliage::persist(Persistence::PersistenceStore & store)
{
return STORE_TYPE && STORE_HELPER(bodyMesh, Asset::MeshConstruct) && Asset::persist(store);
}
void
Foliage::postLoad()
{
texture = getTexture();
}
void
Foliage::render(const SceneShader & shader, const Location & loc) const
{
shader.basic.use(loc);
if (texture) {
texture->bind();
}
bodyMesh->Draw();
}
void
Foliage::shadows(const ShadowMapper & mapper, const Location & loc) const
{
mapper.dynamicPoint.use(loc);
bodyMesh->Draw();
}
|