Skip to content

Commit

Permalink
[lighiting] fixed an issue where there was a circle in the sky (inclu…
Browse files Browse the repository at this point in the history
…ding some other minor fixes)
  • Loading branch information
PanosK92 committed Oct 28, 2024
1 parent 5c52885 commit 5d963f1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions data/shaders/common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ static const float PI4 = 12.5663706f;
static const float INV_PI = 0.31830988f;
static const float PI_HALF = PI * 0.5f;
static const float FLT_MIN = 0.00000001f;
static const float FLT_MAX_10 = 511.0f;
static const float FLT_MAX_11 = 1023.0f;
static const float FLT_MAX_14 = 8191.0f;
static const float FLT_MAX_16 = 32767.0f;
static const float FLT_MAX_16U = 65535.0f;
static const float RPC_9 = 0.11111111111f;
Expand Down
4 changes: 2 additions & 2 deletions data/shaders/light.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ void main_cs(uint3 thread_id : SV_DispatchThreadID)
}

// mulitple ligts can go through this shader, so we accumulate the results
/* diffuse */ tex_uav[thread_id.xy] += float4(light_diffuse * light.radiance + light_subsurface, 1.0f);
/* specular */ tex_uav2[thread_id.xy] += float4(light_specular * light.radiance, 1.0f);
/* diffuse */ tex_uav[thread_id.xy] += float4(light_diffuse * light.radiance + light_subsurface, 0.0f);
/* specular */ tex_uav2[thread_id.xy] += float4(light_specular * light.radiance, 0.0f);
/* shadow */ tex_uav3[thread_id.xy] = saturate(tex_uav3[thread_id.xy] - (1.0f - shadow.a));
/* volumetric */ tex_uav4[thread_id.xy] += float4(volumetric_fog, 1.0f);
}
4 changes: 2 additions & 2 deletions data/shaders/light_composition.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ void main_cs(uint3 thread_id : SV_DispatchThreadID)
if (surface.is_sky())
{
light_emissive = tex_environment.SampleLevel(samplers[sampler_bilinear_clamp], direction_sphere_uv(surface.camera_to_pixel), 0).rgb;
alpha = 1.0f;
distance_from_camera = FLT_MAX_10;
alpha = 0.0f;
distance_from_camera = FLT_MAX_16;
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions editor/Widgets/TitleBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace
if (!show_about_window)
return;

vector<string> comma_seperated_contributors = comma_seperate_contributors(contributors);
static vector<string> comma_seperated_contributors = comma_seperate_contributors(contributors);

static const string window_title = "Spartan " + to_string(sp_info::version_major) + "." + to_string(sp_info::version_minor) + "." + to_string(sp_info::version_revision);
const ImGuiTableFlags table_flags = ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit;
Expand Down Expand Up @@ -178,10 +178,10 @@ namespace
"copies or substantial portions of the Software."
"\n\n"
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, "
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.";

ImGui::Separator();
Expand Down
2 changes: 1 addition & 1 deletion runtime/Core/Debugging.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace Spartan
inline static bool m_gpu_assisted_validation_enabled = false; // gpu-based validation, significant cpu and gpu cost
inline static bool m_breadcrumbs_enabled = false; // breadcrumbs: tracks gpu crashes and writes info into breadcrumbs.txt, minimal overhead - will be ignored for non-amd gpus
inline static bool m_logging_to_file_enabled = false; // logs to file, high cpu cost due to disk i/o
inline static bool m_renderdoc_enabled = true; // integrates renderdoc, high cpu overhead from api wrapping
inline static bool m_renderdoc_enabled = false; // integrates renderdoc, high cpu overhead from api wrapping
inline static bool m_gpu_marking_enabled = true; // gpu markers for debugging, no performance impact
inline static bool m_gpu_timing_enabled = true; // measures gpu timings, negligible cost
inline static bool m_shader_optimization_enabled = true; // enables shader optimizations, high cost when off
Expand Down
8 changes: 4 additions & 4 deletions runtime/Rendering/Renderer_Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ namespace Spartan
pso.render_target_color_textures[2] = tex_material;
pso.render_target_color_textures[3] = tex_velocity;
pso.render_target_depth_texture = tex_depth;
pso.clear_color[0] = is_transparent_pass ? rhi_color_load : Color::standard_black;
pso.clear_color[1] = is_transparent_pass ? rhi_color_load : Color::standard_black;
pso.clear_color[2] = is_transparent_pass ? rhi_color_load : Color::standard_black;
pso.clear_color[3] = is_transparent_pass ? rhi_color_load : Color::standard_black;
pso.clear_color[0] = is_transparent_pass ? rhi_color_load : Color::standard_transparent;
pso.clear_color[1] = is_transparent_pass ? rhi_color_load : Color::standard_transparent;
pso.clear_color[2] = is_transparent_pass ? rhi_color_load : Color::standard_transparent;
pso.clear_color[3] = is_transparent_pass ? rhi_color_load : Color::standard_transparent;
cmd_list->SetIgnoreClearValues(false);
cmd_list->SetPipelineState(pso);

Expand Down

0 comments on commit 5d963f1

Please sign in to comment.