git-svn-id: svn://db.shs.com.ru/libs@54 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -52,7 +52,7 @@ const char qgl_uniform[] =
|
||||
"uniform mat4 qgl_ModelViewProjectionMatrixInverseTranspose;\n";
|
||||
|
||||
const char qgl_structs[] =
|
||||
"const int qgl_MaxLights = 16;\n"
|
||||
"const int qgl_MaxLights = 8;\n"
|
||||
"struct QGLLight {\n"
|
||||
" vec4 color;\n"
|
||||
" vec4 position;\n"
|
||||
@@ -65,7 +65,7 @@ const char qgl_structs[] =
|
||||
" float constantAttenuation;\n"
|
||||
" float linearAttenuation;\n"
|
||||
" float quadraticAttenuation;\n"
|
||||
" sampler2D shadow;\n"
|
||||
" sampler2DShadow shadow;\n"
|
||||
" mat4 shadowMatrix;\n"
|
||||
"};\n"
|
||||
"struct QGLMap {\n"
|
||||
@@ -216,7 +216,7 @@ void setUniformLight(QGLShaderProgram * prog, Light * light, QString ulightn, co
|
||||
QMatrix4x4 m = mat * light->worldTransform();
|
||||
QVector4D pos(0, 0, 0, 1.), dir(light->direction);
|
||||
pos = m * pos;
|
||||
dir = (m * dir).normalized();
|
||||
dir = (mat * dir).normalized();
|
||||
double ang_start = light->angle_start / 2., ang_end = light->angle_end / 2.;
|
||||
if (light->light_type == Light::Omni)
|
||||
ang_start = ang_end = 180.;
|
||||
|
||||
Reference in New Issue
Block a user