Skip to content

Commit

Permalink
[Rendering] Calibrated some lighting parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Oct 21, 2023
1 parent 6a5b273 commit 507bf1b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/shaders/light_image_based.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ float4 mainPS(Pixel_PosUv input) : SV_TARGET
// try to compute some sort of ambient light that makes sense
float3 light_ambient = 1.0f;
{
light_ambient = buffer_light.intensity_range_angle_bias.x * 0.2f * surface.occlusion;
light_ambient = buffer_light.intensity_range_angle_bias.x * 0.1f * surface.occlusion;
}

// compute specular energy
Expand Down
4 changes: 0 additions & 4 deletions runtime/Rendering/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ namespace Spartan
SetOption(Renderer_Option::Debug_Lights, 1.0f);
SetOption(Renderer_Option::Debug_Physics, 0.0f);
SetOption(Renderer_Option::Debug_PerformanceMetrics, 1.0f);
// Buggy or unused options
//SetOption(Renderer_Option::PaperWhite, 150.0f); // nits
//SetOption(RendererOption::DepthOfField, 1.0f); // this is depth of field from ALDI, so until I improve it, it should be disabled by default.
//SetOption(RendererOption::VolumetricFog, 1.0f); // disable by default because it's not that great, I need to do it with a voxelised approach.

// resources
CreateConstantBuffers();
Expand Down
2 changes: 1 addition & 1 deletion runtime/World/Components/Light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ namespace Spartan

// This magic values are chosen empirically based on how the lights
// types in the LightIntensity enum should look in the engine
const float magic_value_a = 50.0f;
const float magic_value_a = 100.0f;
const float magic_value_b = 0.025f;

// convert lumens to power (in watts) assuming all light is at 555nm
Expand Down
2 changes: 1 addition & 1 deletion runtime/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ namespace Spartan
{
Vector3 camera_position = Vector3(8.7844f, 1.5f, -4.1412f);
Vector3 camera_rotation = Vector3(7.4f, -65.5f, 0.0f);
create_default_world_common(camera_position, camera_rotation, LightIntensity::sky_sunlight_morning_evening, "project\\music\\riders_on_the_storm_fredwreck_remix.mp3");
create_default_world_common(camera_position, camera_rotation, LightIntensity::sky_sunlight_noon, "project\\music\\riders_on_the_storm_fredwreck_remix.mp3");

// environment
{
Expand Down

0 comments on commit 507bf1b

Please sign in to comment.