mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix segfault
This commit is contained in:
parent
8bb03a004f
commit
b5253bff99
2 changed files with 3 additions and 4 deletions
|
|
@ -131,9 +131,6 @@ void WorldRenderer::setupWorldShader(
|
|||
shader.uniform1i("u_enableShadows", shadows);
|
||||
|
||||
if (shadows) {
|
||||
if (shadowMap == nullptr) {
|
||||
shadowMap = std::make_unique<ShadowMap>(1024 * 8);
|
||||
}
|
||||
shader.uniformMatrix("u_shadowsMatrix", shadowCamera.getProjView());
|
||||
shader.uniform3f("u_sunDir", shadowCamera.front);
|
||||
shader.uniform1i("u_shadowsRes", shadowMap->getResolution());
|
||||
|
|
@ -407,6 +404,9 @@ void WorldRenderer::draw(
|
|||
skybox->refresh(pctx, worldInfo.daytime, mie, 4);
|
||||
|
||||
if (shadows) {
|
||||
if (shadowMap == nullptr) {
|
||||
shadowMap = std::make_unique<ShadowMap>(1024 * 8);
|
||||
}
|
||||
generateShadowsMap(camera, pctx);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue