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

This commit is contained in:
2019-10-11 14:27:13 +00:00
parent a8d5bbf1ab
commit ca3fe6e788
4 changed files with 1106 additions and 1108 deletions

View File

@@ -228,9 +228,9 @@ void setUniformLight(QOpenGLShaderProgram * prog, Light * light, QString ulightn
if (!prog) return;
if (!prog->isLinked()) return;
QMatrix4x4 m = mat * light->worldTransform();
QVector4D pos(0, 0, 0, 1.), dir(light->direction);//, dir0(light->dir0), dir1(light->dir1);
QVector4D pos(0, 0, 0, 1.), dir(light->direction, 1);//, dir0(light->dir0), dir1(light->dir1);
pos = m * pos;
dir = (mat * dir).normalized();
dir = ((m * dir) - pos).normalized();
float ang_start = light->angle_start / 2.f, ang_end = light->angle_end / 2.f;
if (light->light_type == Light::Omni)
ang_start = ang_end = 180.;

View File

@@ -14,8 +14,12 @@
<string>QGLView converter</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
@@ -433,7 +437,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>294</width>
<width>358</width>
<height>737</height>
</rect>
</property>
@@ -1058,7 +1062,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>333</width>
<width>397</width>
<height>853</height>
</rect>
</property>
@@ -1117,12 +1121,6 @@
</item>
</layout>
</widget>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="GLWidget" name="view">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">

View File

@@ -342,7 +342,7 @@ void RendererDeferredShading::renderScene() {
shader_ssr_merge->setUniformValue("tg1", 1);
shader_ssr_merge->setUniformValue("ts", 2);
fbo_out.setWriteBuffer(ri);
glDrawQuad(shader_ssr_blur);
glDrawQuad(shader_ssr_merge);
wi = ri;
ri = 1 - ri;
//piSwap<int>(wi, ri);

View File

@@ -41,7 +41,7 @@ void calcLight(in int index, in vec3 n, in vec3 v, in vec4 v2) {
float scos = max(dot(-ldir, qgl_Light[index].direction.xyz), 0.);
spot *= scos * step(qgl_Light[index].endAngleCos, scos);
spot *= smoothstep(qgl_Light[index].endAngleCos, qgl_Light[index].startAngleCos, scos);
lwdir = mat3(mat_viewi) * qgl_Light[index].direction.xyz;
//lwdir = /*mat3(mat_viewi) * */qgl_Light[index].direction.xyz;
//bn = normalize(cross(lwdir, vec3(1, 0, 0)));
//bn2 = normalize(cross(lwdir, bn));
float ds = ldist/200.;//max(abs(sdist) / 5000, 0.02);