-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support for ray casting against scene * Added text component * Added material edit panel * Fixed a bunch of issues * Many adjustments and bug fixes * Forgot to save files * Improved content browser * New icons * Some fixes * Added "light" mode * Make content browser fully functioning * Light component panel can be used to change the shadow now * Saved scene window settings * Fix build issues * Fix code smell
- Loading branch information
Showing
139 changed files
with
3,389 additions
and
1,393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#define SHADOWS | ||
#define SHADOW_FILTER_7x7 | ||
#define SHADOW_CASCADE_BLENDING | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,84 @@ | ||
layout (location = 0) out vec4 colorFS; | ||
#include <globals.hsh> | ||
|
||
layout (location=0) out vec4 colorFS; | ||
|
||
#ifdef TEXT_3D | ||
layout (location=1) out vec2 velocityFS; | ||
#endif | ||
|
||
layout(location=0) in vec3 texCoordVS; | ||
layout(location=1) in vec2 screenPositionVS; | ||
#ifdef TEXT_3D | ||
layout(location=2) in vec3 ndcCurrentVS; | ||
layout(location=3) in vec3 ndcLastVS; | ||
#endif | ||
|
||
layout(set = 3, binding = 0) uniform sampler2DArray glyphsTexture; | ||
|
||
layout(set = 3, binding = 3, std140) uniform UniformBuffer { | ||
mat4 pMatrix; | ||
#ifdef TEXT_3D | ||
layout(push_constant) uniform constants { | ||
vec4 position; | ||
vec4 right; | ||
vec4 down; | ||
vec4 characterColor; | ||
vec4 outlineColor; | ||
vec2 renderHalfSize; | ||
float textScale; | ||
float outlineScale; | ||
float edgeValue; | ||
float smoothness; | ||
} pushConstants; | ||
#else | ||
layout(push_constant) uniform constants { | ||
vec4 clipArea; | ||
vec4 blendArea; | ||
vec4 textColor; | ||
vec4 characterColor; | ||
vec4 outlineColor; | ||
vec2 textOffset; | ||
vec2 renderArea; | ||
float textScale; | ||
float outlineScale; | ||
float edgeValue; | ||
float smoothness; | ||
} uniforms; | ||
} pushConstants; | ||
#endif | ||
|
||
void main() { | ||
|
||
colorFS = vec4(0.0); | ||
|
||
if (screenPositionVS.x < uniforms.clipArea.x || | ||
screenPositionVS.y < uniforms.clipArea.y || | ||
screenPositionVS.x > uniforms.clipArea.x + uniforms.clipArea.z || | ||
screenPositionVS.y > uniforms.clipArea.y + uniforms.clipArea.w) | ||
#ifndef TEXT_3D | ||
if (screenPositionVS.x < pushConstants.clipArea.x || | ||
screenPositionVS.y < pushConstants.clipArea.y || | ||
screenPositionVS.x > pushConstants.clipArea.x + pushConstants.clipArea.z || | ||
screenPositionVS.y > pushConstants.clipArea.y + pushConstants.clipArea.w) | ||
discard; | ||
#endif | ||
|
||
float intensity = textureLod(glyphsTexture, texCoordVS, 0).r; | ||
float smoothing = uniforms.smoothness * fwidth(intensity); | ||
float smoothing = pushConstants.smoothness * fwidth(intensity); | ||
|
||
float outlineFactor = smoothstep(uniforms.edgeValue - smoothing, | ||
uniforms.edgeValue + smoothing, intensity); | ||
colorFS = mix(uniforms.outlineColor, uniforms.textColor, outlineFactor); | ||
float outlineFactor = smoothstep(pushConstants.edgeValue - smoothing, | ||
pushConstants.edgeValue + smoothing, intensity); | ||
colorFS = mix(pushConstants.outlineColor, pushConstants.characterColor, outlineFactor); | ||
|
||
float mixDistance = mix(uniforms.edgeValue, 0.0, uniforms.outlineScale); | ||
float mixDistance = mix(pushConstants.edgeValue, 0.0, pushConstants.outlineScale); | ||
float alpha = smoothstep(mixDistance - smoothing, mixDistance + smoothing, intensity); | ||
|
||
colorFS = uniforms.outlineScale > 0.0 ? vec4(colorFS.rgb, colorFS.a * alpha) : | ||
vec4(uniforms.textColor.rgb, uniforms.textColor.a * alpha); | ||
colorFS = pushConstants.outlineScale > 0.0 ? vec4(colorFS.rgb, colorFS.a * alpha) : | ||
vec4(pushConstants.characterColor.rgb, pushConstants.characterColor.a * alpha); | ||
|
||
#ifdef TEXT_3D | ||
if (colorFS.a < 0.5) | ||
discard; | ||
|
||
vec2 ndcL = ndcLastVS.xy / ndcLastVS.z; | ||
vec2 ndcC = ndcCurrentVS.xy / ndcCurrentVS.z; | ||
|
||
ndcL -= globalData.jitterLast; | ||
ndcC -= globalData.jitterCurrent; | ||
|
||
velocityFS = (ndcL - ndcC) * 0.5; | ||
#endif | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "UiElements.h" | ||
|
||
namespace Atlas::ImguiExtension { | ||
|
||
void UIElements::TexturePreview(Ref<ImguiWrapper>& wrapper, const Texture::Texture2D& texture) { | ||
|
||
auto lineHeight = ImGui::GetTextLineHeightWithSpacing(); | ||
auto set = wrapper->GetTextureDescriptorSet(texture); | ||
ImGui::Image(set, ImVec2(lineHeight, lineHeight)); | ||
|
||
if (ImGui::IsItemHovered() && ImGui::BeginItemTooltip()) { | ||
ImGui::Image(set, ImVec2(lineHeight * 8.0f, lineHeight * 8.0f)); | ||
ImGui::EndTooltip(); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <imgui.h> | ||
|
||
#include "System.h" | ||
#include "ImguiWrapper.h" | ||
#include "texture/Texture2D.h" | ||
|
||
namespace Atlas::ImguiExtension { | ||
|
||
class UIElements { | ||
|
||
public: | ||
static void TexturePreview(Ref<ImguiWrapper>& wrapper, const Texture::Texture2D& texture); | ||
|
||
}; | ||
|
||
} |
Oops, something went wrong.