move vec to generated

This commit is contained in:
Asuro
2025-03-30 19:45:48 +02:00
parent b006d14197
commit 052fc2cc07
16 changed files with 662 additions and 289 deletions

View File

@@ -1,6 +1,8 @@
#include "../Log.h"
#include "Dither.h"
using namespace Generated;
void DitherGen(DitherData& data, int32_t recursion)
{
data.Points[0] = {0.0f, 0.0f};
@@ -55,7 +57,7 @@ void DitherGen(DitherData& data, int32_t recursion)
{
Vec2 vec = point - data.Points[i];
Vec2 wrappedVec{bx::mod(vec.x + 0.5f, 1.0f) - 0.5f, bx::mod(vec.y + 0.5f, 1.0f) - 0.5f};
float curDist = wrappedVec.Magnitude();
float curDist = Magnitude(wrappedVec);
dist = bx::min(dist, curDist);
}

View File

@@ -463,7 +463,7 @@ namespace Game
mat.State = 0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_WRITE_Z | BGFX_STATE_DEPTH_TEST_LESS |
BGFX_STATE_CULL_CCW | BGFX_STATE_MSAA;
mat.Uniforms[Material::UTime] = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UDotColor] = bgfx::createUniform("u_testColor", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UDotColor] = bgfx::createUniform("u_dotColor", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UTexInfo] = bgfx::createUniform("u_texInfo", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UBaseColor] = bgfx::createUniform("u_baseColor", bgfx::UniformType::Vec4);
mat.ViewID = view;

View File

@@ -95,8 +95,6 @@ namespace Game
uint16_t MainViewID = 10;
float LastShaderLoadTime = 0.0f;
int32_t DitherRecursion = 1;
Vec4 DefaultBaseColor;
Vec4 DefaultTileColor;
public:
void Setup();