Trying to fix shading
This commit is contained in:
@@ -21,7 +21,7 @@ struct Camera
|
||||
}
|
||||
Vector getCameraPosition() const
|
||||
{
|
||||
return cameraPos;
|
||||
return -viewMatrix[3];
|
||||
}
|
||||
void mouseMove(float deltaX, float deltaY);
|
||||
void mouseScroll(float x);
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
assert(_data != nullptr);
|
||||
for (size_type i = 0; i < size; ++i)
|
||||
{
|
||||
_data[i] = value;
|
||||
std::allocator_traits<allocator_type>::construct(allocator, &_data[i], value);
|
||||
}
|
||||
}
|
||||
constexpr explicit Array(size_type size, const allocator_type& alloc = allocator_type())
|
||||
@@ -147,9 +147,16 @@ public:
|
||||
{
|
||||
_data = allocateArray(size);
|
||||
assert(_data != nullptr);
|
||||
for (size_type i = 0; i < size; ++i)
|
||||
if constexpr (std::is_integral_v<T> || std::is_floating_point_v<T>)
|
||||
{
|
||||
std::allocator_traits<allocator_type>::construct(allocator, &_data[i]);
|
||||
std::memset(_data, 0, size * sizeof(T));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_type i = 0; i < size; ++i)
|
||||
{
|
||||
std::allocator_traits<allocator_type>::construct(allocator, &_data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
constexpr Array(std::initializer_list<T> init, const allocator_type& alloc = allocator_type())
|
||||
|
||||
@@ -418,7 +418,7 @@ Gfx::PDescriptorSet DescriptorPool::allocateDescriptorSet()
|
||||
{
|
||||
nextAlloc = new DescriptorPool(graphics, layout);
|
||||
}
|
||||
std::cout << "Out of descriptors, forwarding" << std::endl;
|
||||
//std::cout << "Out of descriptors, forwarding" << std::endl;
|
||||
return nextAlloc->allocateDescriptorSet();
|
||||
//throw std::logic_error("Out of descriptor sets");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ double Gfx::getCurrentFrameDelta()
|
||||
|
||||
void glfwKeyCallback(GLFWwindow* handle, int key, int, int action, int modifier)
|
||||
{
|
||||
if (key == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Window* window = (Window*)glfwGetWindowUserPointer(handle);
|
||||
window->keyPress((KeyCode)key, (InputAction)action, (KeyModifier)modifier);
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ std::string MulExpression::evaluate(Map<std::string, std::string>& varState) con
|
||||
{
|
||||
std::string varName = std::format("exp_{}", key);
|
||||
varState[key] = varName;
|
||||
return std::format("let {} = mul({}, {});\n", varName, varState[inputs.at("lhs").source], varState[inputs.at("rhs").source]);
|
||||
return std::format("let {} = {} * {};\n", varName, varState[inputs.at("lhs").source], varState[inputs.at("rhs").source]);
|
||||
}
|
||||
|
||||
void MulExpression::save(ArchiveBuffer& buffer) const
|
||||
|
||||
Reference in New Issue
Block a user