History

Remove debug/tweak sampler

Atlante45 committed 11 years ago

Commit ca529e41 parent 12d75482 files · +8 −54Browse files

Showing the changes to libraries/render-utils/src/TextRenderer3D.cpp (1 of 2 files). Show all

Unified · Split

libraries/render-utils/src/TextRenderer3D.cpp+3−50
@@ -106,29 +106,6 @@ struct QuadBuilder { · 105 unmodified lines
106106
107107 };
108108
109−QDebug operator<<(QDebug debug, glm::vec2& value) {
110− debug << value.x << value.y;
111− return debug;
112−}
113−
114−QDebug operator<<(QDebug debug, glm::vec3& value) {
115− debug << value.x << value.y << value.z;
116− return debug;
117−}
118−
119−QDebug operator<<(QDebug debug, TextureVertex& value) {
120− debug << "Pos:" << value.pos << ", Tex:" << value.tex;
121− return debug;
122−}
123−
124−QDebug operator<<(QDebug debug, QuadBuilder& value) {
125− debug << '\n' << value.vertices[0]
126− << '\n' << value.vertices[1]
127− << '\n' << value.vertices[2]
128− << '\n' << value.vertices[3];
129− return debug;
130−}
131−
132109 class Font3D {
133110 public:
134111 Font3D();
@@ -339,11 +316,7 @@ void Font3D::read(QIODevice& in) { · 204 unmodified lines
339316 _glyphs[g.c] = g;
340317 };
341318
342− qDebug() << _family << "size" << image.size();
343− qDebug() << _family << "format" << image.format();
344319 image = image.convertToFormat(QImage::Format_RGBA8888);
345− qDebug() << _family << "size" << image.size();
346− qDebug() << _family << "format" << image.format();
347320
348321 gpu::Element formatGPU = gpu::Element(gpu::VEC3, gpu::UINT8, gpu::RGB);
349322 gpu::Element formatMip = gpu::Element(gpu::VEC3, gpu::UINT8, gpu::RGB);
@@ -352,7 +325,7 @@ void Font3D::read(QIODevice& in) { · 2 unmodified lines
352325 formatMip = gpu::Element(gpu::VEC4, gpu::UINT8, gpu::BGRA);
353326 }
354327 _texture = gpu::TexturePointer(gpu::Texture::create2D(formatGPU, image.width(), image.height(),
355− gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR)));
328+ gpu::Sampler(gpu::Sampler::FILTER_MIN_POINT_MAG_LINEAR)));
356329 _texture->assignStoredMip(0, formatMip, image.byteCount(), image.constBits());
357330 _texture->autoGenerateMips(-1);
358331 }
@@ -373,25 +346,6 @@ void Font3D::setupGPU() { · 14 unmodified lines
373346 _outlineLoc = program->getUniforms().findLocation("Outline");
374347 _colorLoc = program->getUniforms().findLocation("Color");
375348
376−
377− auto f = [&] (QString str, const gpu::Shader::SlotSet& set) {
378− if (set.size() == 0) {
379− return;
380− }
381− qDebug() << str << set.size();
382− for (auto slot : set) {
383− qDebug() << " " << QString::fromStdString(slot._name) << slot._location;
384− }
385− };
386− f("getUniforms:", program->getUniforms());
387− f("getBuffers:", program->getBuffers());
388− f("getTextures:", program->getTextures());
389− f("getSamplers:", program->getSamplers());
390− f("getInputs:", program->getInputs());
391− f("getOutputs:", program->getOutputs());
392−
393− qDebug() << "Texture:" << _texture.get();
394−
395349 gpu::StatePointer state = gpu::StatePointer(new gpu::State());
396350 state->setCullMode(gpu::State::CULL_BACK);
397351 state->setDepthTest(true, true, gpu::LESS_EQUAL);
@@ -404,8 +358,7 @@ void Font3D::setupGPU() { · 6 unmodified lines
404358 static const int OFFSET = offsetof(TextureVertex, tex);
405359 assert(OFFSET == sizeof(glm::vec2));
406360 assert(sizeof(glm::vec2) == 2 * sizeof(float));
407− assert(sizeof(glm::vec3) == 3 * sizeof(float));
408− assert(sizeof(TextureVertex) == sizeof(glm::vec2) + sizeof(glm::vec2));
361+ assert(sizeof(TextureVertex) == 2 * sizeof(glm::vec2));
409362 assert(sizeof(QuadBuilder) == 4 * sizeof(TextureVertex));
410363
411364 // Setup rendering structures
@@ -440,7 +393,7 @@ void Font3D::drawString(gpu::Batch& batch, float x, float y, const QString& str, · 28 unmodified lines
440393 }
441394 if (isNewLine || forceNewLine) {
442395 // Character return, move the advance to a new line
443− advance = glm::vec2(0.0f, advance.y - _rowHeight);
396+ advance = glm::vec2(x, advance.y - _rowHeight);
444397
445398 if (isNewLine) {
446399 // No need to draw anything, go directly to next token

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t