Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rts/Lua/LuaUnsyncedCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4201,6 +4201,8 @@ int LuaUnsyncedCtrl::SetSunDirection(lua_State* L)
auto dir = float3(luaL_checkfloat(L, 1), luaL_checkfloat(L, 2), luaL_checkfloat(L, 3));
auto intensity = luaL_optfloat(L, 4, 1.0f); // seems broken atm, only toggles shadows off when set to 0
ISky::GetSky()->GetLight()->SetLightDir(float4(dir.SafeNormalize(), intensity));
sunLighting->SetUpdated();
eventHandler.SunChanged();
return 0;
}

Expand Down
4 changes: 1 addition & 3 deletions rts/Rendering/Env/GrassDrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void CGrassDrawer::EnableShader(const GrassShaderProgram type) {
grassShader->SetUniform3v("ambientLightColor", &sunLighting->modelAmbientColor.x);
grassShader->SetUniform3v("diffuseLightColor", &sunLighting->modelDiffuseColor.x);
grassShader->SetUniform3v("specularLightColor", &sunLighting->modelSpecularColor.x);
grassShader->SetUniform3v("sunDir", &mapInfo->light.sunDir.x);
grassShader->SetUniform3v("sunDir", &ISky::GetSky()->GetLight()->GetLightDir().x);
}


Expand Down Expand Up @@ -1062,5 +1062,3 @@ void CGrassDrawer::UnsyncedHeightMapUpdate(const SRectangle& rect)
}
}
}


Loading