mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Merge branch 'stats' of https://github.com/venkatn93/hifi into yellow
This commit is contained in:
commit
93303a02ec
2 changed files with 24 additions and 16 deletions
|
@ -2,8 +2,8 @@
|
||||||
// DrawStatus.cpp
|
// DrawStatus.cpp
|
||||||
// render/src/render
|
// render/src/render
|
||||||
//
|
//
|
||||||
// Created by Niraj Venkat on 5/21/15.
|
// Created by Niraj Venkat on 6/29/15.
|
||||||
// Copyright 20154 High Fidelity, Inc.
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
@ -162,11 +162,10 @@ void DrawStatus::run(const SceneContextPointer& sceneContext, const RenderContex
|
||||||
glm::vec4* itemStatus = reinterpret_cast<glm::vec4*> (_itemStatus->editData());
|
glm::vec4* itemStatus = reinterpret_cast<glm::vec4*> (_itemStatus->editData());
|
||||||
|
|
||||||
for (int i = 0; i < nbItems; i++) {
|
for (int i = 0; i < nbItems; i++) {
|
||||||
|
|
||||||
batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const GLfloat*) (itemAABox + i));
|
batch._glUniform3fv(_drawItemBoundPosLoc, 1, (const GLfloat*) (itemAABox + i));
|
||||||
batch._glUniform3fv(_drawItemBoundDimLoc, 1, ((const GLfloat*) (itemAABox + i)) + 3);
|
batch._glUniform3fv(_drawItemBoundDimLoc, 1, ((const GLfloat*) (itemAABox + i)) + 3);
|
||||||
|
|
||||||
batch.draw(gpu::LINE_STRIP, 13, 0);
|
batch.draw(gpu::LINES, 24, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
batch.setPipeline(getDrawItemStatusPipeline());
|
batch.setPipeline(getDrawItemStatusPipeline());
|
||||||
|
|
|
@ -20,22 +20,31 @@ uniform vec3 inBoundPos;
|
||||||
uniform vec3 inBoundDim;
|
uniform vec3 inBoundDim;
|
||||||
|
|
||||||
void main(void) {
|
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(0.0, 0.0, 0.0, 1.0),
|
||||||
vec4(1.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(1.0, 1.0, 0.0, 1.0),
|
||||||
vec4(0.0, 1.0, 0.0, 1.0),
|
vec4(0.0, 0.0, 1.0, 1.0),
|
||||||
vec4(0.0, 0.0, 0.0, 1.0),
|
|
||||||
vec4(1.0, 0.0, 0.0, 1.0),
|
|
||||||
vec4(1.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, 1.0, 1.0, 1.0),
|
||||||
vec4(0.0, 0.0, 1.0, 1.0),
|
vec4(1.0, 1.0, 1.0, 1.0)
|
||||||
vec4(0.0, 0.0, 0.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]];
|
||||||
|
|
||||||
pos.xyz = inBoundPos + inBoundDim * pos.xyz;
|
pos.xyz = inBoundPos + inBoundDim * pos.xyz;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue