mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
refactor shaders
This commit is contained in:
parent
36e5ff2472
commit
30a0b81680
9 changed files with 128 additions and 88 deletions
|
|
@ -71,7 +71,7 @@ void Skybox::drawBackground(
|
|||
backShader->uniformMatrix("u_view", camera.getView(false));
|
||||
backShader->uniform1f("u_zoom", camera.zoom*camera.getFov()/(M_PI*0.5f));
|
||||
backShader->uniform1f("u_ar", float(width)/float(height));
|
||||
backShader->uniform1i("u_cubemap", 1);
|
||||
backShader->uniform1i("u_skybox", 1);
|
||||
bind();
|
||||
mesh->draw();
|
||||
unbind();
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ void WorldRenderer::setupWorldShader(
|
|||
shader.uniform1f("u_dayTime", level.getWorld()->getInfo().daytime);
|
||||
shader.uniform2f("u_lightDir", skybox->getLightDir());
|
||||
shader.uniform3f("u_cameraPos", camera.position);
|
||||
shader.uniform1i("u_cubemap", 1);
|
||||
shader.uniform1i("u_skybox", 1);
|
||||
shader.uniform1i("u_enableShadows", gbufferPipeline);
|
||||
|
||||
if (gbufferPipeline) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue