-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tutorial 25] multiple rotating lights done
- Loading branch information
Showing
11 changed files
with
101 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,30 @@ | ||
<C-o> ::std:: | ||
<C-A-o> ::xrn:: | ||
<C-e> this-> | ||
<C-A-e> *this | ||
<C-u> ::std::vector | ||
<C-A-u> ::std::span | ||
<C-u> ::std::make_unique<>() | ||
<C-A-u> ::std::make_shared<>() | ||
<C-l> const | ||
<C-a-l> constexpr | ||
<C-c> static | ||
<C-g> [[ nodiscard ]] | ||
<C-f> noexcept | ||
<C-n> if () {<CR>}<Esc><Up>A | ||
<C-A-n> switch () {<CR>// case : break;<CR>default: break;<CR>} | ||
<C-t> for (const auto& elem : ) {<CR>} | ||
<C-A-t> for (auto i{ 0uz }; i < ; ++i) {<CR>} | ||
<C-d> while () {<CR>}<Esc><Up>A | ||
<C-b> <Esc>:call AppendNamespace()<CR> | ||
<C-x> ::std::cout << << ::std::endl; | ||
<C-A-x> ::std::cout << "" << ::std::endl; | ||
<C-k> auto&&... args | ||
<C-A-k> ::std::forward<decltype(args)>(args)... | ||
p :cnext | ||
P :cprevious | ||
y :cc | ||
Y :copen | ||
f :copen .build/errorFile | ||
F :cclose | ||
g :AsyncRun make hide_color=true |
This file was deleted.
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
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,21 +1,35 @@ | ||
#pragma once | ||
|
||
#include <Vksb/Component/Position.hpp> | ||
|
||
namespace vksb::component { | ||
|
||
struct PointLight { | ||
|
||
struct PushConstant { | ||
PushConstant() = default; | ||
PushConstant( | ||
const ::vksb::component::PointLight& pointLight, | ||
const ::vksb::component::Position& position | ||
) | ||
: color{ pointLight.color } | ||
, position{ position.get(), pointLight.radius } | ||
{} | ||
::glm::vec4 color; // w == intensity | ||
::glm::vec4 position; // w == radius | ||
}; | ||
|
||
PointLight( | ||
::glm::vec3 thatColor = ::glm::vec3{ 1.0f }, | ||
float intensity = 0.2f, | ||
::glm::vec3 color = ::glm::vec3{ 1.0f }, | ||
::glm::vec3 position = ::glm::vec3{ 0.0f }, | ||
float radius = 0.03f | ||
float thatRadius = 0.03f | ||
) | ||
: m_color{ color, intensity } | ||
, m_position{ position, radius } | ||
: color{ thatColor, intensity } | ||
, radius{ thatRadius } | ||
{} | ||
|
||
::glm::vec4 m_color; // w == intensity | ||
::glm::vec4 m_position; // w == radius | ||
// position is relative if a component::Position is contained | ||
::glm::vec4 color; // w == intensity | ||
float radius; | ||
}; | ||
|
||
} // namespace vksb::component |
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