Commit 414bc791 authored by Tomi Korpipää's avatar Tomi Korpipää

Modify kria cluster for OpenGL runtime

parent ae9bb304
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,12 +2,9 @@
<qresource prefix="/">
<file alias="main.qml">qml/main.qml</file>
<file alias="SimuData.qml">qml/SimuData.qml</file>
<file>presentation/mainPresentation.uia</file>
<file>qml/fonts/TitilliumWeb-SemiBold.ttf</file>
<file>presentation/fonts/TitilliumWeb-Regular.ttf</file>
<file>main.cpp</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>
......@@ -15,10 +12,7 @@
<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_Left.mesh</file>
<file>presentation/meshes/Car/meshes/Wheel_Back_Right.mesh</file>
<file>presentation/meshes/Car/meshes/Wheel_Front_Left.mesh</file>
<file>presentation/meshes/Car/meshes/Wheel_Front_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>
......@@ -40,5 +34,6 @@
<file>presentation/presentations/mainPresentation.uip</file>
<file>presentation/presentations/speedBackground.uip</file>
<file>presentation/presentations/tachoBackground.uip</file>
<file>presentation/mainPresentation.uia</file>
</qresource>
</RCC>
......@@ -50,19 +50,15 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtGui/QFontDatabase>
#include <q3dsruntimeglobal.h>
int main(int argc, char *argv[])
{
// qputenv("Q3DS_NO_DRAGONWINGS", "1");
// qputenv("Q3DS_DRAGON", "1");
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
......@@ -77,8 +73,6 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat());
QFontDatabase::addApplicationFont("qrc:/presentation/fonts/TitilliumWeb-Regular.ttf");
QFont defaultFont;
defaultFont.setFamily("Titillium Web");
......
<?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="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 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>
......@@ -16,7 +16,7 @@
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" background="SolidColor" disabledepthprepass="True" disabledepthtest="True" />
<Add ref="#Camera" orthographic="True" />
<Add ref="#Camera" clipfar="600" clipnear="500" orthographic="True" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#speed" name="speed" controlledproperty="$speedText textstring" font="TitilliumWeb-Regular" position="0 40 0" size="90" textstring="0" />
<Add ref="#kmh" name="kmh" controlledproperty="$speedUnitSlide textstring" font="TitilliumWeb-Regular" position="0 -40 0" size="30" textstring="kph" />
......
......@@ -16,7 +16,7 @@
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" background="SolidColor" disabledepthprepass="True" disabledepthtest="True" />
<Add ref="#Camera" orthographic="True" />
<Add ref="#Camera" clipfar="600" clipnear="500" orthographic="True" />
<State id="Scene-Slide1" name="Slide1" >
<Add ref="#rpm" name="rpm" font="TitilliumWeb-Regular" position="0 -40 0" rotation="0 0 0" size="30" textstring="rpm x 1000" />
<Add ref="#tacho" name="tacho" controlledproperty="$tachoText textstring" font="TitilliumWeb-Regular" opacity="99" position="0 40 0" size="90" textstring="0.0" />
......
......@@ -5,25 +5,25 @@
<CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors>
</ProjectSettings>
<BufferData >
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugespeed_kph.png" hasTransparency="True" />
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugespeed_mph.png" hasTransparency="True" />
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugespeed_kph.png" hasTransparency="True" />
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugespeed_mph.png" hasTransparency="True" />
</BufferData>
<Graph >
<Scene id="Scene" controlledproperty="$speedUnitSlide @slide" >
<Layer id="Layer" variants="" >
<Camera id="Camera" />
<Model id="speed_mph_new" >
<Model id="speed_mph_new" variants="" >
<Material id="Material" >
<Image id="Material_diffusemap" />
</Material>
</Model>
<Model id="speed_new" >
<Model id="speed_new" variants="" >
<Material id="Material_001" >
<Image id="Material_001_diffusemap" />
</Material>
</Model>
<Component id="gaugespeed_background" >
<Model id="gaugespeed_background_001" >
<Model id="gaugespeed_background_001" variants="" >
<Material id="Material_002" >
<Image id="Material_002_diffusemap" />
</Material>
......@@ -35,17 +35,17 @@
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" name="SpeedTextures" aosoftness="49.5" background="Transparent" disabledepthprepass="True" disabledepthtest="False" width="100" />
<Add ref="#Camera" orthographic="True" />
<Add ref="#speed_mph_new" name="speed_mph" opacity="100" scale="5.12 5.12 1" sourcepath="#Rectangle" >
<Add ref="#Camera" clipfar="600" clipnear="500" orthographic="True" />
<Add ref="#speed_mph_new" name="speed_mph" opacity="100" scale="5.12 5.12 1" shadowcaster="False" sourcepath="#Rectangle" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
</Add>
<Add ref="#Material" diffusemap="#Material_diffusemap" shaderlighting="None" />
<Add ref="#Material_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_mph.png" />
<Add ref="#speed_new" name="speed_kph" opacity="100" scale="5.12 5.12 1" sourcepath="#Rectangle" >
<Add ref="#Material_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_mph.png" />
<Add ref="#speed_new" name="speed_kph" opacity="100" scale="5.12 5.12 1" shadowcaster="False" sourcepath="#Rectangle" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
</Add>
<Add ref="#Material_001" diffusemap="#Material_001_diffusemap" shaderlighting="None" />
<Add ref="#Material_001_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_kph.png" />
<Add ref="#Material_001_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_kph.png" />
<Add ref="#gaugespeed_background" name="gaugespeed_background" controlledproperty="$colorSlide @slide" />
<State id="Scene-kph" name="kph" playmode="Stop at end" >
<Set ref="#Layer" endtime="1000" />
......@@ -71,13 +71,13 @@
</State>
</State>
<State name="Master Slide" component="#gaugespeed_background" >
<Add ref="#gaugespeed_background_001" name="gaugespeed_background" endtime="1000" scale="5.12 5.12 1" sourcepath="#Rectangle" />
<Add ref="#gaugespeed_background_001" name="gaugespeed_background" endtime="1000" scale="5.12 5.12 1" shadowcaster="False" sourcepath="#Rectangle" />
<Add ref="#Material_002" diffuse="1 1 1" diffusemap="#Material_002_diffusemap" shaderlighting="None" >
<AnimationTrack property="diffuse.x" type="EaseInOut" >0 1 0 0</AnimationTrack>
<AnimationTrack property="diffuse.y" type="EaseInOut" >0 1 0 0</AnimationTrack>
<AnimationTrack property="diffuse.z" type="EaseInOut" >0 1 0 0</AnimationTrack>
</Add>
<Add ref="#Material_002_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_background.jpg" />
<Add ref="#Material_002_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_background.jpg" />
<State id="gaugespeed_background-red" name="red" >
<Set ref="#gaugespeed_background_001" endtime="1000" />
<Set ref="#Material_002" diffuse="1 1 1" >
......
......@@ -5,19 +5,19 @@
<CustomColors count="16" >#ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff #ffffff</CustomColors>
</ProjectSettings>
<BufferData >
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugetacho.png" hasTransparency="True" />
<ImageBuffer sourcepath="../meshes/Gauges/maps/gaugetacho.png" hasTransparency="True" />
</BufferData>
<Graph >
<Scene id="Scene" >
<Layer id="Layer" variants="" >
<Camera id="Camera" />
<Model id="speed_mph_new" >
<Model id="speed_mph_new" variants="" >
<Material id="Material" >
<Image id="Material_diffusemap" />
</Material>
</Model>
<Component id="gaugespeed_background" >
<Model id="gaugespeed_background_001" >
<Model id="gaugespeed_background_001" variants="" >
<Material id="Material_002" >
<Image id="Material_002_diffusemap" />
</Material>
......@@ -29,12 +29,12 @@
<Logic >
<State name="Master Slide" component="#Scene" >
<Add ref="#Layer" name="TachoTextures" background="Transparent" disabledepthprepass="True" disabledepthtest="False" />
<Add ref="#Camera" orthographic="True" />
<Add ref="#speed_mph_new" name="tacho" opacity="100" scale="5.12 5.12 1" sourcepath="#Rectangle" >
<Add ref="#Camera" clipfar="600" clipnear="500" orthographic="True" />
<Add ref="#speed_mph_new" name="tacho" opacity="100" scale="5.12 5.12 1" shadowcaster="False" sourcepath="#Rectangle" >
<AnimationTrack property="opacity" type="EaseInOut" >0 100 0 0</AnimationTrack>
</Add>
<Add ref="#Material" diffusemap="#Material_diffusemap" shaderlighting="None" />
<Add ref="#Material_diffusemap" sourcepath="../meshes/Gauges/maps/gaugetacho.png" />
<Add ref="#Material_diffusemap" sourcepath="../meshes/Gauges/maps/gaugetacho.png" />
<Add ref="#gaugespeed_background" name="gaugetacho_background" controlledproperty="$colorSlide @slide" />
<State id="Scene-Tacho" name="Tacho" playmode="Stop at end" >
<Set ref="#Layer" endtime="1000" />
......@@ -46,13 +46,13 @@
</State>
</State>
<State name="Master Slide" component="#gaugespeed_background" >
<Add ref="#gaugespeed_background_001" name="gaugetacho_background" endtime="1000" scale="5.12 5.12 1" sourcepath="#Rectangle" />
<Add ref="#gaugespeed_background_001" name="gaugetacho_background" endtime="1000" scale="5.12 5.12 1" shadowcaster="False" sourcepath="#Rectangle" />
<Add ref="#Material_002" diffuse="1 1 1" diffusemap="#Material_002_diffusemap" shaderlighting="None" >
<AnimationTrack property="diffuse.x" type="EaseInOut" >0 1 0 0</AnimationTrack>
<AnimationTrack property="diffuse.y" type="EaseInOut" >0 1 0 0</AnimationTrack>
<AnimationTrack property="diffuse.z" type="EaseInOut" >0 1 0 0</AnimationTrack>
</Add>
<Add ref="#Material_002_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_background.jpg" />
<Add ref="#Material_002_diffusemap" sourcepath="../meshes/Gauges/maps/gaugespeed_background.jpg" />
<State id="gaugetacho_background-red" name="red" playthroughto="Next" >
<Set ref="#gaugespeed_background_001" endtime="1000" />
<Set ref="#Material_002" diffuse="1 1 1" >
......
......@@ -50,8 +50,7 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import QtStudio3D 2.3
//import QtStudio3D 1.1
import QtStudio3D.OpenGL 2.4
import QtQuick.Controls 2.1
Window {
......@@ -61,7 +60,7 @@ Window {
visible: true
color: "#000000"
title: "Qt 3D Studio Kria 3D Cluster Demo"
visibility: Window.FullScreen
//visibility: Window.FullScreen
property bool startupAnimation: true
property bool allowSelection: true
......@@ -94,28 +93,17 @@ Window {
readonly property int framesBetweenUpdates: 5 // Use a 5 frame average for the FPS counter
readonly property int secondsBetweenUpdates: 60 // Use a 1 minute average for the average FPS counter
// RT1
// onFrameSwapped: {
// frames++;
// avgFrames++;
// }
Studio3D {
id: studio3D
width: parent.width
height: parent.height
anchors.verticalCenter: parent.verticalCenter
// RT2
onFrameUpdate: {
frames++;
avgFrames++;
}
// ViewerSettings {
// scaleMode: ViewerSettings.ScaleModeFit
// }
Presentation {
id: cluster
source: "qrc:/presentation/mainPresentation.uia"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment