git-svn-id: svn://db.shs.com.ru/libs@54 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-01 15:26:28 +00:00
parent 5ca76b651b
commit c8ceb3e328
13 changed files with 818 additions and 47 deletions

View File

@@ -233,10 +233,10 @@ void GLRendererBase::renderShadow(Light * l, QGLShaderProgram * prog, QMatrix4x4
Camera cam;
QVector3D wp = l->worldPos();
cam.setPos(wp);
cam.setAim(wp + (l->worldTransform() * QVector4D(l->direction)).toVector3D());
cam.setAim(wp + (/*l->worldTransform() */ QVector4D(l->direction)).toVector3D());
cam.setDepthStart(view.camera().depthStart());
cam.setDepthEnd(view.camera().depthEnd());
cam.setFOV(l->angle_end / 2.);
cam.setFOV(l->angle_end);
cam.apply(1.);
RenderingParameters rpl;
rpl.pass = GLObjectBase::Solid;
@@ -244,7 +244,11 @@ void GLRendererBase::renderShadow(Light * l, QGLShaderProgram * prog, QMatrix4x4
rpl.textures = rpl.light = rpl.fog = false;
rpl.view_matrix = getGLMatrix(GL_MODELVIEW_MATRIX);
rpl.proj_matrix = getGLMatrix(GL_PROJECTION_MATRIX);
l->shadow_matrix = mat * (rpl.proj_matrix * rpl.view_matrix);
QMatrix4x4 mbias;
mbias.scale(0.5, 0.5, 0.5);
mbias.translate(1., 1., 1.);
l->shadow_matrix = mbias*rpl.proj_matrix*rpl.view_matrix*mat;//;// * mbias;
//qDebug() << mbias;
//glPushMatrix();
renderSingleShadow(view.objects_, rpl);
//glPopMatrix();