ShaderNodes: Add TextureEdit dialog

This commit is contained in:
Jérôme Leclercq
2020-07-04 22:52:17 +02:00
parent 33d94c05f3
commit 5164294bec
11 changed files with 200 additions and 17 deletions

View File

@@ -11,12 +11,15 @@ PreviewValues QuadPreview::GetPreview(InputRole role, std::size_t roleIndex) con
return dummy;
}
PreviewValues uv(128, 128);
PreviewValues uv(128, 128);
for (std::size_t y = 0; y < 128; ++y)
float invWidth = 1.f / uv.GetWidth();
float invHeight = 1.f / uv.GetHeight();
for (std::size_t y = 0; y < uv.GetHeight(); ++y)
{
for (std::size_t x = 0; x < 128; ++x)
uv(x, y) = Nz::Vector4f(x / 128.f, y / 128.f, 0.f, 1.f);
for (std::size_t x = 0; x < uv.GetWidth(); ++x)
uv(x, y) = Nz::Vector4f(x * invWidth, y * invHeight, 0.f, 1.f);
}
return uv;