Skip to content

Commit

Permalink
Updated spdlog, Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorton06 committed Sep 5, 2023
1 parent edf7269 commit e3f1e1d
Show file tree
Hide file tree
Showing 163 changed files with 14,804 additions and 6,002 deletions.
2 changes: 1 addition & 1 deletion Editor/Source/ImGUIConsoleSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Lumos
spdlog::memory_buf_t formatted;
spdlog::sinks::base_sink<Mutex>::formatter_->format(msg, formatted);
std::string source = fmt::format("File : {0} | Function : {1} | Line : {2}", msg.source.filename, msg.source.funcname, msg.source.line);
const auto time = fmt::localtime(msg.time);
const auto time = fmt::localtime(std::chrono::system_clock::to_time_t(msg.time));
auto processed = fmt::format("{:%H:%M:%S}", time);

auto message = CreateSharedPtr<ConsolePanel::Message>(fmt::to_string(formatted), GetMessageLevel(msg.level), source, static_cast<int>(msg.thread_id), processed);
Expand Down
12 changes: 6 additions & 6 deletions Editor/Source/InspectorPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,13 @@ end
if(ImGuiUtilities::Property("Fov", fov, 1.0f, 120.0f))
camera.SetFOV(fov);

float near = camera.GetNear();
if(ImGuiUtilities::Property("Near", near, 0.0f, 10.0f))
camera.SetNear(near);
float n = camera.GetNear();
if(ImGuiUtilities::Property("Near", n, 0.0f, 10.0f))
camera.SetNear(n);

float far = camera.GetFar();
if(ImGuiUtilities::Property("Far", far, 10.0f, 10000.0f))
camera.SetFar(far);
float f = camera.GetFar();
if(ImGuiUtilities::Property("Far", f, 10.0f, 10000.0f))
camera.SetFar(f);

float scale = camera.GetScale();
if(ImGuiUtilities::Property("Scale", scale, 0.0f, 1000.0f))
Expand Down
Binary file modified Lumos/Assets/Shaders/CompiledSPV/ForwardPBR.frag.spv
Binary file not shown.
2,934 changes: 1,470 additions & 1,464 deletions Lumos/Assets/Shaders/CompiledSPV/Headers/ForwardPBRfragspv.hpp

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Lumos/Assets/Shaders/ForwardPBR.frag
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ void main()
material.Roughness = sqrt(filteredRoughness2);
}

material.Roughness = clamp(material.Roughness, MIN_ROUGHNESS, 1.0);

vec3 wsPos = VertexOutput.Position.xyz;
material.View = normalize(ubo.cameraPosition.xyz - wsPos);
material.NDotV = max(dot(material.Normal, material.View), 1e-4);
Expand Down
4 changes: 2 additions & 2 deletions Lumos/Assets/Shaders/PBR.glslh
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ float distribution(float roughness, float NoH, const vec3 h, const vec3 normal)

float visibility(float roughness, float NoV, float NoL) {
#if QUALITY_LOW
return V_SmithGGXCorrelated_Fast(roughness, NoV, NoL);
return V_SmithGGXCorrelatedFast(roughness, NoV, NoL);
#else
return V_SmithGGXCorrelated(roughness, NoV, NoL);
#endif
}

vec3 fresnel(const vec3 f0, float LoH) {
#if QUALITY_LOW
return F_Schlick(f0, LoH); // f90 = 1.0
return F_Schlick(LoH, f0); // f90 = 1.0
#else
float f90 = saturate(dot(f0, vec3(50.0 * 0.33)));
return F_Schlick(f0, f90, LoH);
Expand Down
109 changes: 109 additions & 0 deletions Lumos/External/spdlog/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 140
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
IndentPPDirectives: AfterHash
...

54 changes: 54 additions & 0 deletions Lumos/External/spdlog/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Checks: 'cppcoreguidelines-*,
performance-*,
modernize-*,
google-*,
misc-*
cert-*,
readability-*,
clang-analyzer-*,
-performance-unnecessary-value-param,
-modernize-use-trailing-return-type,
-google-runtime-references,
-misc-non-private-member-variables-in-classes,
-readability-braces-around-statements,
-google-readability-braces-around-statements,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-readability-magic-numbers,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-avoid-c-arrays,
-modernize-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-readability-named-parameter,
-cert-env33-c
'


WarningsAsErrors: ''
HeaderFilterRegex: '*spdlog/[^f].*'
AnalyzeTemporaryDtors: false
FormatStyle: none

CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'

Loading

0 comments on commit e3f1e1d

Please sign in to comment.