mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add u_dayTime to skybox shader
This commit is contained in:
parent
751f8a7544
commit
dfdb8e80a4
1 changed files with 2 additions and 0 deletions
|
|
@ -136,6 +136,7 @@ void Skybox::draw(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skybox::refresh(const DrawContext& pctx, float t, float mie, uint quality) {
|
void Skybox::refresh(const DrawContext& pctx, float t, float mie, uint quality) {
|
||||||
|
float dayTime = t;
|
||||||
DrawContext ctx = pctx.sub();
|
DrawContext ctx = pctx.sub();
|
||||||
ctx.setDepthMask(false);
|
ctx.setDepthMask(false);
|
||||||
ctx.setDepthTest(false);
|
ctx.setDepthTest(false);
|
||||||
|
|
@ -185,6 +186,7 @@ void Skybox::refresh(const DrawContext& pctx, float t, float mie, uint quality)
|
||||||
shader->uniform1f("u_mie", mie);
|
shader->uniform1f("u_mie", mie);
|
||||||
shader->uniform1f("u_fog", mie - 1.0f);
|
shader->uniform1f("u_fog", mie - 1.0f);
|
||||||
shader->uniform3f("u_lightDir", lightDir);
|
shader->uniform3f("u_lightDir", lightDir);
|
||||||
|
shader->uniform1f("u_dayTime", dayTime);
|
||||||
for (uint face = 0; face < 6; face++) {
|
for (uint face = 0; face < 6; face++) {
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, cubemap->getId(), 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, cubemap->getId(), 0);
|
||||||
shader->uniform3f("u_xaxis", xaxs[face]);
|
shader->uniform3f("u_xaxis", xaxs[face]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue