Drawing full bounding box

This commit is contained in:
Niraj Venkat 2015-06-30 16:09:45 -07:00
parent 2f2d5815db
commit aa55de46c2
3 changed files with 55 additions and 75 deletions

View file

@ -88,7 +88,7 @@ void DrawStatus::run(const SceneContextPointer& sceneContext, const RenderContex
}
batch.setModelTransform(model);
batch.draw(gpu::LINE_STRIP, 13, 0);
batch.draw(gpu::LINES, 24, 0);
}
}

View file

@ -1,29 +0,0 @@
//
// Stats.h
// render/src/render
//
// Created by Niraj Venkat on 6/29/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_render_Stats_h
#define hifi_render_Stats_h
#include "DrawTask.h"
#include "gpu/Batch.h"
#include <PerfStat.h>
namespace render {
class DrawStats {
public:
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemIDsBounds& inItems);
typedef Job::ModelI<DrawStats, ItemIDsBounds> JobModel;
};
}
#endif // hifi_render_Stats_h

View file

@ -17,22 +17,31 @@
<$declareStandardTransform()$>
void main(void) {
const vec4 UNIT_BOX[13] = vec4[13](
const vec4 UNIT_BOX[8] = vec4[8](
vec4(0.0, 0.0, 0.0, 1.0),
vec4(1.0, 0.0, 0.0, 1.0),
vec4(0.0, 1.0, 0.0, 1.0),
vec4(1.0, 1.0, 0.0, 1.0),
vec4(0.0, 1.0, 0.0, 1.0),
vec4(0.0, 0.0, 0.0, 1.0),
vec4(1.0, 0.0, 0.0, 1.0),
vec4(0.0, 0.0, 1.0, 1.0),
vec4(1.0, 0.0, 1.0, 1.0),
vec4(0.0, 0.0, 1.0, 1.0),
vec4(0.0, 0.0, 0.0, 1.0),
vec4(0.0, 1.0, 0.0, 1.0),
vec4(0.0, 1.0, 1.0, 1.0),
vec4(0.0, 0.0, 1.0, 1.0),
vec4(0.0, 0.0, 0.0, 1.0)
vec4(1.0, 1.0, 1.0, 1.0)
);
vec4 pos = UNIT_BOX[gl_VertexID];
const int UNIT_BOX_LINE_INDICES[24] = int[24](
0, 1,
1, 3,
3, 2,
2, 0,
4, 5,
5, 7,
7, 6,
6, 4,
2, 6,
3, 7,
0, 4,
1, 5
);
vec4 pos = UNIT_BOX[UNIT_BOX_LINE_INDICES[gl_VertexID]];
// standard transform
TransformCamera cam = getTransformCamera();