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

This commit is contained in:
2019-10-11 13:34:03 +00:00
parent 7aa7ead1d5
commit a36ef5eb1d
5 changed files with 189 additions and 44 deletions

View File

@@ -75,6 +75,7 @@ const char qgl_structs[] =
"struct QGLMap {\n"
" float offset;\n"
" float amount;\n"
" vec2 scale;\n"
" sampler2D map;\n"
"};\n"
"struct QGLMaterial {\n"
@@ -174,6 +175,7 @@ void setUniformMap(QOpenGLShaderProgram * prog, QString map_name, const Map & ma
if (!prog->isLinked()) return;
prog->setUniformValue(("qgl_Material." + map_name + ".offset").toLatin1().constData(), map.color_offset);
prog->setUniformValue(("qgl_Material." + map_name + ".amount").toLatin1().constData(), map.color_amount);
prog->setUniformValue(("qgl_Material." + map_name + ".scale").toLatin1().constData(), map.bitmap_scale);
prog->setUniformValue(("qgl_Material." + map_name + ".map").toLatin1().constData(), map.bitmap_id > 0 ? channel : def_channel);
}