...
 
Commits (21)
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://qt.io/qt3dstudio/uia">
<assets initial="CoffeeMaker">
<presentation id="CoffeeMaker" src="CoffeeMaker.uip"/>
<presentation id="CoffeeMaker" src="presentations/CoffeeMaker.uip"/>
</assets>
<statemachine ref="#logic">
......
......@@ -15,20 +15,18 @@
void frag()
{
float radius = vig_radius;
vec4 origColor = texture2D_0(TexCoord);
vec2 uv = TexCoord.xy;
vec2 center = vec2(0.5);
vec4 bg = origColor;
uv *= 1.0 - uv.yx;
float vig = uv.x*uv.y * vig_strenght;
uv *= 1.0 - uv.yx;
float vig = uv.x * uv.y * vig_strenght;
vig = pow(vig, vig_radius);
vec4 vigmixcolor = vec4(vig_color,vig) * vec4(vig);
gl_FragColor = vec4(mix(origColor,vigmixcolor,1.0-vig));
vec4 vigColor = vec4(vig_color.xyz, vig) * vig;
gl_FragColor = mix(origColor, vigColor, 1.0 - vig);
}
]]></FragmentShader>
</Shader>
......
......@@ -10,7 +10,6 @@
<file alias="LightSlider.qml">qml/HomeAutom/LightSlider.qml</file>
<file alias="RoomLabel.qml">qml/HomeAutom/RoomLabel.qml</file>
<file alias="LightSwitch.qml">qml/HomeAutom/LightSwitch.qml</file>
<file>uip/houseStudio.uip</file>
<file>uip/maps/Ground.png</file>
<file>uip/maps/HouseGroundOpacitymap.png</file>
<file>uip/maps/HouseTexture.png</file>
......@@ -32,8 +31,6 @@
<file>uip/models/House/meshes/Windows.mesh</file>
<file>uip/models/House/House.import</file>
<file>uip/models/Light/Light.import</file>
<file>uip/House/meshes/house1.mesh</file>
<file>uip/House/meshes/roof1.mesh</file>
<file>uip/maps/BathroomLightmap.png</file>
<file>uip/maps/BedRoomLightmap.png</file>
<file>uip/maps/EntranceLightmap.png</file>
......@@ -51,5 +48,6 @@
<file>qml/imports/Style/qmldir</file>
<file>qml/imports/Style/Style.qml</file>
<file>uip/houseStudio.uia</file>
<file>uip/presentations/houseStudio.uip</file>
</qresource>
</RCC>
......@@ -12,7 +12,7 @@ KNX_BOARD {
CONFIG += c++11
}
QT += qml quick 3dstudioruntime2
QT += qml quick
CONFIG += resources_big
......
......@@ -59,7 +59,6 @@
#if defined(KNX_BACKEND)
#include "qmlknxdemo.h"
#endif
#include <q3dsruntimeglobal.h>
// Uncomment for 1280x900 window
//#define FIXEDWINDOW
......@@ -78,7 +77,15 @@ int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
#if defined(Q_OS_MACOS)
QSurfaceFormat openGLFormat;
openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
openGLFormat.setMajorVersion(4);
openGLFormat.setMinorVersion(1);
openGLFormat.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(openGLFormat);
#endif
// Define size variants for scaling
qreal refDpi = 96.;
......
......@@ -50,7 +50,7 @@
import QtQuick 2.8
import QtQuick.Controls 2.1
import QtStudio3D 2.0
import QtStudio3D.OpenGL 2.4
Item {
id: home
......@@ -220,7 +220,7 @@ Item {
}
}
onPresentationReady: {
onPresentationLoaded: {
home.studio3DPresentationReady();
}
}
......@@ -364,15 +364,18 @@ Item {
onRedColorChanged: {
home.red = redColor;
currentTempTarget.setValue(Qt.vector3d(redColor, home.green, home.blue));
if (currentTempTarget)
currentTempTarget.setValue(Qt.vector3d(redColor, home.green, home.blue));
}
onBlueColorChanged: {
home.blue = blueColor;
currentTempTarget.setValue(Qt.vector3d(home.red, home.green, blueColor));
if (currentTempTarget)
currentTempTarget.setValue(Qt.vector3d(home.red, home.green, blueColor));
}
onGreenColorChanged: {
home.green = greenColor;
currentTempTarget.setValue(Qt.vector3d(home.red, greenColor, home.blue));
if (currentTempTarget)
currentTempTarget.setValue(Qt.vector3d(home.red, greenColor, home.blue));
}
onEconomyChanged: {
......
<?xml version="1.0" encoding="UTF-8" ?>
<UIP Version="1" >
<Project Revision="1" >
<Graph >
<Group id="__import__root__" >
<Model id="Ground" name="Ground" orientation="Right Handed" position="-0.957248 -0.10826 -2.79746" rotation="0 -0 0" rotationorder="XYZr" scale="1.73739 1 1.00748" sourcepath=".\meshes\Ground.mesh#1" >
<Material id="phong1" name="phong1" blendmode="Normal" diffuse="0.233766 0.233766 0.233766" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="roof1" name="roof1" orientation="Right Handed" position="0 0 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\roof1.mesh#1" >
<Material id="BaseWall" name="BaseWall" blendmode="Normal" diffuse="0.552284 0.552284 0.552284" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="roof" name="roof" blendmode="Normal" diffuse="0.0609137 0.0609137 0.0609137" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
<Material id="lambert1" name="lambert1" blendmode="Normal" diffuse="1 1 1" emissivepower="0" opacity="100" specularamount="0" />
</Model>
<Group id="Group_HeatAreas" name="Group_HeatAreas" orientation="Right Handed" position="0 5.53285 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" >
<Model id="Heat_MasterBedroom" name="Heat_MasterBedroom" orientation="Right Handed" position="-6.01453 0.0613521 -9.90316" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_MasterBedroom.mesh#1" >
<Material id="masterbedroomheat" name="masterbedroomheat" blendmode="Normal" diffuse="0.15472 0.15096 0.14256" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_Entrance" name="Heat_Entrance" orientation="Right Handed" position="0.0827332 1.40091 -12.9964" rotation="8.53363 -0 0" rotationorder="XYZr" scale="0.852158 1 0.900558" sourcepath=".\meshes\Heat_Entrance.mesh#1" >
<Material id="entrance" name="entrance" blendmode="Normal" diffuse="0.519797 0.519797 0.519797" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_BedRoom" name="Heat_BedRoom" orientation="Right Handed" position="6.03439 1.73831 -10.6134" rotation="7.55792 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_BedRoom.mesh#1" >
<Material id="bedroom" name="bedroom" blendmode="Normal" diffuse="0.24488 0.388 0.46264" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_DressRoom" name="Heat_DressRoom" orientation="Right Handed" position="8.02201 2.41339 -5.07462" rotation="8.34257 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_DressRoom.mesh#1" >
<Material id="dressroom" name="dressroom" blendmode="Normal" diffuse="0.714721 0.714721 0.714721" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_Toilet" name="Heat_Toilet" orientation="Right Handed" position="3.90588 2.58136 -5.05141" rotation="5.57327 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_Toilet.mesh#1" >
<Material id="toilet" name="toilet" blendmode="Normal" diffuse="0.19208 0.24752 0.37672" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_StoreRoom" name="Heat_StoreRoom" orientation="Right Handed" position="2.97044 0.814303 -17.1022" rotation="8.02365 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_StoreRoom.mesh#1" >
<Material id="storeroom" name="storeroom" blendmode="Normal" diffuse="0.166497 0.166497 0.166497" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_Sauna" name="Heat_Sauna" orientation="Right Handed" position="-7.99717 0.0613521 7.72293" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_Sauna.mesh#1" >
<Material id="sauna1" name="sauna1" blendmode="Normal" diffuse="0.24984 0.24984 0.24984" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_BathRoom" name="Heat_BathRoom" orientation="Right Handed" position="-8.61282 1.1588 -1.06378" rotation="0 -0 0" rotationorder="XYZr" scale="1.04514 1 1" sourcepath=".\meshes\Heat_BathRoom.mesh#1" >
<Material id="bathroom" name="bathroom" blendmode="Normal" diffuse="0.4 0.4 0.4" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
<Model id="Heat_LivingRoom" name="Heat_LivingRoom" orientation="Right Handed" position="2.34465 3.80193 4.35739" rotation="7.88151 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Heat_LivingRoom.mesh#1" >
<Material id="livingroom" name="livingroom" blendmode="Normal" diffuse="0.24984 0.23336 0.16168" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" />
</Model>
</Group>
<Group id="Group_house" name="Group_house" orientation="Right Handed" position="0 0 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" >
<Model id="house1" name="house1" orientation="Right Handed" position="0 0 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\house1.mesh#1" >
<Material id="house2" name="house2" blendmode="Normal" diffuse="1 1 1" diffusemap="house2_diffusemap" emissivepower="0" opacity="100" specularamount="0" specularroughness="20" >
<Image id="house2_diffusemap" name="house2_diffusemap" sourcepath=".\maps\houseShape.png" />
</Material>
</Model>
</Group>
<Model id="Windows" name="Windows" orientation="Right Handed" position="0 0 -0" rotation="0 -0 0" rotationorder="XYZr" scale="1 1 1" sourcepath=".\meshes\Windows.mesh#1" >
<Material id="Window" name="Window" blendmode="Normal" diffuse="0.35152 0.66672 0.74704" emissivepower="0" opacity="100" specularamount="0" specularroughness="12.1818" />
</Model>
</Group>
</Graph>
<Import SrcFile="..\..\House\House.fbx" ImageDir="Images" MeshDir="Meshes" >
<Image >
<Source >.\houseShape.png</Source>
<Dest >.\maps\houseShape.png</Dest>
</Image>
<Mesh >
<Source >Heat_BathRoom</Source>
<Dest >.\meshes\Heat_BathRoom.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_Sauna</Source>
<Dest >.\meshes\Heat_Sauna.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_BedRoom</Source>
<Dest >.\meshes\Heat_BedRoom.mesh</Dest>
</Mesh>
<Mesh >
<Source >Ground</Source>
<Dest >.\meshes\Ground.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_Toilet</Source>
<Dest >.\meshes\Heat_Toilet.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_StoreRoom</Source>
<Dest >.\meshes\Heat_StoreRoom.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_LivingRoom</Source>
<Dest >.\meshes\Heat_LivingRoom.mesh</Dest>
</Mesh>
<Mesh >
<Source >house1</Source>
<Dest >.\meshes\house1.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_DressRoom</Source>
<Dest >.\meshes\Heat_DressRoom.mesh</Dest>
</Mesh>
<Mesh >
<Source >Windows</Source>
<Dest >.\meshes\Windows.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_MasterBedroom</Source>
<Dest >.\meshes\Heat_MasterBedroom.mesh</Dest>
</Mesh>
<Mesh >
<Source >roof1</Source>
<Dest >.\meshes\roof1.mesh</Dest>
</Mesh>
<Mesh >
<Source >Heat_Entrance</Source>
<Dest >.\meshes\Heat_Entrance.mesh</Dest>
</Mesh>
</Import>
</Project>
</UIP>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<application>
<assets initial="houseStudio">
<presentation id="houseStudio" src="houseStudio.uip"/>
<presentation id="houseStudio" src="presentations/houseStudio.uip"/>
<dataInput name="slideInput" type="String"/>
<dataInput name="lightEntrance" type="Ranged Number" min="0" max="100"/>
<dataInput name="lightBathRoom" type="Ranged Number" min="0" max="100"/>
......
......@@ -27,3 +27,6 @@ QML_DESIGNER_IMPORT_PATH =
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
DISTFILES += \
SimulationData.qml
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://qt.io/qt3dstudio/uia">
<assets initial="Presentation">
<!-- <presentation id="Presentation" src="presentations/Presentation.uip"/>-->
<presentation id="Presentation" src="Presentation_1_1.uip"/>
<presentation id="Presentation" src="presentations/Presentation.uip"/>
<dataInput metadata="" name="carSlide" type="String"/>
<dataInput metadata="" name="roadSpeed" type="Float"/>
</assets>
<statemachine ref="#logic">
<visual-states>
<state ref="Initial">
<enter>
<goto-slide rel="next" element="main:Scene"/>
</enter>
</state>
</visual-states>
</statemachine>
</application>
<MaterialData version="1.0">
<Property name="shaderlighting">None</Property>
<Property name="blendmode">Normal</Property>
<Property name="diffuse">0.8 0.8 0.8</Property>
<Property name="diffuse">1 1 1 1</Property>
<Property name="diffusemap"><![CDATA[./maps/road.jpg]]></Property>
<Property name="specularamount">0</Property>
<Property name="specularroughness">0</Property>
<Property name="opacity">100</Property>
<Property name="emissivecolor">1 1 1</Property>
<Property name="emissivecolor">1 1 1 1</Property>
<Property name="emissivepower">0</Property>
<Property name="bumpamount">0.5</Property>
<Property name="displaceamount">20</Property>
<Property name="translucentfalloff">1</Property>
<Property name="diffuselightwrap">0</Property>
<Property name="specularmodel">Default</Property>
<Property name="speculartint">1 1 1</Property>
<Property name="speculartint">1 1 1 1</Property>
<Property name="ior">1.5</Property>
<Property name="fresnelPower">0</Property>
<Property name="vertexcolors">True</Property>
<Property name="sourcepath"></Property>
<Property name="importid">Plane_Diffuse_Default</Property>
<Property name="importfile">../models/road/road.import</Property>
<Property name="type">Material</Property>
<Property name="name"><![CDATA[materials/Plane_Diffuse_Default]]></Property>
<Property name="path"><![CDATA[C:/dev/lowendcluster/LowEndCluster/Presentation/materials/Plane_Diffuse_Default.materialdef]]></Property>
<Property name="type">Material</Property>
<Property name="path"><![CDATA[/home/tomi/dev/qt3dstudio-demos/LowEndCluster/Presentation/materials/Plane_Diffuse_Default.materialdef]]></Property>
<TextureData name="diffusemap">
<Property name="scaleu">1</Property>
<Property name="scalev">1</Property>
......@@ -38,7 +38,7 @@
<Property name="sourcepath"><![CDATA[./maps/road.jpg]]></Property>
<Property name="importid"></Property>
<Property name="importfile"></Property>
<Property name="type">Image</Property>
<Property name="name"><![CDATA[Image]]></Property>
<Property name="type">Image</Property>
</TextureData>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="shaderlighting">None</Property>
<Property name="blendmode">Normal</Property>
<Property name="diffuse">1 1 1</Property>
<Property name="diffuse">1 1 1 1</Property>
<Property name="diffusemap"><![CDATA[./models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse.jpg]]></Property>
<Property name="specularamount">0</Property>
<Property name="specularroughness">0</Property>
<Property name="opacity">100</Property>
<Property name="emissivecolor">1 1 1</Property>
<Property name="emissivecolor">1 1 1 1</Property>
<Property name="emissivepower">0</Property>
<Property name="bumpamount">0.5</Property>
<Property name="displaceamount">20</Property>
<Property name="translucentfalloff">1</Property>
<Property name="diffuselightwrap">0</Property>
<Property name="specularmodel">Default</Property>
<Property name="speculartint">1 1 1</Property>
<Property name="speculartint">1 1 1 1</Property>
<Property name="ior">1.5</Property>
<Property name="fresnelPower">0</Property>
<Property name="vertexcolors">False</Property>
<Property name="sourcepath"></Property>
<Property name="importid">lowpolyCoupe</Property>
<Property name="importfile">../models/lowPolyCar/lowPolyCar.import</Property>
<Property name="type">Material</Property>
<Property name="name"><![CDATA[materials/lowpolyCoupe]]></Property>
<Property name="path"><![CDATA[C:/dev/lowendcluster/LowEndCluster/Presentation/materials/lowpolyCoupe.materialdef]]></Property>
<Property name="type">Material</Property>
<Property name="path"><![CDATA[/home/tomi/dev/qt3dstudio-demos/LowEndCluster/Presentation/materials/lowpolyCoupe.materialdef]]></Property>
<TextureData name="diffusemap">
<Property name="scaleu">1</Property>
<Property name="scalev">1</Property>
......@@ -38,7 +38,7 @@
<Property name="sourcepath"><![CDATA[./models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse.jpg]]></Property>
<Property name="importid">lowpolyCoupe_diffusemap</Property>
<Property name="importfile">../models/lowPolyCar/lowPolyCar.import</Property>
<Property name="type">Image</Property>
<Property name="name"><![CDATA[lowpolyCoupe_diffusemap]]></Property>
<Property name="type">Image</Property>
</TextureData>
</MaterialData>
\ No newline at end of file
<MaterialData version="1.0">
<Property name="shaderlighting">None</Property>
<Property name="blendmode">Normal</Property>
<Property name="diffuse">1 1 1</Property>
<Property name="diffuse">1 1 1 1</Property>
<Property name="diffusemap"><![CDATA[./models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse_red.jpg]]></Property>
<Property name="specularamount">0</Property>
<Property name="specularroughness">0</Property>
<Property name="opacity">100</Property>
<Property name="emissivecolor">1 1 1</Property>
<Property name="emissivecolor">1 1 1 1</Property>
<Property name="emissivepower">0</Property>
<Property name="bumpamount">0.5</Property>
<Property name="displaceamount">20</Property>
<Property name="translucentfalloff">1</Property>
<Property name="diffuselightwrap">0</Property>
<Property name="specularmodel">Default</Property>
<Property name="speculartint">1 1 1</Property>
<Property name="speculartint">1 1 1 1</Property>
<Property name="ior">1.5</Property>
<Property name="fresnelPower">0</Property>
<Property name="vertexcolors">False</Property>
<Property name="sourcepath"></Property>
<Property name="importid">lowpolyCoupe</Property>
<Property name="importfile">../models/lowPolyCar/lowPolyCar.import</Property>
<Property name="type">Material</Property>
<Property name="name"><![CDATA[materials/lowpolyCoupeRed]]></Property>
<Property name="path"><![CDATA[C:/dev/lowendcluster/LowEndCluster/Presentation/materials/lowpolyCoupeRed.materialdef]]></Property>
<Property name="type">Material</Property>
<Property name="path"><![CDATA[/home/tomi/dev/qt3dstudio-demos/LowEndCluster/Presentation/materials/lowpolyCoupeRed.materialdef]]></Property>
<TextureData name="diffusemap">
<Property name="scaleu">1</Property>
<Property name="scalev">1</Property>
......@@ -38,7 +38,7 @@
<Property name="sourcepath"><![CDATA[./models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse_red.jpg]]></Property>
<Property name="importid"></Property>
<Property name="importfile">../models/lowPolyCar/lowPolyCar.import</Property>
<Property name="type">Image</Property>
<Property name="name"><![CDATA[Image]]></Property>
<Property name="type">Image</Property>
</TextureData>
</MaterialData>
\ No newline at end of file
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtGui/QSurfaceFormat>
int main(int argc, char *argv[])
{
// qputenv("Q3DS_NO_DRAGONWINGS", "1");
// qputenv("Q3DS_DRAGON", "1");
#if 0 // For B2Qt and QNX
qputenv("QT_QPA_EGLFS_HIDECURSOR", "1");
qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1");
qputenv("QT_QPA_EGLFS_WIDTH", "1280");
qputenv("QT_QPA_EGLFS_HEIGHT", "480");
qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", "293");
qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", "110");
// qputenv("QSG_RENDER_LOOP", "basic");
qputenv("QSG_RENDER_LOOP", "threaded");
// Debugging
......@@ -23,9 +22,20 @@ int main(int argc, char *argv[])
qputenv("QT_LOGGING_RULES", "*=false");
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
#if defined(Q_OS_MACOS)
QSurfaceFormat openGLFormat;
openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
openGLFormat.setMajorVersion(4);
openGLFormat.setMinorVersion(1);
openGLFormat.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(openGLFormat);
#endif
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
......
This diff is collapsed.
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>barcenter.jpg</file>
<file>barside.jpg</file>
<file>needle.png</file>
<file>rpmgauge.jpg</file>
<file>speeedgauge.jpg</file>
<file>Presentation/maps/road.jpg</file>
<file>Presentation/materials/lowpolyCoupe.materialdef</file>
<file>Presentation/materials/Plane_Diffuse_Default.materialdef</file>
......@@ -13,23 +9,28 @@
<file>Presentation/models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse.psd</file>
<file>Presentation/models/lowPolyCar/meshes/polySurface3.mesh</file>
<file>Presentation/models/lowPolyCar/lowPolyCar.import</file>
<file>Presentation/models/road_001/meshes/Plane.mesh</file>
<file>Presentation/models/road_001/road.import</file>
<file>Presentation/Presentation.uia</file>
<file>main.cpp</file>
<file>TitilliumWeb-Italic.ttf</file>
<file>smallring.jpg</file>
<file>fuel.jpg</file>
<file>temp.jpg</file>
<file>tempFill.jpg</file>
<file>arrow.jpg</file>
<file>light.jpg</file>
<file>parkbrake.jpg</file>
<file>seatbelt.jpg</file>
<file>Presentation/models/lowPolyCar/maps/Low_lowpolyCoupe_Diffuse_red.jpg</file>
<file>Presentation/Presentation_1_1.uip</file>
<file>FpsDisplay.qml</file>
<file>needleTrail.png</file>
<file>SimulationData.qml</file>
<file>Presentation/materials/lowpolyCoupeRed.materialdef</file>
<file>Presentation/presentations/Presentation.uip</file>
<file>Presentation/models/road/meshes/Plane.mesh</file>
<file>Presentation/models/road/road.import</file>
<file>arrow.png</file>
<file>barcenter.png</file>
<file>barside.png</file>
<file>fuel.png</file>
<file>light.png</file>
<file>parkbrake.png</file>
<file>rpmgauge.png</file>
<file>seatbelt.png</file>
<file>smallring.png</file>
<file>speeedgauge.png</file>
<file>temp.png</file>
<file>tempFill.png</file>
</qresource>
</RCC>
TEMPLATE = app
QT += qml quick 3dstudioruntime2
QT += qml quick
#target.path = $$[QT_INSTALL_EXAMPLES]/studio3d/$$TARGET
target.path = /opt/$$TARGET
target.path = $$[QT_INSTALL_EXAMPLES]/studio3d/$$TARGET
INSTALLS += target
SOURCES += main.cpp
......
......@@ -2,43 +2,48 @@
<qresource prefix="/">
<file alias="main.qml">qml/main.qml</file>
<file alias="SimuData.qml">qml/SimuData.qml</file>
<file>presentation/Car/maps/outUV_normals.png</file>
<file>presentation/Car/maps/Seats_diffuse.jpg</file>
<file>presentation/Car/maps/Seats_normal.jpg</file>
<file>presentation/Car/maps/Wheel_normal.jpg</file>
<file>presentation/Car/maps/Wheel_specular.jpg</file>
<file>presentation/Car/meshes/body.mesh</file>
<file>presentation/Car/meshes/Car.mesh</file>
<file>presentation/Car/meshes/Wheel_Back_Left.mesh</file>
<file>presentation/Car/meshes/Wheel_Back_Right.mesh</file>
<file>presentation/Car/meshes/Wheel_Front_Left.mesh</file>
<file>presentation/Car/meshes/Wheel_Front_Right.mesh</file>
<file>presentation/Car/Car.import</file>
<file>presentation/contentPresentation.uip</file>
<file>presentation/mainPresentation.uia</file>
<file>presentation/mainPresentation.uip</file>
<file>qml/fonts/TitilliumWeb-SemiBold.ttf</file>
<file>presentation/digitalSpeed.uip</file>
<file>presentation/digitalTacho.uip</file>
<file>presentation/fonts/TitilliumWeb-Regular.ttf</file>
<file>main.cpp</file>
<file>presentation/VignetteEffect.effect</file>
<file>presentation/speedBackground.uip</file>
<file>presentation/tachoBackground.uip</file>
<file>presentation/GaugeCenter/meshes/centerTacho.mesh</file>
<file>presentation/Gauges/maps/environment.jpg</file>
<file>presentation/Gauges/maps/gaugespeed_background.jpg</file>
<file>presentation/Gauges/maps/gaugespeed_kph.png</file>
<file>presentation/Gauges/maps/gaugespeed_mph.png</file>
<file>presentation/Gauges/maps/gaugetacho.png</file>
<file>presentation/Gauges/maps/map.jpg</file>
<file>presentation/Gauges/maps/SpeedCenter.jpg</file>
<file>presentation/Gauges/meshes/background.mesh</file>
<file>presentation/Gauges/meshes/edge.mesh</file>
<file>presentation/Needle/meshes/tachoNeedle.mesh</file>
<file>presentation/GaugeCenter/gaugecenter.import</file>
<file>presentation/Gauges/Gauges.import</file>
<file>presentation/Needle/needle.import</file>
<file alias="FpsDisplay.qml">qml/FpsDisplay.qml</file>
<file>presentation/effects/VignetteEffect.effect</file>
<file>presentation/fonts/TitilliumWeb-Regular.ttf</file>
<file>presentation/meshes/Car/maps/outUV_normals.png</file>
<file>presentation/meshes/Car/maps/Seats_diffuse.jpg</file>
<file>presentation/meshes/Car/maps/Seats_normal.jpg</file>
<file>presentation/meshes/Car/maps/Wheel_normal.jpg</file>
<file>presentation/meshes/Car/maps/Wheel_specular.jpg</file>
<file>presentation/meshes/Car/meshes/body.mesh</file>
<file>presentation/meshes/Car/meshes/Car.mesh</file>
<file>presentation/meshes/Car/meshes/Wheel_Back_Right.mesh</file>
<file>presentation/meshes/Car/Car.import</file>
<file>presentation/meshes/GaugeCenter/meshes/centerTacho.mesh</file>
<file>presentation/meshes/GaugeCenter/gaugecenter.import</file>
<file>presentation/meshes/Gauges/maps/environment.jpg</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_background.jpg</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_kph.png</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_mph.png</file>
<file>presentation/meshes/Gauges/maps/gaugetacho.png</file>
<file>presentation/meshes/Gauges/maps/map.jpg</file>
<file>presentation/meshes/Gauges/maps/SpeedCenter.jpg</file>
<file>presentation/meshes/Gauges/meshes/background.mesh</file>
<file>presentation/meshes/Gauges/meshes/edge.mesh</file>
<file>presentation/meshes/Gauges/Gauges.import</file>
<file>presentation/meshes/Needle/meshes/tachoNeedle.mesh</file>
<file>presentation/meshes/Needle/needle.import</file>
<file>presentation/presentations/contentPresentation.uip</file>
<file>presentation/presentations/digitalSpeed.uip</file>
<file>presentation/presentations/digitalTacho.uip</file>
<file>presentation/presentations/mainPresentation.uip</file>
<file>presentation/presentations/speedBackground.uip</file>
<file>presentation/presentations/tachoBackground.uip</file>
<file>presentation/mainPresentation.uia</file>
<file>presentation/meshes/Car/maps/outUV_normals.ktx</file>
<file>presentation/meshes/Car/maps/Seats_diffuse.ktx</file>
<file>presentation/meshes/Car/maps/Seats_normal.ktx</file>
<file>presentation/meshes/Car/maps/Wheel_normal.ktx</file>
<file>presentation/meshes/Car/maps/Wheel_specular.ktx</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_background.ktx</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_kph.ktx</file>
<file>presentation/meshes/Gauges/maps/gaugespeed_mph.ktx</file>
<file>presentation/meshes/Gauges/maps/gaugetacho.ktx</file>
<file>presentation/meshes/Gauges/maps/SpeedCenter.ktx</file>
</qresource>
</RCC>
......@@ -50,19 +50,62 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtGui/QFontDatabase>
#include <q3dsruntimeglobal.h>
#include <QtGui/QOpenGLContext>
static QSurfaceFormat findIdealGLVersion()
{
QSurfaceFormat fmt;
fmt.setProfile(QSurfaceFormat::CoreProfile);
// Advanced: Try 4.3 core (so we get compute shaders for instance)
fmt.setVersion(4, 3);
QOpenGLContext ctx;
ctx.setFormat(fmt);
if (ctx.create() && ctx.format().version() >= qMakePair(4, 3))
return fmt;
// Basic: Stick with 3.3 for now to keep less fortunate,
// Mesa-based systems happy
fmt.setVersion(3, 3);
ctx.setFormat(fmt);
if (ctx.create())
return fmt;
// We tried...
return QSurfaceFormat::defaultFormat();
}
static QSurfaceFormat findIdealGLESVersion()
{
QSurfaceFormat fmt;
// Advanced: Try 3.1 (so we get compute shaders for instance)
fmt.setVersion(3, 1);
QOpenGLContext ctx;
ctx.setFormat(fmt);
if (ctx.create())
return fmt;
// Basic: OpenGL ES 3.0 is a hard requirement at the moment since we can
// only generate 300 es shaders, uniform buffers are mandatory.
fmt.setVersion(3, 0);
ctx.setFormat(fmt);
if (ctx.create())
return fmt;
// We tried...
return QSurfaceFormat::defaultFormat();
}
int main(int argc, char *argv[])
{
// qputenv("Q3DS_NO_DRAGONWINGS", "1");
qputenv("Q3DS_DRAGON", "1");
#if 0 // For B2Qt & QNX
qputenv("QT_QPA_EGLFS_HIDECURSOR", "1");
// qputenv("QT_QPA_EGLFS_DISABLE_INPUT", "1");
qputenv("QT_QPA_EGLFS_WIDTH", "1920");
qputenv("QT_QPA_EGLFS_HEIGHT", "1080");
qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", "293");
qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", "110");
// qputenv("QSG_RENDER_LOOP", "basic");
qputenv("QSG_RENDER_LOOP", "threaded");
// Debugging
......@@ -71,15 +114,35 @@ int main(int argc, char *argv[])
// qputenv("QT_LOGGING_RULES", "qt.qpa.*=true");
// Disable all extra logging
qputenv("QT_LOGGING_RULES", "*=false");
// qputenv("QT_LOGGING_RULES", "*=false");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#if defined(Q_OS_MACOS)
QSurfaceFormat openGLFormat;
openGLFormat.setRenderableType(QSurfaceFormat::OpenGL);
openGLFormat.setProfile(QSurfaceFormat::CoreProfile);
openGLFormat.setMajorVersion(4);
openGLFormat.setMinorVersion(1);
openGLFormat.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(openGLFormat);
#endif
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
#if !defined(Q_OS_MACOS)
QSurfaceFormat fmt;
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
fmt = findIdealGLVersion();
else
fmt = findIdealGLESVersion();
fmt.setDepthBufferSize(24);
fmt.setStencilBufferSize(8);
QSurfaceFormat::setDefaultFormat(fmt);
#endif
QFontDatabase::addApplicationFont("qrc:/qml/fonts/TitilliumWeb-SemiBold.ttf");
QFontDatabase::addApplicationFont("qrc:/presentation/fonts/TitilliumWeb-Regular.ttf");
QFont defaultFont;
defaultFont.setFamily("Titillium Web");
QGuiApplication::setFont(defaultFont);
......
......@@ -2,7 +2,7 @@
<Effect>
<MetaData>
<Property name="vig_color" formalName="Vignet Color" type="Color" default="0.5 0.5 0.5" description="The color to use for the Vignetting."/>
<Property name="vig_strenght" formalName="Strenght" min="0" max="15" default="15.0" description="Strenght of Vignetting."/>
<Property name="vig_strength" formalName="Strength" min="0" max="15" default="15.0" description="Strength of Vignetting."/>
<Property name="vig_radius" formalName="Radius" min="0" max="5" default="0.35" description="Size of Vignetting."/>
</MetaData>
<Shaders>
......@@ -15,20 +15,18 @@
void frag()
{
float radius = vig_radius;
vec4 origColor = texture2D_0(TexCoord);
vec2 uv = TexCoord.xy;
vec2 center = vec2(0.5);
vec4 bg = origColor;
uv *= 1.0 - uv.yx;
float vig = uv.x*uv.y * vig_strenght;
uv *= 1.0 - uv.yx;
float vig = uv.x * uv.y * vig_strength;
vig = pow(vig, vig_radius);
vec4 vigmixcolor = vec4(vig_color,vig) * vec4(vig);
gl_FragColor = vec4(mix(origColor,vigmixcolor,1.0-vig));
vec4 vigColor = vec4(vig_color.rgb, vig) * vig;
gl_FragColor = mix(origColor, vigColor, 1.0 - vig);
}
]]></FragmentShader>
</Shader>
......
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version='1.0' encoding='UTF-8'?>
<application>
<assets initial="mainPresentation">
<dataInput name="mainSlide" type="String"/>
<dataInput name="carSlide" type="String"/>
<dataInput name="colorSlide" type="String"/>
<dataInput name="speedUnitSlide" type="String"/>
<dataInput name="tacho" type="Ranged Number" min="0" max="7000"/>
<dataInput name="speed" type="Ranged Number" min="0" max="260"/>
<dataInput name="speedText" type="String"/>
<dataInput name="tachoText" type="String"/>
<dataInput name="displayColor" type="Vector3"/>
<presentation id="mainPresentation" src="mainPresentation.uip"/>
<presentation id="contentPresentation" src="contentPresentation.uip"/>
<presentation id="digitalSpeed" src="digitalSpeed.uip"/>
<presentation id="digitalTacho" src="digitalTacho.uip"/>
<presentation id="SpeedBackground" src="speedBackground.uip"/>
<presentation id="TachoBackground" src="tachoBackground.uip"/>
<presentation-qml id="navigationStream" args="../qml/Navigation.qml"/>
</assets>
<statemachine ref="#logic">
<visual-states>
<state ref="Initial">
<enter>
<goto-slide element="main:Scene" rel="next"/>
</enter>
</state>
</visual-states>
</statemachine>
<assets initial="mainPresentation">
<dataInput name="mainSlide" type="String"/>
<dataInput name="carSlide" type="String"/>
<dataInput name="colorSlide" type="String"/>
<dataInput name="speedUnitSlide" type="String"/>
<dataInput name="tacho" type="Ranged Number" min="0" max="7000"/>
<dataInput name="speed" type="Ranged Number" min="0" max="260"/>
<dataInput name="speedText" type="String"/>
<dataInput name="tachoText" type="String"/>
<dataInput name="displayColor" type="Vector3"/>
<presentation id="mainPresentation" src="presentations/mainPresentation.uip"/>
<presentation id="contentPresentation" src="presentations/contentPresentation.uip"/>
<presentation id="digitalSpeed" src="presentations/digitalSpeed.uip"/>
<presentation id="digitalTacho" src="presentations/digitalTacho.uip"/>
<presentation id="speedBackground" src="presentations/speedBackground.uip"/>
<presentation id="tachoBackground" src="presentations/tachoBackground.uip"/>
<presentation-qml id="navigationStream" args="../qml/Navigation.qml"/>
</assets>
<statemachine ref="#logic">
<visual-states>
<state ref="Initial">
<enter>
<goto-slide rel="next" element="main:Scene"/>
</enter>
</state>
</visual-states>
</statemachine>
</application>
This diff is collapsed.
This diff is collapsed.