git-svn-id: svn://db.shs.com.ru/libs@644 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -193,26 +193,31 @@ void RendererService::fillSpotObjects() {
|
||||
Object o;
|
||||
cur_objects.clear();
|
||||
cur_aims.clear();
|
||||
cur_lines.clear();
|
||||
double scl = 1.;
|
||||
QVector<QVector3D> & lv (line_mesh_f->vertices ());
|
||||
QVector<QVector3D> & ln (line_mesh_f->normals ());
|
||||
QVector<QVector2D> & lt (line_mesh_f->texcoords ());
|
||||
QVector< Vector2i> & lind(line_mesh_f->indicesLines());
|
||||
lv.clear();
|
||||
foreach (Light * l, ll) {
|
||||
QMatrix4x4 m;
|
||||
m = invariantSizeMatrix(l->worldPos(), &scl) * parentRotationMatrix(l);
|
||||
m = invariantSizeMatrix(l->worldPos()) * parentRotationMatrix(l);
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
o.object_id = l->id_;
|
||||
cur_objects << o;
|
||||
|
||||
QMatrix4x4 sm;
|
||||
sm.scale(1, 1, l->distance() / scl);
|
||||
m = m * sm;
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
//cur_lines << o;
|
||||
lv << l->worldPos() << l->worldAim();
|
||||
|
||||
m = invariantSizeMatrix(l->worldAim());
|
||||
m.transposed().copyDataTo(o.modelmatrix);
|
||||
o.object_id = l->id_ + 1;
|
||||
cur_aims << o;
|
||||
}
|
||||
ln.resize(lv.size());
|
||||
lt.resize(lv.size());
|
||||
lind.resize(lv.size() / 2);
|
||||
for (int i = 0; i < lind.size(); ++i) {
|
||||
lind[i] = Vector2i(i*2, i*2 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -348,12 +353,6 @@ void RendererService::drawLightsFrame(QColor color) {
|
||||
box_mesh_f->loadSelections(v, rs.cur_selections_);
|
||||
box_mesh_f->draw(v, cur_aims.size());
|
||||
|
||||
setObjectsColor(cur_lines, color);
|
||||
line_mesh_f->loadObjects(v, cur_lines);
|
||||
r->fillSelectionsBuffer(rs.cur_selections_, light2objectList(v->scene_->lights_used.value(Light::Cone)));
|
||||
line_mesh_f->loadSelections(v, rs.cur_selections_);
|
||||
line_mesh_f->draw(v, cur_lines.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -372,12 +371,11 @@ void RendererService::renderService() {
|
||||
f->glEnable(GL_MULTISAMPLE);
|
||||
glEnableDepth();
|
||||
f->glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glDisable(GL_CULL_FACE);
|
||||
if (r->bindShader(Renderer::srServiceFrame, &prog)) {
|
||||
prog->setUniformValue("qgl_ProjMatrix", r->view->camera()->projectionMatrix(r->view->aspect));
|
||||
|
||||
/// lights
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
glDisable(GL_CULL_FACE);
|
||||
r->setUniformCamera(prog, r->view->camera());
|
||||
|
||||
prog->setUniformValue("line_width", 2.f);
|
||||
@@ -387,10 +385,16 @@ void RendererService::renderService() {
|
||||
prog->setUniformValue("z_offset", -1.E-2f);
|
||||
drawLightsFrame(Qt::black);
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
}
|
||||
if (r->bindShader(Renderer::srServiceLine, &prog)) {
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
r->setUniformCamera(prog, r->view->camera());
|
||||
line_object.color = QColor2QVector(Qt::white);
|
||||
line_mesh_f->loadObject(f, line_object);
|
||||
line_mesh_f->draw(f, 1);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
}
|
||||
glEnable(GL_CULL_FACE);
|
||||
if (r->bindShader(Renderer::srServiceFill, &prog)) {
|
||||
r->setUniformCamera(prog, r->view->camera());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user