Re: [Interest] {Qt3D} Problem with the look of QDiffuseSpecularMaterial moving from Qt5 to Qt6

2024-05-07 Thread Mike Krus via Interest
Hi

do you know which backend you are using? RHI (default)? If so, could you try 
the GL backend?
In either case, please create a bug report with, if possible, a small example 
to reproduce the issue.


Mike


> On 4 May 2024, at 23:25, Andy  wrote:
> 
> I've been upgrading an old codebase from Qt5 to Qt6. For Qt3D, I've followed 
> the info from here:
> 
>   https://www.kdab.com/qt-3d-changes-in-qt-6/
> 
> The changes I've had to make so far were all around geometry, but I'm getting 
> different visuals between Qt5 and Qt6.
> 
> Qt 5.15.2:
> Qt 6.7.0:
> 
> 
> (Ignore slight camera position difference.)
> 
> I haven't changed the light or any of the materials.
> 
> I'm using QDiffuseSpecularMaterial for all these meshes, and setting ambient, 
> diffuse, shininess, and specular for all.
> 
> I haven't found anything describing any changes to QDiffuseSpecularMaterial. 
> Am I missing something I need to change? Did QDiffuseSpecularMaterial just 
> change to be darker? If so, how do I get lighter colours back? No matter what 
> I change it's super-dark.
> 
> My offscreen renderer is also broken now, but that seems to be a separate 
> issue.
> 
> (Aside: It would be useful to have C++ examples of the new stuff - 
> QBoundingVolume and QGeometryView for example. The official docs - as with 
> all of Qt3D - are very sparse. More docs & more examples would be of great 
> help.)
> 
> Thank you!
> 
> P.S. My active framegraph looks like this:
> 
> myCustomFrameGraph::Custom (:0, (null))
> Qt3DRender::QRenderSurfaceSelector:: (:0, (null))
> Qt3DRender::QViewport:: (:0, (null))
> Qt3DRender::QClearBuffers::backgroundColour (:0, (null))
> Qt3DRender::QNoDraw:: (:0, (null))
> Qt3DRender::QFrustumCulling:: (:0, (null))
> Qt3DRender::QCameraSelector::onScreenCameraSelector (:0, 
> (null))
> Qt3DRender::QRenderCapture::onScreenCapture (:0, (null))
> Qt3DRender::QLayerFilter::opaqueLayer (:0, (null))
> Qt3DRender::QLayerFilter::transparentLayer (:0, (null))
> Qt3DRender::QCameraSelector::offScreenCameraSelector (:0, 
> (null))
> Qt3DRender::QRenderTargetSelector:: (:0, (null))
> Qt3DRender::QRenderTarget::offScreenTarget (:0, 
> (null))
> Qt3DRender::QRenderTargetOutput:: (:0, (null))
> 
> Qt3DRender::QTexture2DMultisample::offScreenTexture (:0, (null))
> Qt3DRender::QClearBuffers::backgroundColour (:0, 
> (null))
> Qt3DRender::QNoDraw:: (:0, (null))
> Qt3DRender::QRenderCapture::offScreenCapture (:0, 
> (null))
> Qt3DRender::QLayerFilter::opaqueLayer (:0, (null))
> Qt3DRender::QLayerFilter::transparentLayer (:0, 
> (null))
> 
> ---
> Andy Maloney
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Fit in view

2023-03-10 Thread Mike Krus via Interest


> On 9 Mar 2023, at 22:00, Sean Murphy via Interest  
> wrote:
> 
> I'm trying out the Qt 3D classes for the first time and am in need of a 
> couple pointers.
> At a high level, I have the following:
> - 1 view, 1 scene, 1 camera, and 1 QOrbitCameraController
>  - in the scene, I create 7 entities, each a child of the root entity
>- each of the entities contains a mesh that is sourced from a
>  corresponding .obj file
> 
> Then my main window contains 7 radio buttons to toggle which entity is 
> visible at any
> given time. The radio buttons are mutually exclusive, so the goal is that 
> only one entity
> is visible at any time. I'm having two main issues with the setup so far:
> 
> Issue 1: QEntity::setEnabled(false) doesn't seem to make the entity invisible
>  Each radio button is connected to a corresponding slot which just does the 
> following:
> 
>void MainWindow::slotEntity1Toggled(bool checked)
>{
>  qDebug() << __FUNCTION__ << checked;
>  Entity1 ->setEnabled(checked);
>}
> 
>  When the button becomes enabled (checked == true) the entity does in fact 
> become
>  visible. But when the button is disabled (checked == false), the entity is 
> still
>  visible in the view. If at that point I resize the application (and 
> therefore the
>  view) then the old entity disappears. It appears I need the 3D version of a
>  repaint(), but so far I haven't found where that is (or even which class I 
> should be
>  looking at). I did try explicitly calling repaint() on the QWidget that 
> holds the
>  view, but that didn't force the 3D scene to re-render, so far I've only been 
> able
>  to get it to redraw by resizing the widget.
> 
>  From the qDebug() statement in there, I can see that this slot is getting 
> called
>  as expected. Every time it's called with "true" the entity changes from
>  invisible->visible without requiring any window resizing. But every time 
> this function
>  is called with "false", I have to resize the window to get the entity to 
> disappear
unless you have setup your scene to be refresh ondemand 
(QRenderSettings::renderPolicy
set to QRenderSettings::OnDemand), Qt3D should constantly re-render.

Please provide more details on how the view is setup.


> Issue 2: Is there any sort of "fit in view" functionality for 3D views?
> 
>  Since I'm only allowing the user to display one entity at a time, I'd like 
> to be
>  able to automatically set the camera settings to zoom as needed to fit the 
> entire
>  entity within the view, so the user doesn't have to manually zoom in/out as 
> they
>  switch between entities.
> 
>  I've used the 2D classes QGraphicsView & QGraphicsScene fairly extensively 
> and I'm
>  used to using QGraphicsView::fitInView(QGraphicsItem*) and have the 
> QGraphicsView set
>  the transform needed to fit that item within the view. I was hoping that Qt 
> 3D has
>  something similar, but so far I haven't stumbled across it. I don't know 
> enough about
>  the Qt 3D classes yet to know if there's some easy way to compute the 
> correct transform
>  required to set this up?
> 
>  The .obj files I'm playing around with have VASTLY different scale factors 
> so a
>  camera setting for one entity often doesn't work well for another.
There’s relevant methods on the QCamera class.



Mike


> Other pertinent information:
> - Using Qt 5.15.2, but could switch to Qt 6 if required.
> - I would prefer to stick with QWidget & C++, not QML
> - I'm extremely new to Qt 3D, OpenGL, etc. so go ahead and make the 
> assumption that
>   I know nothing about anything in that realm. It's an accurate assumption, 
> and I won't
>   be offended!
> 
> Thanks,
> Sean
> 
> 
> 
> 
> 
> 
> This e-mail, including any attached files, may contain confidential 
> information, privileged information and/or trade secrets for the sole use of 
> the intended recipient. Any review, use, distribution, or disclosure by 
> others is strictly prohibited. If you are not the intended recipient (or 
> authorized to receive information for the intended recipient), please contact 
> the sender by reply e-mail and delete all copies of this message.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D Fit in view

2023-03-09 Thread Sean Murphy via Interest
I'm trying out the Qt 3D classes for the first time and am in need of a couple 
pointers.
At a high level, I have the following:
- 1 view, 1 scene, 1 camera, and 1 QOrbitCameraController
  - in the scene, I create 7 entities, each a child of the root entity
- each of the entities contains a mesh that is sourced from a
  corresponding .obj file

Then my main window contains 7 radio buttons to toggle which entity is visible 
at any
given time. The radio buttons are mutually exclusive, so the goal is that only 
one entity
is visible at any time. I'm having two main issues with the setup so far:

Issue 1: QEntity::setEnabled(false) doesn't seem to make the entity invisible
  Each radio button is connected to a corresponding slot which just does the 
following:

void MainWindow::slotEntity1Toggled(bool checked)
{
  qDebug() << __FUNCTION__ << checked;
  Entity1 ->setEnabled(checked);
}

  When the button becomes enabled (checked == true) the entity does in fact 
become
  visible. But when the button is disabled (checked == false), the entity is 
still
  visible in the view. If at that point I resize the application (and therefore 
the
  view) then the old entity disappears. It appears I need the 3D version of a
  repaint(), but so far I haven't found where that is (or even which class I 
should be
  looking at). I did try explicitly calling repaint() on the QWidget that holds 
the
  view, but that didn't force the 3D scene to re-render, so far I've only been 
able
  to get it to redraw by resizing the widget.

  From the qDebug() statement in there, I can see that this slot is getting 
called
  as expected. Every time it's called with "true" the entity changes from
  invisible->visible without requiring any window resizing. But every time this 
function
  is called with "false", I have to resize the window to get the entity to 
disappear

Issue 2: Is there any sort of "fit in view" functionality for 3D views?

  Since I'm only allowing the user to display one entity at a time, I'd like to 
be
  able to automatically set the camera settings to zoom as needed to fit the 
entire
  entity within the view, so the user doesn't have to manually zoom in/out as 
they
  switch between entities.

  I've used the 2D classes QGraphicsView & QGraphicsScene fairly extensively 
and I'm
  used to using QGraphicsView::fitInView(QGraphicsItem*) and have the 
QGraphicsView set
  the transform needed to fit that item within the view. I was hoping that Qt 
3D has
  something similar, but so far I haven't stumbled across it. I don't know 
enough about
  the Qt 3D classes yet to know if there's some easy way to compute the correct 
transform
  required to set this up?

  The .obj files I'm playing around with have VASTLY different scale factors so 
a
  camera setting for one entity often doesn't work well for another.

Other pertinent information:
 - Using Qt 5.15.2, but could switch to Qt 6 if required.
 - I would prefer to stick with QWidget & C++, not QML
 - I'm extremely new to Qt 3D, OpenGL, etc. so go ahead and make the assumption 
that
   I know nothing about anything in that realm. It's an accurate assumption, 
and I won't
   be offended!

Thanks,
Sean






This e-mail, including any attached files, may contain confidential 
information, privileged information and/or trade secrets for the sole use of 
the intended recipient. Any review, use, distribution, or disclosure by others 
is strictly prohibited. If you are not the intended recipient (or authorized to 
receive information for the intended recipient), please contact the sender by 
reply e-mail and delete all copies of this message.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-08 Thread Mike Krus via Interest
please file a bug report


Mike

> On 8 Aug 2022, at 17:21, Nicholas Yue  wrote:
>
> Hi Mike,
>
> I have now tried calling updateImplicitBounds() but it returns false
>
> Is that indicating some underlying issue elsewhere?
>
> ```
> Status changed: Qt3DRender::QSceneLoader::Loading
> Status changed: Qt3DRender::QSceneLoader::Ready
>  Entity: Qt3DCore::QEntity(0x7ffaac004660, name = untitled.obj) Components: 
> QList(Qt3DCore::QTransform(0x7ffaac04c590))
> BoundingVolume:  "untitled.obj"
>Entity: Qt3DCore::QEntity(0x7ffaac019220, name = Suzanne) Components: 
> QList(Qt3DExtras::QPhongMaterial(0x7ffaac01bf30, name = DefaultMaterial), 
> Qt3DRender::QGeometryRenderer(0x7ffaac00c4d0), 
> Qt3DCore::QTransform(0x7ffaac045800))
> BoundingVolume:  "Suzanne"
> gr is Valid
> updateImplicitBounds returns FALSE
> ```
>
> ```
> void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
> {
> Qt3DCore::QNodeVector nodes = e->childNodes();
> for (int i = 0; i < nodes.count(); ++i) {
> Qt3DCore::QNode *node = nodes[i];
> Qt3DCore::QEntity *entity = qobject_cast(node);
> if (entity) {
> QString indent;
> indent.fill(' ', depth * 2);
> qDebug().noquote() << indent << "Entity:" << entity << 
> "Components:" << entity->components();
> {
> // Question about BoundingVolume
> qDebug() << "BoundingVolume: " << entity->objectName();
> const QList myQGeometryRenderer 
> = entity->componentsOfType();
> if (!myQGeometryRenderer.isEmpty())
> {
> Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
> if (gr){
> qDebug() << "gr is Valid";
> if (gr->updateImplicitBounds()){
> QVector3D minPoint = gr->implicitMinPoint();
> QVector3D maxPoint = gr->implicitMaxPoint();
> qDebug() << "minPoint: " << minPoint;
> qDebug() << "maxPoint: " << maxPoint;
> }
> else
> qDebug() << "updateImplicitBounds returns FALSE";
> }
> }
> }
> walkEntity(entity, depth + 1);
> }
> }
> }
> ```
>
> On Sat, 6 Aug 2022 at 00:09, Mike Krus  wrote:
> the computations are done a background thread, you may have to wait 1 frame 
> before they are valid.
> Or call QBoundingVolume::updateImplicitBounds() before reading them.
>
> If it fails please submit a bug report with a small example
>
> Mike
>
> > On 5 Aug 2022, at 20:38, Nicholas Yue  wrote:
> >
> > Any insight ?
> >
> > On Wed, 3 Aug 2022 at 15:44, Nicholas Yue  wrote:
> > I have the following code
> >
> > ```
> > void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
> > {
> > Qt3DCore::QNodeVector nodes = e->childNodes();
> > for (int i = 0; i < nodes.count(); ++i) {
> > Qt3DCore::QNode *node = nodes[i];
> > Qt3DCore::QEntity *entity = qobject_cast(node);
> > if (entity) {
> > QString indent;
> > indent.fill(' ', depth * 2);
> > qDebug().noquote() << indent << "Entity:" << entity << 
> > "Components:" << entity->components();
> >
> > {
> > // Question about BoundingVolume
> > qDebug() << "BoundingVolume: " << entity->objectName();
> > const QList 
> > myQGeometryRenderer = 
> > entity->componentsOfType();
> > if (!myQGeometryRenderer.isEmpty())
> > {
> > Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
> > QVector3D minPoint = gr->implicitMinPoint();
> > QVector3D maxPoint = gr->implicitMaxPoint();
> > qDebug() << "minPoint: " << minPoint;
> > qDebug() << "maxPoint: " << maxPoint;
> > }
> > }
> > walkEntity(entity, depth + 1);
> > }
> > }
> > }
> > ```
> >
> > But I got the (0,0,0) for both the min/max point
> >
> > ```
> > Status changed: Qt3DRender::QSceneLoader::Loading
> > Status changed: Qt3DRender::QSceneLoader::Ready
> >  Entity: Qt3DCore::QEntity(0x7f65dc004660, name = untitled.obj) Components: 
> > QList(Qt3DCore::QTransform(0x7f65dc04c590))
> >Entity: Qt3DCore::QEntity(0x7f65dc019220, name = Suzanne) Components: 
> > QList(Qt3DExtras::QPhongMaterial(0x7f65dc01bf30, name = DefaultMaterial), 
> > Qt3DRender::QGeometryRenderer(0x7f65dc00c4d0), 
> > Qt3DCore::QTransform(0x7f65dc045800))
> > BoundingVolume:  "Suzanne"
> > minPoint:  QVector3D(0, 0, 0)
> > maxPoint:  QVector3D(0, 0, 0)
> > BoundingVolume:  "untitled.obj"
> > ```
> >
> > I am using Qt 6.2.2 on Ubuntu
> >
> > Cheers
> >
> > On Wed, 3 Aug 2022 at 01:25, Mike Krus  wrote:
> > Hi
> >
> > once the scene is loaded (ie, the status is Ready, keeping in mind loading 
> > is asynchronous), you can use
> > QSceneLoader::entity() to get a loaded entity by name, and then 
> > QEntity::componentsOfType() to get the component.
> > Loaded entities are children of the entity that the QSceneLoader component 

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-08 Thread Nicholas Yue
Hi Mike,

I have now tried calling updateImplicitBounds() but it returns false

Is that indicating some underlying issue elsewhere?

```
Status changed: Qt3DRender::QSceneLoader::Loading
Status changed: Qt3DRender::QSceneLoader::Ready
 Entity: Qt3DCore::QEntity(0x7ffaac004660, name = untitled.obj) Components:
QList(Qt3DCore::QTransform(0x7ffaac04c590))
BoundingVolume:  "untitled.obj"
   Entity: Qt3DCore::QEntity(0x7ffaac019220, name = Suzanne) Components:
QList(Qt3DExtras::QPhongMaterial(0x7ffaac01bf30, name = DefaultMaterial),
Qt3DRender::QGeometryRenderer(0x7ffaac00c4d0),
Qt3DCore::QTransform(0x7ffaac045800))
BoundingVolume:  "Suzanne"
gr is Valid
updateImplicitBounds returns FALSE
```

```
void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
{
Qt3DCore::QNodeVector nodes = e->childNodes();
for (int i = 0; i < nodes.count(); ++i) {
Qt3DCore::QNode *node = nodes[i];
Qt3DCore::QEntity *entity = qobject_cast(node);
if (entity) {
QString indent;
indent.fill(' ', depth * 2);
qDebug().noquote() << indent << "Entity:" << entity <<
"Components:" << entity->components();
{
// Question about BoundingVolume
qDebug() << "BoundingVolume: " << entity->objectName();
const QList
myQGeometryRenderer =
entity->componentsOfType();
if (!myQGeometryRenderer.isEmpty())
{
Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
if (gr){
qDebug() << "gr is Valid";
if (gr->updateImplicitBounds()){
QVector3D minPoint = gr->implicitMinPoint();
QVector3D maxPoint = gr->implicitMaxPoint();
qDebug() << "minPoint: " << minPoint;
qDebug() << "maxPoint: " << maxPoint;
}
else
qDebug() << "updateImplicitBounds returns FALSE";
}
}
}
walkEntity(entity, depth + 1);
}
}
}
```

On Sat, 6 Aug 2022 at 00:09, Mike Krus  wrote:

> the computations are done a background thread, you may have to wait 1
> frame before they are valid.
> Or call QBoundingVolume::updateImplicitBounds() before reading them.
>
> If it fails please submit a bug report with a small example
>
> Mike
>
> > On 5 Aug 2022, at 20:38, Nicholas Yue  wrote:
> >
> > Any insight ?
> >
> > On Wed, 3 Aug 2022 at 15:44, Nicholas Yue 
> wrote:
> > I have the following code
> >
> > ```
> > void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
> > {
> > Qt3DCore::QNodeVector nodes = e->childNodes();
> > for (int i = 0; i < nodes.count(); ++i) {
> > Qt3DCore::QNode *node = nodes[i];
> > Qt3DCore::QEntity *entity = qobject_cast *>(node);
> > if (entity) {
> > QString indent;
> > indent.fill(' ', depth * 2);
> > qDebug().noquote() << indent << "Entity:" << entity <<
> "Components:" << entity->components();
> >
> > {
> > // Question about BoundingVolume
> > qDebug() << "BoundingVolume: " << entity->objectName();
> > const QList
> myQGeometryRenderer =
> entity->componentsOfType();
> > if (!myQGeometryRenderer.isEmpty())
> > {
> > Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
> > QVector3D minPoint = gr->implicitMinPoint();
> > QVector3D maxPoint = gr->implicitMaxPoint();
> > qDebug() << "minPoint: " << minPoint;
> > qDebug() << "maxPoint: " << maxPoint;
> > }
> > }
> > walkEntity(entity, depth + 1);
> > }
> > }
> > }
> > ```
> >
> > But I got the (0,0,0) for both the min/max point
> >
> > ```
> > Status changed: Qt3DRender::QSceneLoader::Loading
> > Status changed: Qt3DRender::QSceneLoader::Ready
> >  Entity: Qt3DCore::QEntity(0x7f65dc004660, name = untitled.obj)
> Components: QList(Qt3DCore::QTransform(0x7f65dc04c590))
> >Entity: Qt3DCore::QEntity(0x7f65dc019220, name = Suzanne) Components:
> QList(Qt3DExtras::QPhongMaterial(0x7f65dc01bf30, name = DefaultMaterial),
> Qt3DRender::QGeometryRenderer(0x7f65dc00c4d0),
> Qt3DCore::QTransform(0x7f65dc045800))
> > BoundingVolume:  "Suzanne"
> > minPoint:  QVector3D(0, 0, 0)
> > maxPoint:  QVector3D(0, 0, 0)
> > BoundingVolume:  "untitled.obj"
> > ```
> >
> > I am using Qt 6.2.2 on Ubuntu
> >
> > Cheers
> >
> > On Wed, 3 Aug 2022 at 01:25, Mike Krus  wrote:
> > Hi
> >
> > once the scene is loaded (ie, the status is Ready, keeping in mind
> loading is asynchronous), you can use
> > QSceneLoader::entity() to get a loaded entity by name, and then
> QEntity::componentsOfType() to get the component.
> > Loaded entities are children of the entity that the QSceneLoader
> component was assigned to, and components and
> > entities are all QObjects so you can use the normal tree traversal
> techniques that work with any QObject to find
> > objects by type or name.
> >
> >
> > Mike
> >
> > > On 3 Aug 2022, 

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-05 Thread Nicholas Yue
Any insight ?

On Wed, 3 Aug 2022 at 15:44, Nicholas Yue  wrote:

> I have the following code
>
> ```
> void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
> {
> Qt3DCore::QNodeVector nodes = e->childNodes();
> for (int i = 0; i < nodes.count(); ++i) {
> Qt3DCore::QNode *node = nodes[i];
> Qt3DCore::QEntity *entity = qobject_cast *>(node);
> if (entity) {
> QString indent;
> indent.fill(' ', depth * 2);
> qDebug().noquote() << indent << "Entity:" << entity <<
> "Components:" << entity->components();
>
> {
> // Question about BoundingVolume
> qDebug() << "BoundingVolume: " << entity->objectName();
> const QList
> myQGeometryRenderer =
> entity->componentsOfType();
> if (!myQGeometryRenderer.isEmpty())
> {
> Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
> QVector3D minPoint = gr->implicitMinPoint();
> QVector3D maxPoint = gr->implicitMaxPoint();
> qDebug() << "minPoint: " << minPoint;
> qDebug() << "maxPoint: " << maxPoint;
> }
> }
> walkEntity(entity, depth + 1);
> }
> }
> }
> ```
>
> But I got the (0,0,0) for both the min/max point
>
> ```
> Status changed: Qt3DRender::QSceneLoader::Loading
> Status changed: Qt3DRender::QSceneLoader::Ready
>  Entity: Qt3DCore::QEntity(0x7f65dc004660, name = untitled.obj)
> Components: QList(Qt3DCore::QTransform(0x7f65dc04c590))
>Entity: Qt3DCore::QEntity(0x7f65dc019220, name = Suzanne) Components:
> QList(Qt3DExtras::QPhongMaterial(0x7f65dc01bf30, name = DefaultMaterial),
> Qt3DRender::QGeometryRenderer(0x7f65dc00c4d0),
> Qt3DCore::QTransform(0x7f65dc045800))
> BoundingVolume:  "Suzanne"
> minPoint:  QVector3D(0, 0, 0)
> maxPoint:  QVector3D(0, 0, 0)
> BoundingVolume:  "untitled.obj"
> ```
>
> I am using Qt 6.2.2 on Ubuntu
>
> Cheers
>
> On Wed, 3 Aug 2022 at 01:25, Mike Krus  wrote:
>
>> Hi
>>
>> once the scene is loaded (ie, the status is Ready, keeping in mind
>> loading is asynchronous), you can use
>> QSceneLoader::entity() to get a loaded entity by name, and then
>> QEntity::componentsOfType() to get the component.
>> Loaded entities are children of the entity that the QSceneLoader
>> component was assigned to, and components and
>> entities are all QObjects so you can use the normal tree traversal
>> techniques that work with any QObject to find
>> objects by type or name.
>>
>>
>> Mike
>>
>> > On 3 Aug 2022, at 00:14, Nicholas Yue  wrote:
>> >
>> > Thank you Mike.
>> >
>> > Follow up question:
>> >
>> > Given a
>> >
>> > ```
>> > Qt3DRender::QSceneLoader *sceneLoader;
>> > ```
>> >
>> > How do we get at this QGeometryRenderer object to be able to call the
>> impliciteMinPoint (), impliciteMaxPoint () properties ?
>> >
>> > Cheers
>> >
>> > On Tue, 2 Aug 2022 at 05:56, Mike Krus  wrote:
>> > Hi
>> >
>> > if you are using Qt6, then yes.
>> >
>> > For a specific object, QGeometryRenderer derives from QBoundingVolume
>> which has impliciteMinPoint and impliciteMaxPoint properties.
>> >
>> > If you’re interested in the bounding volume of a portion of the scene
>> graph, all a QBoundingVolume component at the root and the
>> > same properties will be updated.
>> >
>> > In Qt5, the QGeometry node associated with each render has similar
>> min/max properties (note that they only valid if the mesh uses all the
>> geometry).
>> >
>> > Hope this helps,
>> >
>> > Mike
>> >
>> >
>> > > On 1 Aug 2022, at 16:05, Nicholas Yue  wrote:
>> > >
>> > > Hi,
>> > >
>> > >   I am diving into the geometry scene via QSceneLoader.
>> > >
>> > >   Using the following code as a starting point, I wish to place the
>> camera such that it automatically accommodates scenes of different sizes.
>> > >
>> > >   One way I am thinking of doing is to base on the scene geometry
>> bounding box.
>> > >
>> > >   Is there a method or API which I can call to query the entire scene
>> geometry bounding box ? Or do I have to walk the entire scene to build that
>> up by querying the bounding box for every geometry in the scene ?
>> > >
>> > >   Any sample code I can view to get me going ?
>> > >
>> > > ```
>> > >
>> /
>> > > **
>> > > ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
>> > > ** Contact: https://www.qt.io/licensing/
>> > > **
>> > > ** This file is part of the Qt3D module of the Qt Toolkit.
>> > > **
>> > > ** $QT_BEGIN_LICENSE:BSD$
>> > > ** Commercial License Usage
>> > > ** Licensees holding valid commercial Qt licenses may use this file in
>> > > ** accordance with the commercial license agreement provided with the
>> > > ** Software or, alternatively, in accordance with the terms contained
>> in
>> > > ** a written agreement between you and The Qt Company. For licensing
>> terms
>> > > ** and conditions see 

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-03 Thread Nicholas Yue
I have the following code

```
void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
{
Qt3DCore::QNodeVector nodes = e->childNodes();
for (int i = 0; i < nodes.count(); ++i) {
Qt3DCore::QNode *node = nodes[i];
Qt3DCore::QEntity *entity = qobject_cast(node);
if (entity) {
QString indent;
indent.fill(' ', depth * 2);
qDebug().noquote() << indent << "Entity:" << entity <<
"Components:" << entity->components();

{
// Question about BoundingVolume
qDebug() << "BoundingVolume: " << entity->objectName();
const QList
myQGeometryRenderer =
entity->componentsOfType();
if (!myQGeometryRenderer.isEmpty())
{
Qt3DRender::QGeometryRenderer *gr = myQGeometryRenderer[0];
QVector3D minPoint = gr->implicitMinPoint();
QVector3D maxPoint = gr->implicitMaxPoint();
qDebug() << "minPoint: " << minPoint;
qDebug() << "maxPoint: " << maxPoint;
}
}
walkEntity(entity, depth + 1);
}
}
}
```

But I got the (0,0,0) for both the min/max point

```
Status changed: Qt3DRender::QSceneLoader::Loading
Status changed: Qt3DRender::QSceneLoader::Ready
 Entity: Qt3DCore::QEntity(0x7f65dc004660, name = untitled.obj) Components:
QList(Qt3DCore::QTransform(0x7f65dc04c590))
   Entity: Qt3DCore::QEntity(0x7f65dc019220, name = Suzanne) Components:
QList(Qt3DExtras::QPhongMaterial(0x7f65dc01bf30, name = DefaultMaterial),
Qt3DRender::QGeometryRenderer(0x7f65dc00c4d0),
Qt3DCore::QTransform(0x7f65dc045800))
BoundingVolume:  "Suzanne"
minPoint:  QVector3D(0, 0, 0)
maxPoint:  QVector3D(0, 0, 0)
BoundingVolume:  "untitled.obj"
```

I am using Qt 6.2.2 on Ubuntu

Cheers

On Wed, 3 Aug 2022 at 01:25, Mike Krus  wrote:

> Hi
>
> once the scene is loaded (ie, the status is Ready, keeping in mind loading
> is asynchronous), you can use
> QSceneLoader::entity() to get a loaded entity by name, and then
> QEntity::componentsOfType() to get the component.
> Loaded entities are children of the entity that the QSceneLoader component
> was assigned to, and components and
> entities are all QObjects so you can use the normal tree traversal
> techniques that work with any QObject to find
> objects by type or name.
>
>
> Mike
>
> > On 3 Aug 2022, at 00:14, Nicholas Yue  wrote:
> >
> > Thank you Mike.
> >
> > Follow up question:
> >
> > Given a
> >
> > ```
> > Qt3DRender::QSceneLoader *sceneLoader;
> > ```
> >
> > How do we get at this QGeometryRenderer object to be able to call the
> impliciteMinPoint (), impliciteMaxPoint () properties ?
> >
> > Cheers
> >
> > On Tue, 2 Aug 2022 at 05:56, Mike Krus  wrote:
> > Hi
> >
> > if you are using Qt6, then yes.
> >
> > For a specific object, QGeometryRenderer derives from QBoundingVolume
> which has impliciteMinPoint and impliciteMaxPoint properties.
> >
> > If you’re interested in the bounding volume of a portion of the scene
> graph, all a QBoundingVolume component at the root and the
> > same properties will be updated.
> >
> > In Qt5, the QGeometry node associated with each render has similar
> min/max properties (note that they only valid if the mesh uses all the
> geometry).
> >
> > Hope this helps,
> >
> > Mike
> >
> >
> > > On 1 Aug 2022, at 16:05, Nicholas Yue  wrote:
> > >
> > > Hi,
> > >
> > >   I am diving into the geometry scene via QSceneLoader.
> > >
> > >   Using the following code as a starting point, I wish to place the
> camera such that it automatically accommodates scenes of different sizes.
> > >
> > >   One way I am thinking of doing is to base on the scene geometry
> bounding box.
> > >
> > >   Is there a method or API which I can call to query the entire scene
> geometry bounding box ? Or do I have to walk the entire scene to build that
> up by querying the bounding box for every geometry in the scene ?
> > >
> > >   Any sample code I can view to get me going ?
> > >
> > > ```
> > >
> /
> > > **
> > > ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
> > > ** Contact: https://www.qt.io/licensing/
> > > **
> > > ** This file is part of the Qt3D module of the Qt Toolkit.
> > > **
> > > ** $QT_BEGIN_LICENSE:BSD$
> > > ** Commercial License Usage
> > > ** Licensees holding valid commercial Qt licenses may use this file in
> > > ** accordance with the commercial license agreement provided with the
> > > ** Software or, alternatively, in accordance with the terms contained
> in
> > > ** a written agreement between you and The Qt Company. For licensing
> terms
> > > ** and conditions see https://www.qt.io/terms-conditions. For further
> > > ** information use the contact form at https://www.qt.io/contact-us.
> > > **
> > > ** BSD License Usage
> > > ** Alternatively, you may use this file under the terms of the BSD
> license
> > > ** as follows:
> > > **
> > > ** "Redistribution 

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-03 Thread Mike Krus via Interest
Hi

once the scene is loaded (ie, the status is Ready, keeping in mind loading is 
asynchronous), you can use
QSceneLoader::entity() to get a loaded entity by name, and then 
QEntity::componentsOfType() to get the component.
Loaded entities are children of the entity that the QSceneLoader component was 
assigned to, and components and
entities are all QObjects so you can use the normal tree traversal techniques 
that work with any QObject to find
objects by type or name.


Mike

> On 3 Aug 2022, at 00:14, Nicholas Yue  wrote:
>
> Thank you Mike.
>
> Follow up question:
>
> Given a
>
> ```
> Qt3DRender::QSceneLoader *sceneLoader;
> ```
>
> How do we get at this QGeometryRenderer object to be able to call the 
> impliciteMinPoint (), impliciteMaxPoint () properties ?
>
> Cheers
>
> On Tue, 2 Aug 2022 at 05:56, Mike Krus  wrote:
> Hi
>
> if you are using Qt6, then yes.
>
> For a specific object, QGeometryRenderer derives from QBoundingVolume which 
> has impliciteMinPoint and impliciteMaxPoint properties.
>
> If you’re interested in the bounding volume of a portion of the scene graph, 
> all a QBoundingVolume component at the root and the
> same properties will be updated.
>
> In Qt5, the QGeometry node associated with each render has similar min/max 
> properties (note that they only valid if the mesh uses all the geometry).
>
> Hope this helps,
>
> Mike
>
>
> > On 1 Aug 2022, at 16:05, Nicholas Yue  wrote:
> >
> > Hi,
> >
> >   I am diving into the geometry scene via QSceneLoader.
> >
> >   Using the following code as a starting point, I wish to place the camera 
> > such that it automatically accommodates scenes of different sizes.
> >
> >   One way I am thinking of doing is to base on the scene geometry bounding 
> > box.
> >
> >   Is there a method or API which I can call to query the entire scene 
> > geometry bounding box ? Or do I have to walk the entire scene to build that 
> > up by querying the bounding box for every geometry in the scene ?
> >
> >   Any sample code I can view to get me going ?
> >
> > ```
> > /
> > **
> > ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
> > ** Contact: https://www.qt.io/licensing/
> > **
> > ** This file is part of the Qt3D module of the Qt Toolkit.
> > **
> > ** $QT_BEGIN_LICENSE:BSD$
> > ** Commercial License Usage
> > ** Licensees holding valid commercial Qt licenses may use this file in
> > ** accordance with the commercial license agreement provided with the
> > ** Software or, alternatively, in accordance with the terms contained in
> > ** a written agreement between you and The Qt Company. For licensing terms
> > ** and conditions see https://www.qt.io/terms-conditions. For further
> > ** information use the contact form at https://www.qt.io/contact-us.
> > **
> > ** BSD License Usage
> > ** Alternatively, you may use this file under the terms of the BSD license
> > ** as follows:
> > **
> > ** "Redistribution and use in source and binary forms, with or without
> > ** modification, are permitted provided that the following conditions are
> > ** met:
> > **   * Redistributions of source code must retain the above copyright
> > ** notice, this list of conditions and the following disclaimer.
> > **   * Redistributions in binary form must reproduce the above copyright
> > ** notice, this list of conditions and the following disclaimer in
> > ** the documentation and/or other materials provided with the
> > ** distribution.
> > **   * Neither the name of The Qt Company Ltd nor the names of its
> > ** contributors may be used to endorse or promote products derived
> > ** from this software without specific prior written permission.
> > **
> > **
> > ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> > ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> > ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> > ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> > ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> > ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> > ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
> > **
> > ** $QT_END_LICENSE$
> > **
> > /
> >
> > #include 
> > #include 
> >
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > // #include 
> > #include "MyCameraController.h"
> > #include "TrackballCameraController.h"
> >
> > class SceneWalker : public 

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-02 Thread Nicholas Yue
Thank you Mike.

Follow up question:

Given a

```
Qt3DRender::QSceneLoader *sceneLoader;
```

How do we get at this QGeometryRenderer object to be able to call the
impliciteMinPoint (), impliciteMaxPoint () properties ?

Cheers

On Tue, 2 Aug 2022 at 05:56, Mike Krus  wrote:

> Hi
>
> if you are using Qt6, then yes.
>
> For a specific object, QGeometryRenderer derives from QBoundingVolume
> which has impliciteMinPoint and impliciteMaxPoint properties.
>
> If you’re interested in the bounding volume of a portion of the scene
> graph, all a QBoundingVolume component at the root and the
> same properties will be updated.
>
> In Qt5, the QGeometry node associated with each render has similar min/max
> properties (note that they only valid if the mesh uses all the geometry).
>
> Hope this helps,
>
> Mike
>
>
> > On 1 Aug 2022, at 16:05, Nicholas Yue  wrote:
> >
> > Hi,
> >
> >   I am diving into the geometry scene via QSceneLoader.
> >
> >   Using the following code as a starting point, I wish to place the
> camera such that it automatically accommodates scenes of different sizes.
> >
> >   One way I am thinking of doing is to base on the scene geometry
> bounding box.
> >
> >   Is there a method or API which I can call to query the entire scene
> geometry bounding box ? Or do I have to walk the entire scene to build that
> up by querying the bounding box for every geometry in the scene ?
> >
> >   Any sample code I can view to get me going ?
> >
> > ```
> >
> /
> > **
> > ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
> > ** Contact: https://www.qt.io/licensing/
> > **
> > ** This file is part of the Qt3D module of the Qt Toolkit.
> > **
> > ** $QT_BEGIN_LICENSE:BSD$
> > ** Commercial License Usage
> > ** Licensees holding valid commercial Qt licenses may use this file in
> > ** accordance with the commercial license agreement provided with the
> > ** Software or, alternatively, in accordance with the terms contained in
> > ** a written agreement between you and The Qt Company. For licensing
> terms
> > ** and conditions see https://www.qt.io/terms-conditions. For further
> > ** information use the contact form at https://www.qt.io/contact-us.
> > **
> > ** BSD License Usage
> > ** Alternatively, you may use this file under the terms of the BSD
> license
> > ** as follows:
> > **
> > ** "Redistribution and use in source and binary forms, with or without
> > ** modification, are permitted provided that the following conditions are
> > ** met:
> > **   * Redistributions of source code must retain the above copyright
> > ** notice, this list of conditions and the following disclaimer.
> > **   * Redistributions in binary form must reproduce the above copyright
> > ** notice, this list of conditions and the following disclaimer in
> > ** the documentation and/or other materials provided with the
> > ** distribution.
> > **   * Neither the name of The Qt Company Ltd nor the names of its
> > ** contributors may be used to endorse or promote products derived
> > ** from this software without specific prior written permission.
> > **
> > **
> > ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> > ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> > ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> > ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> > ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> > ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> > ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> > ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> > ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
> > **
> > ** $QT_END_LICENSE$
> > **
> >
> /
> >
> > #include 
> > #include 
> >
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > // #include 
> > #include "MyCameraController.h"
> > #include "TrackballCameraController.h"
> >
> > class SceneWalker : public QObject
> > {
> > public:
> > SceneWalker(Qt3DRender::QSceneLoader *loader) : m_loader(loader) { }
> >
> > void onStatusChanged();
> >
> > private:
> > void walkEntity(Qt3DCore::QEntity *e, int depth = 0);
> >
> > Qt3DRender::QSceneLoader *m_loader;
> > };
> >
> > void SceneWalker::onStatusChanged()
> > {
> > qDebug() << "Status changed:" << m_loader->status();
> > if (m_loader->status() != Qt3DRender::QSceneLoader::Ready)
> > return;
> >
> > // The QSceneLoader instance is a component of an entity. The loaded
> scene
> >

Re: [Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-02 Thread Mike Krus via Interest
Hi

if you are using Qt6, then yes.

For a specific object, QGeometryRenderer derives from QBoundingVolume which has 
impliciteMinPoint and impliciteMaxPoint properties.

If you’re interested in the bounding volume of a portion of the scene graph, 
all a QBoundingVolume component at the root and the
same properties will be updated.

In Qt5, the QGeometry node associated with each render has similar min/max 
properties (note that they only valid if the mesh uses all the geometry).

Hope this helps,

Mike


> On 1 Aug 2022, at 16:05, Nicholas Yue  wrote:
>
> Hi,
>
>   I am diving into the geometry scene via QSceneLoader.
>
>   Using the following code as a starting point, I wish to place the camera 
> such that it automatically accommodates scenes of different sizes.
>
>   One way I am thinking of doing is to base on the scene geometry bounding 
> box.
>
>   Is there a method or API which I can call to query the entire scene 
> geometry bounding box ? Or do I have to walk the entire scene to build that 
> up by querying the bounding box for every geometry in the scene ?
>
>   Any sample code I can view to get me going ?
>
> ```
> /
> **
> ** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
> ** Contact: https://www.qt.io/licensing/
> **
> ** This file is part of the Qt3D module of the Qt Toolkit.
> **
> ** $QT_BEGIN_LICENSE:BSD$
> ** Commercial License Usage
> ** Licensees holding valid commercial Qt licenses may use this file in
> ** accordance with the commercial license agreement provided with the
> ** Software or, alternatively, in accordance with the terms contained in
> ** a written agreement between you and The Qt Company. For licensing terms
> ** and conditions see https://www.qt.io/terms-conditions. For further
> ** information use the contact form at https://www.qt.io/contact-us.
> **
> ** BSD License Usage
> ** Alternatively, you may use this file under the terms of the BSD license
> ** as follows:
> **
> ** "Redistribution and use in source and binary forms, with or without
> ** modification, are permitted provided that the following conditions are
> ** met:
> **   * Redistributions of source code must retain the above copyright
> ** notice, this list of conditions and the following disclaimer.
> **   * Redistributions in binary form must reproduce the above copyright
> ** notice, this list of conditions and the following disclaimer in
> ** the documentation and/or other materials provided with the
> ** distribution.
> **   * Neither the name of The Qt Company Ltd nor the names of its
> ** contributors may be used to endorse or promote products derived
> ** from this software without specific prior written permission.
> **
> **
> ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
> **
> ** $QT_END_LICENSE$
> **
> /
>
> #include 
> #include 
>
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> // #include 
> #include "MyCameraController.h"
> #include "TrackballCameraController.h"
>
> class SceneWalker : public QObject
> {
> public:
> SceneWalker(Qt3DRender::QSceneLoader *loader) : m_loader(loader) { }
>
> void onStatusChanged();
>
> private:
> void walkEntity(Qt3DCore::QEntity *e, int depth = 0);
>
> Qt3DRender::QSceneLoader *m_loader;
> };
>
> void SceneWalker::onStatusChanged()
> {
> qDebug() << "Status changed:" << m_loader->status();
> if (m_loader->status() != Qt3DRender::QSceneLoader::Ready)
> return;
>
> // The QSceneLoader instance is a component of an entity. The loaded scene
> // tree is added under this entity.
> QVector entities = m_loader->entities();
>
> // Technically there could be multiple entities referencing the scene 
> loader
> // but sharing is discouraged, and in our case there will be one anyhow.
> if (entities.isEmpty())
> return;
> Qt3DCore::QEntity *root = entities[0];
> // Print the tree.
> walkEntity(root);
>
> // To access a given node (like a named mesh in the scene), use 
> QObject::findChild().
> // The scene 

[Interest] Qt3D : QSceneLoader - determining scene level geometry bounding box

2022-08-01 Thread Nicholas Yue
Hi,

  I am diving into the geometry scene via QSceneLoader.

  Using the following code as a starting point, I wish to place the camera
such that it automatically accommodates scenes of different sizes.

  One way I am thinking of doing is to base on the scene geometry bounding
box.

  Is there a method or API which I can call to query the entire scene
geometry bounding box ? Or do I have to walk the entire scene to build that
up by querying the bounding box for every geometry in the scene ?

  Any sample code I can view to get me going ?

```
/
**
** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
**   * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**   * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
**   * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
/

#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
// #include 
#include "MyCameraController.h"
#include "TrackballCameraController.h"

class SceneWalker : public QObject
{
public:
SceneWalker(Qt3DRender::QSceneLoader *loader) : m_loader(loader) { }

void onStatusChanged();

private:
void walkEntity(Qt3DCore::QEntity *e, int depth = 0);

Qt3DRender::QSceneLoader *m_loader;
};

void SceneWalker::onStatusChanged()
{
qDebug() << "Status changed:" << m_loader->status();
if (m_loader->status() != Qt3DRender::QSceneLoader::Ready)
return;

// The QSceneLoader instance is a component of an entity. The loaded
scene
// tree is added under this entity.
QVector entities = m_loader->entities();

// Technically there could be multiple entities referencing the scene
loader
// but sharing is discouraged, and in our case there will be one anyhow.
if (entities.isEmpty())
return;
Qt3DCore::QEntity *root = entities[0];
// Print the tree.
walkEntity(root);

// To access a given node (like a named mesh in the scene), use
QObject::findChild().
// The scene structure and names always depend on the asset.
Qt3DCore::QEntity *e = root->findChild(QStringLiteral("PlanePropeller_mesh")); // toyplane.obj
if (e)
qDebug() << "Found propeller node" << e << "with components" <<
e->components();
}

void SceneWalker::walkEntity(Qt3DCore::QEntity *e, int depth)
{
Qt3DCore::QNodeVector nodes = e->childNodes();
for (int i = 0; i < nodes.count(); ++i) {
Qt3DCore::QNode *node = nodes[i];
Qt3DCore::QEntity *entity = qobject_cast(node);
if (entity) {
QString indent;
indent.fill(' ', depth * 2);
qDebug().noquote() << indent << "Entity:" << entity <<
"Components:" << entity->components();
walkEntity(entity, depth + 1);
}
}
}

int main(int ac, 

Re: [Interest] Qt3D/C++: How to disable rendering while makeing changes to the the Scenegraph

2022-06-20 Thread Yves Maurischat





Am 20.06.22 um 10:08 schrieb Mike Krus:

Hi



On 20 Jun 2022, at 08:37, Yves Maurischat  wrote:

Hi all,

I've got a C++/QWidgets application with 2 Qt3DWindow embedded. The 3D windows 
can be hidden (i.e. the user switches to another view), while work is done in 
other parts of the application. Whenever the user switches back to the view 
with the embedded Qt3DWindow there are a lot of changes to be made to the 
scenegraph.

Rendering is set to OnDemand, but whenever the view is switched back to the 3D 
windows there is a big lag, up to several seconds. Profiling the application 
has shown that a lot of work is done for rendering at that point because the 
scenegraph is changing (most time is spent in the material classes).

My working theory is, that each change to the scenegraph (i.e. removing 
entities, adding a new ones) causes a separate render update, which leads to 
the lag due to the amount of separate changes.

that is not correct, updates are batched on a per-frame basis. If you’re not 
scheduling frames, no updates will be made.

If you are using Qt version 5.15.0 or later this should be pretty fast. Prior 
version had a slower update mechanism.


I'm on Qt 5.14.2 for the application, but this is a reason to switch to 
Qt 5.15.x




One thing to keep in mind though is that changing materials will lead shaders 
needing to be recompiled, potentially textures to be updates, etc. Changing 
geometry means bounding volumes need updating, buffers need to be uploaded, etc.
So the time might just be due to the GL state needing to be updated. You should 
take care to minimise such changes.


I see. Currently large parts of the scenegraph are removed for an update 
but I guess I could optimize changes so only the absolute necessary 
parts are modified. Thanks!





Another thing to note, if you have 2 Qt3DWindows, then you have 2 underlying 
Qt3DEngine instances. These do not share resources so everything might be done 
twice.

Of course it’s impossible to provide accurate feedback without profiling the 
actual code.


Mike



So my question is: Is there a way to disable all render updates until the scenegraph has 
been updated/modified completely? What would be the "correct" way to make such 
changes? Is there  something similar to the beginResetModel() and endResetModel() methods 
in QAbstractItemModel?


Thanks!

Yves



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D/C++: How to disable rendering while makeing changes to the the Scenegraph

2022-06-20 Thread Mike Krus via Interest
Hi


> On 20 Jun 2022, at 08:37, Yves Maurischat  
> wrote:
>
> Hi all,
>
> I've got a C++/QWidgets application with 2 Qt3DWindow embedded. The 3D 
> windows can be hidden (i.e. the user switches to another view), while work is 
> done in other parts of the application. Whenever the user switches back to 
> the view with the embedded Qt3DWindow there are a lot of changes to be made 
> to the scenegraph.
>
> Rendering is set to OnDemand, but whenever the view is switched back to the 
> 3D windows there is a big lag, up to several seconds. Profiling the 
> application has shown that a lot of work is done for rendering at that point 
> because the scenegraph is changing (most time is spent in the material 
> classes).
>
> My working theory is, that each change to the scenegraph (i.e. removing 
> entities, adding a new ones) causes a separate render update, which leads to 
> the lag due to the amount of separate changes.
that is not correct, updates are batched on a per-frame basis. If you’re not 
scheduling frames, no updates will be made.

If you are using Qt version 5.15.0 or later this should be pretty fast. Prior 
version had a slower update mechanism.

One thing to keep in mind though is that changing materials will lead shaders 
needing to be recompiled, potentially textures to be updates, etc. Changing 
geometry means bounding volumes need updating, buffers need to be uploaded, etc.
So the time might just be due to the GL state needing to be updated. You should 
take care to minimise such changes.

Another thing to note, if you have 2 Qt3DWindows, then you have 2 underlying 
Qt3DEngine instances. These do not share resources so everything might be done 
twice.

Of course it’s impossible to provide accurate feedback without profiling the 
actual code.


Mike


> So my question is: Is there a way to disable all render updates until the 
> scenegraph has been updated/modified completely? What would be the "correct" 
> way to make such changes? Is there  something similar to the 
> beginResetModel() and endResetModel() methods in QAbstractItemModel?
>
>
> Thanks!
>
> Yves
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D/C++: How to disable rendering while makeing changes to the the Scenegraph

2022-06-20 Thread Yves Maurischat

Hi all,

I've got a C++/QWidgets application with 2 Qt3DWindow embedded. The 3D 
windows can be hidden (i.e. the user switches to another view), while 
work is done in other parts of the application. Whenever the user 
switches back to the view with the embedded Qt3DWindow there are a lot 
of changes to be made to the scenegraph.


Rendering is set to /OnDemand/, but whenever the view is switched back 
to the 3D windows there is a big lag, up to several seconds. Profiling 
the application has shown that a lot of work is done for rendering at 
that point because the scenegraph is changing (most time is spent in the 
material classes).


My working theory is, that each change to the scenegraph (i.e. removing 
entities, adding a new ones) causes a separate render update, which 
leads to the lag due to the amount of separate changes.


So my question is: Is there a way to disable all render updates until 
the scenegraph has been updated/modified completely? What would be the 
"correct" way to make such changes? Is there something similar to the 
beginResetModel() and endResetModel() methods in QAbstractItemModel?



Thanks!

Yves


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-25 Thread Alex john
On Mon, Mar 22, 2021 at 10:55 AM Alex john  wrote:

> Transform {
> id: trefoilMeshTransform
> translation:Qt.vector3d(Qt.vector2D(100, 100)).unproject(
> modelView ,mainCam.projectionMatrix, forwardRenderer.viewportRect)
> property real theta: 0.0
> property real phi:0.0
> property real roll: 0.0
> rotation: fromEulerAngles(theta, phi, roll)
> scale: root.scale
> }


I used the following function to get the 3d coordinates using the 2d,
by refering to the source code
https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.cpp.html#_ZNK9QVector3D9unprojectERK10QMatrix4x4S2_RK5QRect
I need to render the 3d cube exactly where the Rectangle{x:100, y:100}
renders however there is lot of offset and I think the calculations is
somewhere going wrong. Can clue ?

function projectPointsto3d(){
var ptX = 100
var ptY = 100
var windowPt = Qt.vector4d(ptX,ptY,1,1)
var mat = mainCam.projectionMatrix.times(mainCam.viewMatrix)
var inverse = mat.inverted()

var normalize =  Qt.vector4d(1,1,1,1)
windowPt.x = (windowPt.x -
forwardRenderer.viewportRect.x)/forwardRenderer.viewportRect.width
windowPt.y = (windowPt.y -
forwardRenderer.viewportRect.y)/forwardRenderer.viewportRect.height

windowPt = windowPt.times(2).minus(normalize)

var a = inverse.times(windowPt)
var division = a.w (if i use (1/a.w) teh 3d values will be
very high and I do not see object)
a = a.times(division)
return a.toVector3d()
}
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-24 Thread Alex john
On Mon, Mar 22, 2021 at 10:55 AM Alex john  wrote:
>
> On Thu, Mar 18, 2021 at 5:22 AM Walter Rawdanik  wrote:
> >
> > You can’t convert 2d coordinates to a 3d position because you are missing 
> > the z coordinate.
>
> I can have a dummy z value as 1 for the calculation. The problem is
> similar  as described here
> https://community.khronos.org/t/getting-2d-to-3d/20050/6 in opengl
> they could fetch the requirted matrix for gluUnProject and get the 3d
> coordinates from 2d. However, in Qt3d, I'm stuck to fetch the required
> matrix i.e modelView etc and pass it correctly to the
> vector3d::uproject and get the corresponding 3d points back. All I
> could do is the following, however I doubt the correctness of it.
>
> // The code is exactly same as wireframe example file TrefoilKnot.qml
>
> Transform {
> id: trefoilMeshTransform
> translation:Qt.vector3d(Qt.vector2D(100, 100)).unproject(
> modelView ,mainCam.projectionMatrix, forwardRenderer.viewportRect)
> property real theta: 0.0
> property real phi:0.0
> property real roll: 0.0
> rotation: fromEulerAngles(theta, phi, roll)
> scale: root.scale
> }
>
> In translation, Qt.vector2D(100, 100) is where I give the x,y (window
> coordinates) and expect the unproject api will return the 3d points
> for translation. mainCam.projectionMatrix and
> forwardRenderer.viewportRect are set from BasicCamera and
> Forwardrenderer from main.qml respectively. And I do not know where to
> get modelView. If you let me know the modelView matrix and confirm the
> above changes are right,  I'll be thankful.
>
> Do let me know.

Can anyone let me know about this?
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-21 Thread Alex john
On Thu, Mar 18, 2021 at 5:22 AM Walter Rawdanik  wrote:
>
> You can’t convert 2d coordinates to a 3d position because you are missing the 
> z coordinate.

I can have a dummy z value as 1 for the calculation. The problem is
similar  as described here
https://community.khronos.org/t/getting-2d-to-3d/20050/6 in opengl
they could fetch the requirted matrix for gluUnProject and get the 3d
coordinates from 2d. However, in Qt3d, I'm stuck to fetch the required
matrix i.e modelView etc and pass it correctly to the
vector3d::uproject and get the corresponding 3d points back. All I
could do is the following, however I doubt the correctness of it.

// The code is exactly same as wireframe example file TrefoilKnot.qml

Transform {
id: trefoilMeshTransform
translation:Qt.vector3d(Qt.vector2D(100, 100)).unproject(
modelView ,mainCam.projectionMatrix, forwardRenderer.viewportRect)
property real theta: 0.0
property real phi:0.0
property real roll: 0.0
rotation: fromEulerAngles(theta, phi, roll)
scale: root.scale
}

In translation, Qt.vector2D(100, 100) is where I give the x,y (window
coordinates) and expect the unproject api will return the 3d points
for translation. mainCam.projectionMatrix and
forwardRenderer.viewportRect are set from BasicCamera and
Forwardrenderer from main.qml respectively. And I do not know where to
get modelView. If you let me know the modelView matrix and confirm the
above changes are right,  I'll be thankful.

Do let me know.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-17 Thread Walter Rawdanik
You can’t convert 2d coordinates to a 3d position because you are missing the z 
coordinate. It is similar problem like with picking objects in a 3D scene - you 
can unproject a 2d screen coordinate to a vector/ray in your 3d scene and then 
do a ray casting to see what you hit but that’s about it.
If you just want to render a 3D object at a specific location on a screen you 
can do so via rendering to an offscreen target and then displaying it like a 
regular 2d image but that will look and act like an overlay image rather than 
being composed into your scene.

Sent from my iPad

> On Mar 16, 2021, at 10:52 AM, Alex john  wrote:
> 
> 
> 
> 
> I did the following changes to the wireframe example (Trefoilknot.qml file 
> translation property of transform) but still unable to get the modelView 
> Matrix,  and also not sure whether the following changes to translation are 
> right If anyone can confirm and let me know
> 
> property var mainCam   // got the mainCamera ID from main.qml (wireframe 
> example)
> property var forwardRenderer //forwardRendered id from main.qml (wireframe 
> example)
> 
>  Transform {
> id: trefoilMeshTransform
> translation:Qt.vector3d(Qt.vector2D(4, 4)).unproject( *modelView* 
> ,mainCam.projectionMatrix, forwardRenderer.viewportRect)
> property real theta: 0.0
> property real phi: 0.0
> property real roll: 0.0
> rotation: fromEulerAngles(theta, phi, roll)
> scale: root.scale
> }
> /*
>  translation : Qt.vector2D(100, 100) is where I intend to give window 2d 
> coordinates(here its x:100, y:100)and I assume that unproject api will 
> convert the 2d points to 3d and renders the 3d object exactly at 100, 100 
> pixel 2d location
> */
> 
> I got the projectionMatrix from camera, viewPortRect from ForwardRenderer in 
> Rendering settings. I'm completely stuck for this step. If anyone can please 
> confirm the changes and let me know the modelView matrix.
> 
> 
>> On Mon, Mar 15, 2021 at 5:14 PM Alex john  wrote:
>> > Going the other way round (back-projection) can be done by e.g. 
>> > QVector3D::unproject()
>> 
>> Thanks, as I'm referring the the wireframe example I was able to get
>> the camera projection matrix from Camera Qml.  However, I'm unsure how
>> to get the ModelView matrix and the viewport.
>> 
>> As I have loaded my custom obj in wireframe example and using the same
>> geometry and camera settings as its for wireframe, therefore can you
>> please let me know how this can be done at QML side? I did try to find
>> this in the documentation but didn't find the usage.
>> 
>> 
>> 
>> 
>> > On Mon, Mar 15, 2021 at 11:03 AM Alex john  wrote:
>> >>
>> >> Hello ,
>> >>
>> >> Im successessfully able to load the obj file in Scene3D, and by using
>> >> fromEulerAngles I'm able to get the required yaw, pitch and
>> >> roll.However, I'm not able to use the right translation to get the
>> >> object rendered. I get the x,y coordinates in pixels from the other
>> >> module and I need to render the 3d model exactly at that pixel
>> >> location. It turns out that the Transform type has translation and it
>> >> takes the input in 3d coordinates (not sure which unit) if I try to
>> >> assign the x,y coordinates to the 3d coordinates it renders somewhere
>> >> else. Seems like the x,y in the translation is not the pixel 2d
>> >> values, as even with a x=0.3 it deflects more than expected.
>> >>
>> >> Is there a way to assign the x,y 2d pixel values (as we do for
>> >> Rectangle {x: 100, y:100}) to the translation so that it is rendered
>> >> to the right place where it's desired.
>> >> ___
>> >> Interest mailing list
>> >> Interest@qt-project.org
>> >> https://lists.qt-project.org/listinfo/interest
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-16 Thread Alex john
I did the following changes to the wireframe example (Trefoilknot.qml file
translation property of transform) but still unable to get the modelView
Matrix,  and also not sure whether the following changes to translation are
right If anyone can confirm and let me know

property var mainCam   // got the mainCamera ID from main.qml (wireframe
example)
property var forwardRenderer //forwardRendered id from main.qml (wireframe
example)

 Transform {
id: trefoilMeshTransform
*translation:Qt.vector3d(Qt.vector2D(4, 4)).unproject( *modelView*
,mainCam.projectionMatrix, forwardRenderer.viewportRect)*
property real theta: 0.0
property real phi: 0.0
property real roll: 0.0
rotation: fromEulerAngles(theta, phi, roll)
scale: root.scale
}
/*
 *translation* : Qt.vector2D(100, 100) is where I intend to give window 2d
coordinates(here its x:100, y:100)and I assume that unproject api will
convert the 2d points to 3d and renders the 3d object exactly at 100, 100
pixel 2d location
*/

I got the projectionMatrix from camera, viewPortRect from ForwardRenderer
in Rendering settings. I'm completely stuck for this step. If anyone can
please confirm the changes and let me know the modelView matrix.


On Mon, Mar 15, 2021 at 5:14 PM Alex john  wrote:

> > Going the other way round (back-projection) can be done by e.g.
> QVector3D::unproject()
>
> Thanks, as I'm referring the the wireframe example I was able to get
> the camera projection matrix from Camera Qml.  However, I'm unsure how
> to get the ModelView matrix and the viewport.
>
> As I have loaded my custom obj in wireframe example and using the same
> geometry and camera settings as its for wireframe, therefore can you
> please let me know how this can be done at QML side? I did try to find
> this in the documentation but didn't find the usage.
>
>
>
>
> > On Mon, Mar 15, 2021 at 11:03 AM Alex john 
> wrote:
> >>
> >> Hello ,
> >>
> >> Im successessfully able to load the obj file in Scene3D, and by using
> >> fromEulerAngles I'm able to get the required yaw, pitch and
> >> roll.However, I'm not able to use the right translation to get the
> >> object rendered. I get the x,y coordinates in pixels from the other
> >> module and I need to render the 3d model exactly at that pixel
> >> location. It turns out that the Transform type has translation and it
> >> takes the input in 3d coordinates (not sure which unit) if I try to
> >> assign the x,y coordinates to the 3d coordinates it renders somewhere
> >> else. Seems like the x,y in the translation is not the pixel 2d
> >> values, as even with a x=0.3 it deflects more than expected.
> >>
> >> Is there a way to assign the x,y 2d pixel values (as we do for
> >> Rectangle {x: 100, y:100}) to the translation so that it is rendered
> >> to the right place where it's desired.
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-15 Thread Alex john
> Going the other way round (back-projection) can be done by e.g. 
> QVector3D::unproject()

Thanks, as I'm referring the the wireframe example I was able to get
the camera projection matrix from Camera Qml.  However, I'm unsure how
to get the ModelView matrix and the viewport.

As I have loaded my custom obj in wireframe example and using the same
geometry and camera settings as its for wireframe, therefore can you
please let me know how this can be done at QML side? I did try to find
this in the documentation but didn't find the usage.




> On Mon, Mar 15, 2021 at 11:03 AM Alex john  wrote:
>>
>> Hello ,
>>
>> Im successessfully able to load the obj file in Scene3D, and by using
>> fromEulerAngles I'm able to get the required yaw, pitch and
>> roll.However, I'm not able to use the right translation to get the
>> object rendered. I get the x,y coordinates in pixels from the other
>> module and I need to render the 3d model exactly at that pixel
>> location. It turns out that the Transform type has translation and it
>> takes the input in 3d coordinates (not sure which unit) if I try to
>> assign the x,y coordinates to the 3d coordinates it renders somewhere
>> else. Seems like the x,y in the translation is not the pixel 2d
>> values, as even with a x=0.3 it deflects more than expected.
>>
>> Is there a way to assign the x,y 2d pixel values (as we do for
>> Rectangle {x: 100, y:100}) to the translation so that it is rendered
>> to the right place where it's desired.
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-15 Thread Federico Ferri
The 3D coordinates are *world coordinates*, and their units is whatever you
like, e.g. you can have a cube of size 0.1, 1, or 100, and with appropriate
camera settings, it will appear the same onto the window/device.

2D *window coordinates* are another thing.

For going to world coords to window coords points are (left) multiplied by
the view matrix, then by the projection matrix, then coordinates are
scaled/translated to render in the window/viewport (this is not specific to
Qt3D, it's just basic OpenGL).

Going the other way round (back-projection) can be done by e.g.
QVector3D::unproject()

On Mon, Mar 15, 2021 at 11:03 AM Alex john  wrote:

> Hello ,
>
> Im successessfully able to load the obj file in Scene3D, and by using
> fromEulerAngles I'm able to get the required yaw, pitch and
> roll.However, I'm not able to use the right translation to get the
> object rendered. I get the x,y coordinates in pixels from the other
> module and I need to render the 3d model exactly at that pixel
> location. It turns out that the Transform type has translation and it
> takes the input in 3d coordinates (not sure which unit) if I try to
> assign the x,y coordinates to the 3d coordinates it renders somewhere
> else. Seems like the x,y in the translation is not the pixel 2d
> values, as even with a x=0.3 it deflects more than expected.
>
> Is there a way to assign the x,y 2d pixel values (as we do for
> Rectangle {x: 100, y:100}) to the translation so that it is rendered
> to the right place where it's desired.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3d] Rendering 3D object with 2D coordinates

2021-03-15 Thread Alex john
Hello ,

Im successessfully able to load the obj file in Scene3D, and by using
fromEulerAngles I'm able to get the required yaw, pitch and
roll.However, I'm not able to use the right translation to get the
object rendered. I get the x,y coordinates in pixels from the other
module and I need to render the 3d model exactly at that pixel
location. It turns out that the Transform type has translation and it
takes the input in 3d coordinates (not sure which unit) if I try to
assign the x,y coordinates to the 3d coordinates it renders somewhere
else. Seems like the x,y in the translation is not the pixel 2d
values, as even with a x=0.3 it deflects more than expected.

Is there a way to assign the x,y 2d pixel values (as we do for
Rectangle {x: 100, y:100}) to the translation so that it is rendered
to the right place where it's desired.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D FPS computations aspects

2020-10-08 Thread Oleg Evseev
Hi all,

In our 3d application we used to check the performance using FPS display
based on qt3d-planets example: frames are accumulated in onTriggered action
of FrameAction component of root 3d entity and displayed every second:
https://doc.qt.io/qt-5.9/qt3d-planets-qml-fpsdisplay-qml.html
https://doc.qt.io/qt-5.9/qt3d-planets-qml-solarsystem-qml.html

We look at fps on several devices: windows, android and embedded linux
(using eglfs). And it seemed to be ok.

Now on the new x86 yocto linux device with weston 2.0.0 wayland we see
unusual fps behaviour.

Static Scene3D with several quick control buttons on top of the scene.
1) FPS is stable and around 60 fps if the application is drawn as weston
window with screen size regardless of the Qt3DRender policy
OnDemand/Always.
2) if the application is drawn fullscreen ("visibility: Window.FullScreen"
or "flags: Qt.FramelessWindowHint" is set), fps is 60 on start but then
drop down and stays around 30 (and sometimes jumps for a while to around
40, 50 or 60) if Qt3DRender policy OnDemand.
I don't see any lags. If 3d scene is changing (camera rotation around 3d
model) fps increases to 50-60.
3) If Qt3DRender policy is Always then stable 60 fps is shown.
4) Also 60 fps when a quick item is opened above  the OnDemand 3d scene.

So for now it looks like FrameAction is triggered rarely while OnDemand
policy is on. So lower fps in fact shows better performance?
Can this logic take place only for some device? Or this is something else?
We've never seen such behaviour on other devices while OnDemand policy was
usually used.

Thanks in advance for any thoughts.

---
With regards, Oleg.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D widget

2020-09-04 Thread Florian Blume
I actually succeeded in implementing a Qt3D widget.

It can be found here: https://github.com/florianblume/qt3d-widget.

Unfortunately, I had to use Qt3D's internal classes so it kind of feels
a bit unstable because it might break with certain Qt versions.
I would have liked to leave all processing loops to Qt3D internally but
now have to drive them myself, which also feels a bit not so nice.

Anyways, I hope some other people can make use of it, too!

Best,
Florian

On 02.09.20 12:01, Florian Blume wrote:
> Hey,
>
> thanks for your quick answer!
>
> I actually had the version you described first running. I obtained the
> rendered image using QRenderCapture and then displayed it on the quad.
>
> I also already had the second idea that you described but thought it
> should be possible to obtain the texture from Qt3D and use it in OpenGL
> that's why I hadn't
> investigated this any further.
>
> Unfortunately, it's pretty difficult to run the aspect engine manually.
> I tried to place a processFrame() call in paintGL() - and even placed a
> doRender() call to
> the AbstractRenderer of the QRenderAspectPrivate after it like this:
>
> d->m_aspectEngine->processFrame();
>
> glClearColor(1.0, 1.0, 1.0, 1.0);
> glDisable(GL_BLEND);
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
>
> Qt3DRender::QRenderAspectPrivate *dRenderAspect =
> static_cast
>    
> (Qt3DRender::QRenderAspectPrivate::get(d->m_renderAspect));
> Qt3DRender::Render::AbstractRenderer *renderer = dRenderAspect->m_renderer;
> renderer->doRender(true);
>
> Without the doRender() call it gets stuck the second time processFrame()
> is called - in
> Qt3DRender::Render::VSyncFrameAdvanceService::waitForNextFrame() where it
> tries to acquire a semaphore (which apparently doesn't have any more
> work ready).
>
> With the doRender() call it gets stuck in a similar place - but in the
> first call to paintGL in Qt3DRender::Render::Renderer::isReadyToSubmit()
> where it again tries to
> acquire a semaphore.
>
> I also don't understand whether it's enough that QOpenGLWidget binds a
> framebuffer before calling paintGL, it looks like in Scene3DRenderer
> this is enough to make
> Qt3D draw to that framebuffer.
>
> As you can see there are a lot of open questions which are difficult to
> answer. Do you have any suggestions where/how to look for answers?
> Obviously in the code itself,
> which is also difficult.
>
> Any help is appreciated,
> Florian
>
>
> On 01.09.20 18:28, Mike Krus wrote:
>> Hi
>>
>> Qt 3D source code has an example of how to use render capture in the manual 
>> tests.
>>
>> However this is probably not the right way to do it as 1/ it would require 
>> another FBO on top of the one QOpenGLWidget uses already; 2/ it transfers 
>> the image to the CPU which is not needed here.
>>
>> Think the way to do it is to do something similar to what is done for 
>> Scene3D:
>> - setup Qt 3D engine to be in manual mode (rather than using the simulation 
>> loop)
>>   by calling QAspectEngine::setRunMode(QAspectEngine::Manual)
>> - use QOpenGLWidget and in the paintGL method call 
>> QAspectEngine::processFrame()
>>   to have Qt 3D draw
>>
>> There’s of course lots of other stuff to setup. Might need a dummy offscreen 
>> surface to handle sizing, handling of the context, and a fair amount more.
>>
>> Mike
>>
>>> On 1 Sep 2020, at 16:51, Florian Blume  wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to implement a Qt3D widget since createWindowContainer is not
>>> suitable for me (always draws the Qt3DWindow on top of everything).
>>> I've already asked a Stackverflow question
>>> (https://stackoverflow.com/questions/63686309/use-qt3d-offscreen-rendered-texture-in-opengl)
>>> because I ran into
>>> several issues trying to display an offscreen texture that I render to
>>> with Qt3D in a QOpenGLWidget (it simply doesn't display anything).
>>>
>>> Has anyone some other solution regarding a Qt3D widget?
>>>
>>> Best regards,
>>> Florian
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> https://lists.qt-project.org/listinfo/interest
>> —
>> Mike Krus | mike.k...@kdab.com | Senior Software Engineer
>> KDAB (UK) Ltd., a KDAB Group company
>> Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
>> KDAB - The Qt Experts, C++, OpenGL Experts
>>
>>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D widget

2020-09-02 Thread Florian Blume
Hey,

thanks for your quick answer!

I actually had the version you described first running. I obtained the
rendered image using QRenderCapture and then displayed it on the quad.

I also already had the second idea that you described but thought it
should be possible to obtain the texture from Qt3D and use it in OpenGL
that's why I hadn't
investigated this any further.

Unfortunately, it's pretty difficult to run the aspect engine manually.
I tried to place a processFrame() call in paintGL() - and even placed a
doRender() call to
the AbstractRenderer of the QRenderAspectPrivate after it like this:

d->m_aspectEngine->processFrame();

glClearColor(1.0, 1.0, 1.0, 1.0);
glDisable(GL_BLEND);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Qt3DRender::QRenderAspectPrivate *dRenderAspect =
static_cast
   
(Qt3DRender::QRenderAspectPrivate::get(d->m_renderAspect));
Qt3DRender::Render::AbstractRenderer *renderer = dRenderAspect->m_renderer;
renderer->doRender(true);

Without the doRender() call it gets stuck the second time processFrame()
is called - in
Qt3DRender::Render::VSyncFrameAdvanceService::waitForNextFrame() where it
tries to acquire a semaphore (which apparently doesn't have any more
work ready).

With the doRender() call it gets stuck in a similar place - but in the
first call to paintGL in Qt3DRender::Render::Renderer::isReadyToSubmit()
where it again tries to
acquire a semaphore.

I also don't understand whether it's enough that QOpenGLWidget binds a
framebuffer before calling paintGL, it looks like in Scene3DRenderer
this is enough to make
Qt3D draw to that framebuffer.

As you can see there are a lot of open questions which are difficult to
answer. Do you have any suggestions where/how to look for answers?
Obviously in the code itself,
which is also difficult.

Any help is appreciated,
Florian


On 01.09.20 18:28, Mike Krus wrote:
> Hi
>
> Qt 3D source code has an example of how to use render capture in the manual 
> tests.
>
> However this is probably not the right way to do it as 1/ it would require 
> another FBO on top of the one QOpenGLWidget uses already; 2/ it transfers the 
> image to the CPU which is not needed here.
>
> Think the way to do it is to do something similar to what is done for Scene3D:
> - setup Qt 3D engine to be in manual mode (rather than using the simulation 
> loop)
>   by calling QAspectEngine::setRunMode(QAspectEngine::Manual)
> - use QOpenGLWidget and in the paintGL method call 
> QAspectEngine::processFrame()
>   to have Qt 3D draw
>
> There’s of course lots of other stuff to setup. Might need a dummy offscreen 
> surface to handle sizing, handling of the context, and a fair amount more.
>
> Mike
>
>> On 1 Sep 2020, at 16:51, Florian Blume  wrote:
>>
>> Hi,
>>
>> I'm trying to implement a Qt3D widget since createWindowContainer is not
>> suitable for me (always draws the Qt3DWindow on top of everything).
>> I've already asked a Stackverflow question
>> (https://stackoverflow.com/questions/63686309/use-qt3d-offscreen-rendered-texture-in-opengl)
>> because I ran into
>> several issues trying to display an offscreen texture that I render to
>> with Qt3D in a QOpenGLWidget (it simply doesn't display anything).
>>
>> Has anyone some other solution regarding a Qt3D widget?
>>
>> Best regards,
>> Florian
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest
> —
> Mike Krus | mike.k...@kdab.com | Senior Software Engineer
> KDAB (UK) Ltd., a KDAB Group company
> Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
> KDAB - The Qt Experts, C++, OpenGL Experts
>
>

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D widget

2020-09-01 Thread Mike Krus via Interest
Hi

Qt 3D source code has an example of how to use render capture in the manual 
tests.

However this is probably not the right way to do it as 1/ it would require 
another FBO on top of the one QOpenGLWidget uses already; 2/ it transfers the 
image to the CPU which is not needed here.

Think the way to do it is to do something similar to what is done for Scene3D:
- setup Qt 3D engine to be in manual mode (rather than using the simulation 
loop)
  by calling QAspectEngine::setRunMode(QAspectEngine::Manual)
- use QOpenGLWidget and in the paintGL method call QAspectEngine::processFrame()
  to have Qt 3D draw

There’s of course lots of other stuff to setup. Might need a dummy offscreen 
surface to handle sizing, handling of the context, and a fair amount more.

Mike

> On 1 Sep 2020, at 16:51, Florian Blume  wrote:
> 
> Hi,
> 
> I'm trying to implement a Qt3D widget since createWindowContainer is not
> suitable for me (always draws the Qt3DWindow on top of everything).
> I've already asked a Stackverflow question
> (https://stackoverflow.com/questions/63686309/use-qt3d-offscreen-rendered-texture-in-opengl)
> because I ran into
> several issues trying to display an offscreen texture that I render to
> with Qt3D in a QOpenGLWidget (it simply doesn't display anything).
> 
> Has anyone some other solution regarding a Qt3D widget?
> 
> Best regards,
> Florian
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D widget

2020-09-01 Thread Florian Blume
Hi,

I'm trying to implement a Qt3D widget since createWindowContainer is not
suitable for me (always draws the Qt3DWindow on top of everything).
I've already asked a Stackverflow question
(https://stackoverflow.com/questions/63686309/use-qt3d-offscreen-rendered-texture-in-opengl)
because I ran into
several issues trying to display an offscreen texture that I render to
with Qt3D in a QOpenGLWidget (it simply doesn't display anything).

Has anyone some other solution regarding a Qt3D widget?

Best regards,
Florian
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D Scene2D Multisampling

2020-06-20 Thread Daniel Proksch
I am attaching a Texture2DMultisample to the output of a Scene2D object in QML 
and I don't see a property to explicitly enable multisample rendering.
Rendering doesn't seem to work (texture stays black) so I am wondering is 
multisampling at all supported by Scene2D?

Thanks!
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D - Deploying renderer plugins introduced in Qt 5.15

2020-06-04 Thread Esch Lorenz TU Ilmenau
Hi,

thanks for the patches. I created a bug report a couple of days ago: 
https://bugreports.qt.io/browse/QTBUG-84576

In terms of linuxeployqt the following worked for me:

linuxdeployqt-continuous-x86_64.AppImage yourQt3DAppName 
-extra-plugins=renderers

Best,

Lorenz

Von: Paul Lemire 
Gesendet: Donnerstag, 4. Juni 2020 04:57
An: Esch Lorenz TU Ilmenau ; interest@qt-project.org
Betreff: Re: [Interest] Qt3D - Deploying renderer plugins introduced in Qt 5.15


Hi,

>From what I can see the macdeployqt and windeployqt scripts weren't updated to 
>deploy the renderers plugin.

Hopefully these patches would fix that:

https://codereview.qt-project.org/c/qt/qttools/+/302945/1

https://codereview.qt-project.org/c/qt/qttools/+/302946/1
Paul

On 5/28/20 6:41 PM, Esch Lorenz TU Ilmenau wrote:
Hello,

I am using windeployqt to deploy an application facilitating Qt3D via 
specifying QT += 3dcore 3drender 3dinput 3dextras in its .pro file. Since Qt 
5.15 the opengl renderer is isolated as a separated plugin 
(openglrenderer.dll). This new plugin is somehow not caught by windeployqt and 
thus not deployed to the binary's folder.

Any idea why? Maybe I am missing something here? Do I always need to deploy the 
renderer manually for versions > 5.15?

Thanks,

Lorenz



___

Interest mailing list

Interest@qt-project.org<mailto:Interest@qt-project.org>

https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D - Deploying renderer plugins introduced in Qt 5.15

2020-06-04 Thread Paul Lemire via Interest

Hi,

From what I can see the macdeployqt and windeployqt scripts weren't 
updated to deploy the renderers plugin.


Hopefully these patches would fix that:

https://codereview.qt-project.org/c/qt/qttools/+/302945/1

https://codereview.qt-project.org/c/qt/qttools/+/302946/1

Paul

On 5/28/20 6:41 PM, Esch Lorenz TU Ilmenau wrote:


Hello,

I am using windeployqt to deploy an application facilitating Qt3D via 
specifying QT+=3dcore3drender3dinput3dextras in its .pro file. Since 
Qt 5.15 the opengl renderer is isolated as a separated plugin 
(openglrenderer.dll). This new plugin is somehow not caught by 
windeployqt and thus not deployed to the binary’s folder.


Any idea why? Maybe I am missing something here? Do I always need to 
deploy the renderer manually for versions > 5.15?


Thanks,

Lorenz


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D - Deploying renderer plugins introduced in Qt 5.15

2020-05-28 Thread Esch Lorenz TU Ilmenau
Hello,

I am using windeployqt to deploy an application facilitating Qt3D via 
specifying QT += 3dcore 3drender 3dinput 3dextras in its .pro file. Since Qt 
5.15 the opengl renderer is isolated as a separated plugin 
(openglrenderer.dll). This new plugin is somehow not caught by windeployqt and 
thus not deployed to the binary's folder.

Any idea why? Maybe I am missing something here? Do I always need to deploy the 
renderer manually for versions > 5.15?

Thanks,

Lorenz
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Use already available OpenGL buffer for geometry

2020-05-21 Thread Nicolás Ulrich
Hi,

I was wondering if there's a way to use a buffer I already have in the
GPU memory for my geometry? I want to avoid copying it to the CPU and
then having Qt3D uploading it again (it's for  viewing data being
computed/updated constantly with CUDA).

I have it working with "raw" OpenGL but I miss all the nice things
already available in Qt3D (thanks!!).
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D performance, and development resources

2020-04-17 Thread Christoph Feck
Thanks to all for the interesting C++ Qt3D links! I long wanted to play 
with Qt3D in C++. RHI supporting all major 3D APIs makes it really 
attractive.


Christoph Feck

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D performance, and development resources

2020-04-16 Thread 王少东
For anyone interested in more code examples, I've written some rendering
tools using Qt3D in C++.

https://github.com/unclejimbo/Klein

Hope this helps.

Nyall Dawson  于2020年4月15日周三 下午12:45写道:

> On Wed, 15 Apr 2020 at 01:51, Charles Martin  wrote:
>
> >  - Where can I find more examples, tutorials and introductory
> information? There are only two C++ examples on the Qt website, and both of
> these are very simple. The Qt docs are very limited and incomplete.
>
> There's some good ones here:
>
> https://github.com/wonder-sk/qt3d-experiments
>
> >   - Is there a community of C++ Qt3D developers? Most online material
> was produced by KADB, is 4 years or older, and focuses on QML. Where are
> the C++ users?
>
> The QGIS desktop application is a c++ application which makes heavy
> use of Qt 3d. You may find some useful code in
> https://github.com/qgis/QGIS/tree/master/src/3d.
>
> Nyall
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D performance, and development resources

2020-04-14 Thread Nyall Dawson
On Wed, 15 Apr 2020 at 01:51, Charles Martin  wrote:

>  - Where can I find more examples, tutorials and introductory information? 
> There are only two C++ examples on the Qt website, and both of these are very 
> simple. The Qt docs are very limited and incomplete.

There's some good ones here:

https://github.com/wonder-sk/qt3d-experiments

>   - Is there a community of C++ Qt3D developers? Most online material was 
> produced by KADB, is 4 years or older, and focuses on QML. Where are the C++ 
> users?

The QGIS desktop application is a c++ application which makes heavy
use of Qt 3d. You may find some useful code in
https://github.com/qgis/QGIS/tree/master/src/3d.

Nyall
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D performance, and development resources

2020-04-14 Thread Oleg Evseev
Hi,

Qt3D performance on Android was my concern a year ago too:
https://bugreports.qt.io/browse/QTBUG-72808 (see also
https://bugreports.qt.io/browse/QTBUG-73057)
especially when Scene3D with multi sampling is used.
Using OnDemand policy improve performance (but almost in stale scenes),
take a look.

I thought that new Underlay compositingMode introduced in 5.14 (
https://doc.qt.io/qt-5/qml-qtquick-scene3d-scene3d.html#compositingMode-prop)
will increase performance twice or even more, but unfortunately I didn't
see any increase at least in our case and hardware. But you can take a look
to it. But just in case, note about bug Scene3D.Underlay + OnDemand
(QTBUG-82861)

About examples.
First of all, take look at Qt 3D examples especially manual tests as Mike
Krus rightly suggested.

I can't be supportive but if you want, you can take a look to several
simple apps I made for test case in bug reports, may be there will be
useful somehow for you. I used Qt3D in C++ inside World3d as the root
object of QML Scene3D (several test examples can be similar in fact).
QTBUG-80092, QTBUG-60612, QTBUG-60429, QTBUG-60183, QTBUG-50720

p.s.
I will also take the opportunity to express here my pains about Qt3D a
little :)
Our project is based on Qt3D and it is really nice and handy, but we stack
with Qt 5.9.5. With some workarounds it get turn out as most stable version
for us, every time we try to move to newer version 5.10, 5.11, 5.12, 5.14
we are always encountered with bugs and crashes. And the most upset that
several of them were repeated in next versions after fixes :(
Unfortunately now I don't have enough time to test and post bugrepost, hope
latter I can help to improve Qt 3d a little. Despite any issues, thank all
Qt developers and community for their work!

---
With regards, Oleg


вт, 14 апр. 2020 г. в 18:50, Charles Martin :

> I’ve been migrating a C++ Coin/Quarter project to Qt3D. I’m doing this on
> a newer iMac/Catalina. The graphics performance seems unacceptable. A
> simple display of 3600 line segments takes about 5 seconds to render and
> 30k segments takes >30 seconds.
>
> When the rendering is started, Qt puts out this warning message:
> qt.qpa.openglcontext: Could not create NSOpenGLContext with shared
> context, falling back to unshared context.
>
> I’m new to Qt3D, and there is a good chance that I’m doing something wrong.
>
> My questions:
>
>   - Shouldn't I see better performance, and what can I try to improve
> that? Does the warning message identify the problem?
>
>  - Where can I find more examples, tutorials and introductory information?
> There are only two C++ examples on the Qt website, and both of these are
> very simple. The Qt docs are very limited and incomplete.
>
>   - Is there a community of C++ Qt3D developers? Most online material was
> produced by KADB, is 4 years or older, and focuses on QML. Where are the
> C++ users?
>
> I’m trying to get some traction with this product, and any guidance is
> really appreciated.
>
> Thanks,
> Charlie
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D performance, and development resources

2020-04-14 Thread Mike Krus via Interest
Hi Charlie


> On 14 Apr 2020, at 16:51, Charles Martin  wrote:
> 
> I’ve been migrating a C++ Coin/Quarter project to Qt3D.
Fun. A long time since I used Coin3d. Keep meaning to port it’s scxml based 
camera controller and the manipulators to qt3d.

> I’m doing this on a newer iMac/Catalina. The graphics performance seems 
> unacceptable. A simple display of 3600 line segments takes about 5 seconds to 
> render and 30k segments takes >30 seconds. 
Can you explain how the scene graph is structured? Is each line segment a 
separate entity plus its components? Or just a single entity?

If each line is an object then I would totally expect the kind of performance 
you are getting as each object will result is a draw call. That number of draw 
calls alone will kill performance. 
 
> When the rendering is started, Qt puts out this warning message:
> qt.qpa.openglcontext: Could not create NSOpenGLContext with shared context, 
> falling back to unshared context.
That is odd. Could you explain how you are setting up your window?

> I’m new to Qt3D, and there is a good chance that I’m doing something wrong.
> 
> My questions:
> 
>  - Shouldn't I see better performance, and what can I try to improve that? 
> Does the warning message identify the problem? 
I would say it’s either the number of objects or indeed the fact that context 
are not shared (resulting in lots of context switches). 

Qt3d 5.15 ships which new performance tracking features that may help you 
investigate. See https://www.kdab.com/debugging-profiling-qt-3d-apps/

> - Where can I find more examples, tutorials and introductory information? 
> There are only two C++ examples on the Qt website, and both of these are very 
> simple. The Qt docs are very limited and incomplete.
Qt 3D itself ships with a number of examples. If you look at the Qt 3D source 
code, there’s a number of manual tests which may be of interest. 

KDAB’s GitHub has a qt3d sample project which has other examples, though they 
may be a bit outdated. 

>  - Is there a community of C++ Qt3D developers? Most online material was 
> produced by KADB, is 4 years or older, and focuses on QML. Where are the C++ 
> users?
We are here :)

Please note that although many exemples are in qml, they are still relevant for 
your use case as the APIs are nearly identical. 

> I’m trying to get some traction with this product, and any guidance is really 
> appreciated.
Feel free to get in touch if you need more help. 

Mike

> Thanks,
> Charlie
> 
> 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D performance, and development resources

2020-04-14 Thread Charles Martin
I’ve been migrating a C++ Coin/Quarter project to Qt3D. I’m doing this on a 
newer iMac/Catalina. The graphics performance seems unacceptable. A simple 
display of 3600 line segments takes about 5 seconds to render and 30k segments 
takes >30 seconds. 

When the rendering is started, Qt puts out this warning message:
qt.qpa.openglcontext: Could not create NSOpenGLContext with shared context, 
falling back to unshared context.

I’m new to Qt3D, and there is a good chance that I’m doing something wrong.

My questions:

  - Shouldn't I see better performance, and what can I try to improve that? 
Does the warning message identify the problem? 

 - Where can I find more examples, tutorials and introductory information? 
There are only two C++ examples on the Qt website, and both of these are very 
simple. The Qt docs are very limited and incomplete.

  - Is there a community of C++ Qt3D developers? Most online material was 
produced by KADB, is 4 years or older, and focuses on QML. Where are the C++ 
users?

I’m trying to get some traction with this product, and any guidance is really 
appreciated.

Thanks,
Charlie



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D point light intesity

2020-04-11 Thread Megidd Git
Cool, thanks! 

On Sat, Apr 11, 2020 at 9:00 PM Esch Lorenz TU Ilmenau <
lorenz.e...@tu-ilmenau.de> wrote:

> Hi,
>
>
>
> QPointLight inherits from QAbstractLight, which offers setIntensitiy().
> See https://doc.qt.io/qt-5/qt3drender-qabstractlight.html#intensity-prop.
> Hope this helps.
>
>
>
> Cheers,
>
>
>
> Lorenz
>
>
>
> *Von:* Interest  *Im Auftrag von *Megidd
> Git
> *Gesendet:* Samstag, 11. April 2020 11:30
> *An:* interest@qt-project.org
> *Betreff:* [Interest] Qt3D point light intesity
>
>
>
> Hi!
>
>
>
> I'm using point light <https://doc.qt.io/qt-5/qt3drender-qpointlight.html> in
> a 3D scene with entities of Phong
> <https://doc.qt.io/qt-5/qt3dextras-qmorphphongmaterial.html> material. I
> just want to be able to increase/decrease point light *intensity*. Point
> light has three properties:
>
>
>
> - constantAttenuation : float
>
> - linearAttenuation : float
>
> - quadraticAttenuation : float
>
>
>
> Documentation mentions that the exact meaning and use of those properties
> is up to the material implementation. Now I wonder how can I simply
> decrease/increase light intensity, considering that I'm using Phong
> <https://doc.qt.io/qt-5/qt3dextras-qmorphphongmaterial.html> material.
>
>
>
> Thanks
>
> 
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D point light intesity

2020-04-11 Thread Esch Lorenz TU Ilmenau
Hi,

QPointLight inherits from QAbstractLight, which offers setIntensitiy(). See 
https://doc.qt.io/qt-5/qt3drender-qabstractlight.html#intensity-prop. Hope this 
helps.

Cheers,

Lorenz

Von: Interest  Im Auftrag von Megidd Git
Gesendet: Samstag, 11. April 2020 11:30
An: interest@qt-project.org
Betreff: [Interest] Qt3D point light intesity

Hi!

I'm using point light<https://doc.qt.io/qt-5/qt3drender-qpointlight.html> in a 
3D scene with entities of 
Phong<https://doc.qt.io/qt-5/qt3dextras-qmorphphongmaterial.html> material. I 
just want to be able to increase/decrease point light intensity. Point light 
has three properties:

- constantAttenuation : float
- linearAttenuation : float
- quadraticAttenuation : float

Documentation mentions that the exact meaning and use of those properties is up 
to the material implementation. Now I wonder how can I simply decrease/increase 
light intensity, considering that I'm using 
Phong<https://doc.qt.io/qt-5/qt3dextras-qmorphphongmaterial.html> material.

Thanks

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D point light intesity

2020-04-11 Thread Megidd Git
Hi!

I'm using point light  in
a 3D scene with entities of Phong
 material. I
just want to be able to increase/decrease point light *intensity*. Point
light has three properties:

- constantAttenuation : float
- linearAttenuation : float
- quadraticAttenuation : float

Documentation mentions that the exact meaning and use of those properties
is up to the material implementation. Now I wonder how can I simply
decrease/increase light intensity, considering that I'm using Phong
 material.

Thanks

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D ObjectPicker doesn't work for a dynamically created entity if there isn't already another entity with ObjectPicker

2020-03-03 Thread Federico Ferri
I’m dynamically creating a Qt3D entity via C++

if(!rootEntity_) return;
auto cuboidEntity = new Qt3DCore::QEntity(rootEntity_);
auto mat = new Qt3DExtras::QPhongMaterial(cuboidEntity);
mat->setDiffuse(QColor(217, 217, 255));
auto t = new Qt3DCore::QTransform(cuboidEntity);
auto mesh = new Qt3DExtras::QCuboidMesh(cuboidEntity);
auto picker = new Qt3DRender::QObjectPicker(cuboidEntity);
connect(picker, ::QObjectPicker::clicked, [=] {
qDebug() << "clicked entity" << cuboidEntity;
});
mesh->setXExtent(1);
mesh->setYExtent(1);
mesh->setZExtent(1);
cuboidEntity->addComponent(mat);
cuboidEntity->addComponent(t);
cuboidEntity->addComponent(mesh);
cuboidEntity->addComponent(picker);

the problem is that the object picker doesn’t seem to work.
However, if the scene tree has already a static (declared in QML) entity
with an ObjectPicker in it, then picking works both in the static entity
and in my dynamically created entity.

Is this a bug or am I doing something wrong?

This has been asked also on
https://stackoverflow.com/questions/60509246/objectpicker-doesnt-work-for-a-dynamically-created-entity-if-there-isnt-alread
with
more exhaustive code.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Get OpenGL texture data / Send preprocessor instructions to shaders

2020-02-25 Thread Paul Lemire via Interest

Hi Léo,

On 2/25/20 3:15 PM, Léo Adam wrote:

Hi,

I am new to Qt3D and there's a few things I was wondering how to achieve:

- I need to read and write an opengl texture from C++.
For example, I am rendering a scene into a texture during a first 
render pass, and then performing some postprocess effect before 
rendering that texture in a fullscreen quad during a second render pass.
I would like to access that texture from C++, and can't manage to do 
that. I've found the classes 
/QTextureImageData///QTextureData///QTextureDataGenerator/, but I 
don't know if that's really what I'm looking for and if it is, how to 
use it.


Have look at the manual tests in Qt3D 
https://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual?h=5.15


- texture-updates-cpp -> C++ to GPU uploads

- rendercapture* -> GPU Back buffer / FBO to C++/QML download

- sharedtexture if you want to create a raw OpenGL texture and have Qt3D 
use it


- deferred-renderer* for rendering into FBO and reusing FBO attachement 
in a second pass


- I also would like to send preprocessor instructions to a shader from 
C++/QML and I don't know if this is possible.
For example, if I want to use /#ifdef/ in a shader with a value 
defined in C++, I would need to send that value to the shader just 
like /QParameter/ do with uniforms.
I've searched in the documentation and on internet, but I didn't find 
anything.


changing the #ifdef would trigger a whole shader recompilation , fine 
for prototyping, probably not for production.


You would have to modify the shader code directly, something like:

property int value: 1

ShaderProgram {

    fragmentShader: "

    #ifdef " + value + "

    ...

   #else

  ..."

}



Any help would be highly appreciated :-)

Sincerely,
Léo.

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


--
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Get OpenGL texture data / Send preprocessor instructions to shaders

2020-02-25 Thread Léo Adam
Hi,

I am new to Qt3D and there's a few things I was wondering how to achieve:

- I need to read and write an opengl texture from C++.
For example, I am rendering a scene into a texture during a first render
pass, and then performing some postprocess effect before rendering that
texture in a fullscreen quad during a second render pass.
I would like to access that texture from C++, and can't manage to do that.
I've found the classes *QTextureImageData*/*QTextureData*/
*QTextureDataGenerator*, but I don't know if that's really what I'm looking
for and if it is, how to use it.

- I also would like to send preprocessor instructions to a shader from
C++/QML and I don't know if this is possible.
For example, if I want to use *#ifdef* in a shader with a value defined in
C++, I would need to send that value to the shader just like *QParameter*
do with uniforms.
I've searched in the documentation and on internet, but I didn't find
anything.

Any help would be highly appreciated :-)

Sincerely,
Léo.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Transform feedback

2020-02-22 Thread Mike Krus via Interest
Hi

transform feedback is currently not supported by Qt3D’s API. It’s an 
interesting idea though, was wondering quite recently what the API may look 
like, there’s lots of things to setup to control which data should be captured 
and where it should go.

Depending on what you’re doing, you may be better off using compute shaders 
which are fully supported.


Mike

> On 20 Feb 2020, at 12:55, Léo Adam  wrote:
> 
> Hi,
> 
> I am currently working in a medical imaging team on 3D rendering with Qt3D.
> 
> That's why I would need to perform transform feedback, but after looking on 
> internet and in the documentation I didn't find anything.
> 
> So I was wondering if there were any way to do transform feedback in the Qt3D 
> API.
> 
> Thank you,
> 
> Léo Adam.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Transform feedback

2020-02-20 Thread Léo Adam
Hi,

I am currently working in a medical imaging team on 3D rendering with Qt3D.

That's why I would need to perform transform feedback, but after looking on
internet and in the documentation I didn't find anything.

So I was wondering if there were any way to do transform feedback in the
Qt3D API.

Thank you,

Léo Adam.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Assertion in QAbstractAspect when inserting entity from plugin DLL

2020-02-09 Thread coroberti .
On Sat, Feb 8, 2020 at 6:07 AM Thiago Macieira
 wrote:
>
> On Friday, 7 February 2020 05:52:37 PST Volker Enderlein wrote:
> > Program: C:\Qt\5.14.1\msvc2017_64\bin\Qt5Cored.dll
> > Module: 5.14.1
> > File: aspects\qabstractaspect.cpp
> > Line: 213
> >
> > ASSERT: "metaObj" in file aspects\qabstractaspect.cpp, line 213
>
> MSVC 2017 has serious bug in static initialisation. Microsoft has already
> fixed it. Please upgrade (to 2019).
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel System Software Products
>

Is it correct to say that Microsoft not released the patch for MSVC 2017?
What is the issue number of link?
Thanks.

Kind regards,
Robert
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Assertion in QAbstractAspect when inserting entity from plugin DLL

2020-02-07 Thread Thiago Macieira
On Friday, 7 February 2020 05:52:37 PST Volker Enderlein wrote:
> Program: C:\Qt\5.14.1\msvc2017_64\bin\Qt5Cored.dll
> Module: 5.14.1
> File: aspects\qabstractaspect.cpp
> Line: 213
> 
> ASSERT: "metaObj" in file aspects\qabstractaspect.cpp, line 213

MSVC 2017 has serious bug in static initialisation. Microsoft has already 
fixed it. Please upgrade (to 2019).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Assertion in QAbstractAspect when inserting entity from plugin DLL

2020-02-07 Thread Mike Krus via Interest
Hi

I can’t say I’ve across such an error before. Can you get a call stack? If you 
set a conditional break point at the assert (based on metaObj being null) then 
it might provide some insight?

Feel free to report it as a bug,

Mike

> On 7 Feb 2020, at 13:52, Volker Enderlein  
> wrote:
> 
> Hello,
> 
> I am facing an error since Qt 5.14 (5.14.0 and 5.14.1) that did not show up 
> in previous versions (tested Qt 5.13.2 and before)
> 
> It is a huge engineering application and I did not manage it up to now to 
> reduce it to a small sample that shows the behaviour.
> 
> When interactively inserting a 3D QEntity (a custom geometry derived from 
> QEntity containing a QGeometryRenderer and some QTransform nodes) from a 
> plugin DLL (created with C++) I am greeted by the following assertion:
> 
> ---
> Microsoft Visual C++ Runtime Library
> ---
> Debug Error!
> 
> Program: C:\Qt\5.14.1\msvc2017_64\bin\Qt5Cored.dll
> Module: 5.14.1
> File: aspects\qabstractaspect.cpp
> Line: 213
> 
> ASSERT: "metaObj" in file aspects\qabstractaspect.cpp, line 213
> 
> (Press Retry to debug the application)
> 
> And the application does not display the graphics component inserted. Other 
> components are shown. I already inspected the output of the logging 
> categories for Qt3D and our plugin DLL but did not succeed up to now in 
> finding the reason for this behaviour.
> 
> Did anyone were facing similar regressions when updating a Qt3D based 
> application Qt 5.14?
> 
> Any help is very much appreciated.
> 
> Cheers, Volker
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Assertion in QAbstractAspect when inserting entity from plugin DLL

2020-02-07 Thread Volker Enderlein

Hello,

I am facing an error since Qt 5.14 (5.14.0 and 5.14.1) that did not show 
up in previous versions (tested Qt 5.13.2 and before)


It is a huge engineering application and I did not manage it up to now 
to reduce it to a small sample that shows the behaviour.


When interactively inserting a 3D QEntity (a custom geometry derived 
from QEntity containing a QGeometryRenderer and some QTransform nodes) 
from a plugin DLL (created with C++) I am greeted by the following 
assertion:


---
Microsoft Visual C++ Runtime Library
---
Debug Error!

Program: C:\Qt\5.14.1\msvc2017_64\bin\Qt5Cored.dll
Module: 5.14.1
File: aspects\qabstractaspect.cpp
Line: 213

ASSERT: "metaObj" in file aspects\qabstractaspect.cpp, line 213

(Press Retry to debug the application)

And the application does not display the graphics component inserted. 
Other components are shown. I already inspected the output of the 
logging categories for Qt3D and our plugin DLL but did not succeed up to 
now in finding the reason for this behaviour.


Did anyone were facing similar regressions when updating a Qt3D based 
application Qt 5.14?


Any help is very much appreciated.

Cheers, Volker

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] QText2DEntity not appears if QLayerFilter is used

2019-11-18 Thread Oleg Evseev
I think I found internal Qt3D Entity instances that Paul mentioned -
DistanceFieldTextRenderer.
Still have confusion why they are not listed in childNode?

Anyway using recursive property introduced in Qt 5.10 looks like the only
adequate way to use QLayer on QText2DEntity
https://bugreports.qt.io/browse/QTBUG-80092

Thanks for help, Paul.

пн, 18 нояб. 2019 г. в 10:30, Oleg Evseev :

> Got it!
>
> Check it in Qt 5.14, recursive property helps, but why? I'm confused,
> walkEntity explicitly specifies there are no children Entities (and Nodes
> either than QTransform).
> (also there was issues with font size and QText2DEntity size, I don't
> feel the scales of it yet)
>
>
> пн, 18 нояб. 2019 г. в 09:56, Oleg Evseev :
>
>> Hi Paul,
>>
>> Thank for the feedback!
>> Lack of recursive QLayer is the first think I thought of. That's why
>> there is walkEntity function in test example, and it says that there is
>> only one entity - QText2DEntity :
>>
>> Entity: Qt3DExtras::QText2DEntity(0x33a3d4e0) Components:
>> QVector(Qt3DCore::QTransform(0x33a3d580), Qt3DRender::QLayer(0x33a3d310))
>>
>>
>> No internal entities. Also I had checked QText2DEntity source precisely
>> on this aspect and hadn't seen anything.
>>
>>
>> I'm currently using Qt 5.9.5 and don't have recursive property, I will
>> check it in qt 5.14 latter.
>>
>> пн, 18 нояб. 2019 г. в 09:03, Paul Lemire :
>>
>>> Hi Oleg,
>>>
>>> From what I can see in the code, QText2DEntity doesn't draw anything,
>>> but it instead instantiates internal Qt3D Entity instances to do the
>>> drawing.
>>>
>>> Therefore if you set the QLayer on QText2DEntity, it won't be set on the
>>> internal entities and won't draw.
>>>
>>> One option might be to set the recursive property to true on your QLayer
>>> so that setting it on QText2DEntity also makes it pickup all of its
>>> children Entities.
>>>
>>> I hope that helps,
>>>
>>> Paul
>>> On 11/17/19 2:18 AM, Oleg Evseev wrote:
>>>
>>> Hi,
>>>
>>> Did somebody successfully work with QText2DEntity in 3d scenes with
>>> QLayerFilters?
>>>
>>> Here is my project https://bugreports.qt.io/browse/QTBUG-80092.
>>> QText2DEntity doesn't appear.
>>> https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example without
>>> Layers works fine.
>>>
>>> This is the bug or maybe I set something wrong?
>>>
>>> Thanks in advance for any help.
>>>
>>> ---
>>> With regards, Oleg.
>>>
>>> ___
>>> Interest mailing 
>>> listInterest@qt-project.orghttps://lists.qt-project.org/listinfo/interest
>>>
>>> --
>>> Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
>>> KDAB (France) S.A.S., a KDAB Group company
>>> Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
>>> KDAB - The Qt, C++ and OpenGL Experts
>>>
>>>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] QText2DEntity not appears if QLayerFilter is used

2019-11-17 Thread Oleg Evseev
Got it!

Check it in Qt 5.14, recursive property helps, but why? I'm confused,
walkEntity explicitly specifies there are no children Entities (and Nodes
either than QTransform).
(also there was issues with font size and QText2DEntity size, I don't feel
the scales of it yet)


пн, 18 нояб. 2019 г. в 09:56, Oleg Evseev :

> Hi Paul,
>
> Thank for the feedback!
> Lack of recursive QLayer is the first think I thought of. That's why there
> is walkEntity function in test example, and it says that there is only one
> entity - QText2DEntity :
>
> Entity: Qt3DExtras::QText2DEntity(0x33a3d4e0) Components:
> QVector(Qt3DCore::QTransform(0x33a3d580), Qt3DRender::QLayer(0x33a3d310))
>
>
> No internal entities. Also I had checked QText2DEntity source precisely on
> this aspect and hadn't seen anything.
>
>
> I'm currently using Qt 5.9.5 and don't have recursive property, I will
> check it in qt 5.14 latter.
>
> пн, 18 нояб. 2019 г. в 09:03, Paul Lemire :
>
>> Hi Oleg,
>>
>> From what I can see in the code, QText2DEntity doesn't draw anything, but
>> it instead instantiates internal Qt3D Entity instances to do the drawing.
>>
>> Therefore if you set the QLayer on QText2DEntity, it won't be set on the
>> internal entities and won't draw.
>>
>> One option might be to set the recursive property to true on your QLayer
>> so that setting it on QText2DEntity also makes it pickup all of its
>> children Entities.
>>
>> I hope that helps,
>>
>> Paul
>> On 11/17/19 2:18 AM, Oleg Evseev wrote:
>>
>> Hi,
>>
>> Did somebody successfully work with QText2DEntity in 3d scenes with
>> QLayerFilters?
>>
>> Here is my project https://bugreports.qt.io/browse/QTBUG-80092.
>> QText2DEntity doesn't appear.
>> https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example without
>> Layers works fine.
>>
>> This is the bug or maybe I set something wrong?
>>
>> Thanks in advance for any help.
>>
>> ---
>> With regards, Oleg.
>>
>> ___
>> Interest mailing 
>> listInterest@qt-project.orghttps://lists.qt-project.org/listinfo/interest
>>
>> --
>> Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
>> KDAB (France) S.A.S., a KDAB Group company
>> Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
>> KDAB - The Qt, C++ and OpenGL Experts
>>
>>

-- 
С Уважением,
Евсеев Олег.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] QText2DEntity not appears if QLayerFilter is used

2019-11-17 Thread Oleg Evseev
Hi Paul,

Thank for the feedback!
Lack of recursive QLayer is the first think I thought of. That's why there
is walkEntity function in test example, and it says that there is only one
entity - QText2DEntity :

Entity: Qt3DExtras::QText2DEntity(0x33a3d4e0) Components:
QVector(Qt3DCore::QTransform(0x33a3d580), Qt3DRender::QLayer(0x33a3d310))


No internal entities. Also I had checked QText2DEntity source precisely on
this aspect and hadn't seen anything.


I'm currently using Qt 5.9.5 and don't have recursive property, I will
check it in qt 5.14 latter.

пн, 18 нояб. 2019 г. в 09:03, Paul Lemire :

> Hi Oleg,
>
> From what I can see in the code, QText2DEntity doesn't draw anything, but
> it instead instantiates internal Qt3D Entity instances to do the drawing.
>
> Therefore if you set the QLayer on QText2DEntity, it won't be set on the
> internal entities and won't draw.
>
> One option might be to set the recursive property to true on your QLayer
> so that setting it on QText2DEntity also makes it pickup all of its
> children Entities.
>
> I hope that helps,
>
> Paul
> On 11/17/19 2:18 AM, Oleg Evseev wrote:
>
> Hi,
>
> Did somebody successfully work with QText2DEntity in 3d scenes with
> QLayerFilters?
>
> Here is my project https://bugreports.qt.io/browse/QTBUG-80092.
> QText2DEntity doesn't appear.
> https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example without
> Layers works fine.
>
> This is the bug or maybe I set something wrong?
>
> Thanks in advance for any help.
>
> ---
> With regards, Oleg.
>
> ___
> Interest mailing 
> listInterest@qt-project.orghttps://lists.qt-project.org/listinfo/interest
>
> --
> Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
> KDAB - The Qt, C++ and OpenGL Experts
>
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] QText2DEntity not appears if QLayerFilter is used

2019-11-17 Thread Paul Lemire via Interest
Hi Oleg,

From what I can see in the code, QText2DEntity doesn't draw anything,
but it instead instantiates internal Qt3D Entity instances to do the
drawing.

Therefore if you set the QLayer on QText2DEntity, it won't be set on the
internal entities and won't draw.

One option might be to set the recursive property to true on your QLayer
so that setting it on QText2DEntity also makes it pickup all of its
children Entities.

I hope that helps,

Paul

On 11/17/19 2:18 AM, Oleg Evseev wrote:
> Hi,
>
> Did somebody successfully work with QText2DEntity in 3d scenes with
> QLayerFilters?
>
> Here is my project https://bugreports.qt.io/browse/QTBUG-80092.
> QText2DEntity doesn't appear.
> https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example without
> Layers works fine.
>
> This is the bug or maybe I set something wrong?
>
> Thanks in advance for any help.
>
> ---
> With regards, Oleg.
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] QText2DEntity not appears if QLayerFilter is used

2019-11-16 Thread Oleg Evseev
Hi,

Did somebody successfully work with QText2DEntity in 3d scenes with
QLayerFilters?

Here is my project https://bugreports.qt.io/browse/QTBUG-80092.
QText2DEntity doesn't appear.
https://github.com/Nonmant/Qt3DExtras-QText2DEntity-Example without Layers
works fine.

This is the bug or maybe I set something wrong?

Thanks in advance for any help.

---
With regards, Oleg.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Create SkyBox using 2d textures from Scene2D

2019-10-24 Thread Vlad Stelmahovsky
Hello

is %subj% possible in qt 3d 2.x?
Would like to have some hints

thanks
-- 
Best regards,
Vlad
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-09 Thread Gil H
Scratch that, forgot to set the item size to fill the window.  Changing that 
fixes it in the standalone example.

 

 

From: Interest  on behalf of Gil H 

Date: Thursday, August 8, 2019 at 11:18 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi guys, I got it working using Qt3DQuickWindow, but when I tried to integrate 
the same framegraph in my actual implementation (offscreen rendering to FBO 
similar to Scene3D’s code) the texture handles come back as 0.  

 

Attached is my standalone example, modified to use Scene3D to illustrate the 
problem.  It fails to render properly and prints errors about incomplete 
framebuffers.  If you uncomment the other code block in main.cpp, with a 
Qt3DQuickWindow it all works fine.  My use case involves taking each rendered 
texture and drawing it as part of an external custom GL engine.  So, I need 
Qt3D to render multiple textures of different views, and then I need access to 
those GL texture handles for manually drawing them onto a different frame 
buffer.

 

I know Scene3D creates its own FBO, but after digging through Qt source, I 
still don’t understand how that interacts with QRenderTarget nodes in the frame 
graph.  It is “illegal” to have this kind of graph with Scene3D? 

 

Thanks!

 

Gil

 

 

 

From: Interest  on behalf of Gil H 

Date: Wednesday, August 7, 2019 at 9:46 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Thanks Sean.  I had that framegraph set up, but I was trying to use a single 
RenderTarget with multiple textures attached for all the rendering, instead of 
what ended up working more easily, which was to simply create a separate 
RenderTarget for each sub-graph and just attach the textures to color0.  

 

 

From: Interest  on behalf of Sean Harmer 

Date: Wednesday, August 7, 2019 at 4:40 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

With an FBO with multiple textures attached each texture will still have the 
same pixels rasterised. You can't draw different cameras and scenes into each 
texture at the same time. Well something like that can be done with some 
advanced use of the geometry shader but I don't think that's the case here.

If you want to draw 3 different scenes into 3 different textures you will need 
3 different sub-trees in your framegraph. Each one will set the camera to use, 
the filters to select the subset of the scene graph to draw and the FBO with 
the target texture to render into.

Cheers,

Sean

On 01/08/2019 18:42, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 





___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-08 Thread Gil H
Hi guys, I got it working using Qt3DQuickWindow, but when I tried to integrate 
the same framegraph in my actual implementation (offscreen rendering to FBO 
similar to Scene3D’s code) the texture handles come back as 0.  

 

Attached is my standalone example, modified to use Scene3D to illustrate the 
problem.  It fails to render properly and prints errors about incomplete 
framebuffers.  If you uncomment the other code block in main.cpp, with a 
Qt3DQuickWindow it all works fine.  My use case involves taking each rendered 
texture and drawing it as part of an external custom GL engine.  So, I need 
Qt3D to render multiple textures of different views, and then I need access to 
those GL texture handles for manually drawing them onto a different frame 
buffer.

 

I know Scene3D creates its own FBO, but after digging through Qt source, I 
still don’t understand how that interacts with QRenderTarget nodes in the frame 
graph.  It is “illegal” to have this kind of graph with Scene3D? 

 

Thanks!

 

Gil

 

 

 

 

From: Interest  on behalf of Gil H 

Date: Wednesday, August 7, 2019 at 9:46 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Thanks Sean.  I had that framegraph set up, but I was trying to use a single 
RenderTarget with multiple textures attached for all the rendering, instead of 
what ended up working more easily, which was to simply create a separate 
RenderTarget for each sub-graph and just attach the textures to color0.  

 

 

From: Interest  on behalf of Sean Harmer 

Date: Wednesday, August 7, 2019 at 4:40 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

With an FBO with multiple textures attached each texture will still have the 
same pixels rasterised. You can't draw different cameras and scenes into each 
texture at the same time. Well something like that can be done with some 
advanced use of the geometry shader but I don't think that's the case here.

If you want to draw 3 different scenes into 3 different textures you will need 
3 different sub-trees in your framegraph. Each one will set the camera to use, 
the filters to select the subset of the scene graph to draw and the FBO with 
the target texture to render into.

Cheers,

Sean

On 01/08/2019 18:42, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 




___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

<>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-07 Thread Gil H
Thanks Sean.  I had that framegraph set up, but I was trying to use a single 
RenderTarget with multiple textures attached for all the rendering, instead of 
what ended up working more easily, which was to simply create a separate 
RenderTarget for each sub-graph and just attach the textures to color0.  

 

 

From: Interest  on behalf of Sean Harmer 

Date: Wednesday, August 7, 2019 at 4:40 AM
To: Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

With an FBO with multiple textures attached each texture will still have the 
same pixels rasterised. You can't draw different cameras and scenes into each 
texture at the same time. Well something like that can be done with some 
advanced use of the geometry shader but I don't think that's the case here.

If you want to draw 3 different scenes into 3 different textures you will need 
3 different sub-trees in your framegraph. Each one will set the camera to use, 
the filters to select the subset of the scene graph to draw and the FBO with 
the target texture to render into.

Cheers,

Sean

On 01/08/2019 18:42, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___ Interest mailing list 
Interest@qt-project.org https://lists.qt-project.org/listinfo/interest 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-07 Thread Gil H
Thanks, that is helpful to know for the future.  What I ended up doing is 
finally just use one RenderTarget for each sub-framegraph and different 
textures bound to Color0.  That is much easier for what I’m trying to do.  I 
guess I was expecting RenderTargetSelector to have the effect of specifying the 
output attachments of the fragment shader as well, and not require changes to 
the shaders themselves.

 

Really appreciate the help and all the great work on Qt3D!

 

Gil

 

 

From: Paul Lemire 
Date: Wednesday, August 7, 2019 at 3:03 AM
To: Gil H , Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

You shouldn't have to actually modify the Material to add in more passes. 

What you have to do is edit the fragment shader  to have more than 1 color 
output:

e.g:

out vec4 fragColor1;

out vec4 fragColor2;

out vec4 fragColor3;

void main() {

fragColor1 = color;

fragColor2 = color;

fragColor3 = color;

}

By default the declaration order of the output maps to your attachments:

first output goes to ColorAttachment0, second output to ColorAttachment1 ...

On 8/6/19 6:14 PM, Gil H wrote:

Thanks Paul.  My understanding of how to accomplish that would be to create an 
Effect with multiple RenderPasses and then in the framegraph specify a filter 
for each pass and the output surface for it.  Is that all?  I don’t see 
anything in the shaders that is specific to the attachment… is anything needed 
on that side of things?

 

Gil

 

 

From: Paul Lemire 
Date: Monday, August 5, 2019 at 2:36 AM
To: Gil H , Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

I'm pretty sure that's because you are using the PhongMaterial which only 
writes to Depth and Color0. You'd need to have your own material which writes 
to 3 different outputs to properly populate the 3 color attachments.

Paul

On 8/1/19 7:42 PM, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 




___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-07 Thread Sean Harmer

Hi Gil,

With an FBO with multiple textures attached each texture will still have 
the same pixels rasterised. You can't draw different cameras and scenes 
into each texture at the same time. Well something like that can be done 
with some advanced use of the geometry shader but I don't think that's 
the case here.


If you want to draw 3 different scenes into 3 different textures you 
will need 3 different sub-trees in your framegraph. Each one will set 
the camera to use, the filters to select the subset of the scene graph 
to draw and the FBO with the target texture to render into.


Cheers,

Sean

On 01/08/2019 18:42, Gil H wrote:


Hello everyone, I’m sure I’m doing something wrong here, but 
basically, I’m trying to render multiple frame graph subtrees into 
multiple texture targets, and then draw those as part of the final 
scene (kind of like seeing security camera feeds on a few textured 
quads).  Attached is my minimal test app which shows that only 
textures attached to Color0 seem to contain anything.  Is it because 
the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments 
added to it, but the textures I got back from that were still empty.


Tested this on Mac with Qt 5.13.0.

If anyone is curious about why you would want to do this, I need to 
render up to 3 different Qt3D scenes for integration into an external 
GL engine.  So different camera views and scene sub-trees need to be 
drawn onto separate textures each frame.



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-07 Thread Paul Lemire via Interest
Hi Gil,

You shouldn't have to actually modify the Material to add in more passes.

What you have to do is edit the fragment shader  to have more than 1
color output:

e.g:

out vec4 fragColor1;

out vec4 fragColor2;

out vec4 fragColor3;

void main() {

fragColor1 = color;

fragColor2 = color;

fragColor3 = color;

}

By default the declaration order of the output maps to your attachments:

first output goes to ColorAttachment0, second output to ColorAttachment1 ...

On 8/6/19 6:14 PM, Gil H wrote:
>
> Thanks Paul.  My understanding of how to accomplish that would be to
> create an Effect with multiple RenderPasses and then in the framegraph
> specify a filter for each pass and the output surface for it.  Is that
> all?  I don’t see anything in the shaders that is specific to the
> attachment… is anything needed on that side of things?
>
>  
>
> Gil
>
>  
>
>  
>
> *From: *Paul Lemire 
> *Date: *Monday, August 5, 2019 at 2:36 AM
> *To: *Gil H , Qt Interest 
> *Subject: *Re: [Interest] Qt3D Multiple color targets not working
>
>  
>
> Hi Gil,
>
> I'm pretty sure that's because you are using the PhongMaterial which
> only writes to Depth and Color0. You'd need to have your own material
> which writes to 3 different outputs to properly populate the 3 color
> attachments.
>
> Paul
>
> On 8/1/19 7:42 PM, Gil H wrote:
>
> Hello everyone, I’m sure I’m doing something wrong here, but
> basically, I’m trying to render multiple frame graph subtrees into
> multiple texture targets, and then draw those as part of the final
> scene (kind of like seeing security camera feeds on a few textured
> quads).  Attached is my minimal test app which shows that only
> textures attached to Color0 seem to contain anything.  Is it
> because the surface is a QWindow?  I’ve tried a more complicated
> example with an offscreen render surface and an FBO with multiple
> color attachments added to it, but the textures I got back from
> that were still empty.
>
>  
>
> Tested this on Mac with Qt 5.13.0.
>
>  
>
> If anyone is curious about why you would want to do this, I need
> to render up to 3 different Qt3D scenes for integration into an
> external GL engine.  So different camera views and scene sub-trees
> need to be drawn onto separate textures each frame.
>
>  
>
>  
>
>  
>
>  
>
>
>
> ___
>
> Interest mailing list
>
> Interest@qt-project.org <mailto:Interest@qt-project.org>
>
> https://lists.qt-project.org/listinfo/interest
>
> -- 
> Paul Lemire | paul.lem...@kdab.com <mailto:paul.lem...@kdab.com> | Senior 
> Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
> KDAB - The Qt, C++ and OpenGL Experts
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-06 Thread Gil H
Thanks Paul.  My understanding of how to accomplish that would be to create an 
Effect with multiple RenderPasses and then in the framegraph specify a filter 
for each pass and the output surface for it.  Is that all?  I don’t see 
anything in the shaders that is specific to the attachment… is anything needed 
on that side of things?

 

Gil

 

 

From: Paul Lemire 
Date: Monday, August 5, 2019 at 2:36 AM
To: Gil H , Qt Interest 
Subject: Re: [Interest] Qt3D Multiple color targets not working

 

Hi Gil,

I'm pretty sure that's because you are using the PhongMaterial which only 
writes to Depth and Color0. You'd need to have your own material which writes 
to 3 different outputs to properly populate the 3 color attachments.

Paul

On 8/1/19 7:42 PM, Gil H wrote:

Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D Multiple color targets not working

2019-08-05 Thread Paul Lemire via Interest
Hi Gil,

I'm pretty sure that's because you are using the PhongMaterial which
only writes to Depth and Color0. You'd need to have your own material
which writes to 3 different outputs to properly populate the 3 color
attachments.

Paul

On 8/1/19 7:42 PM, Gil H wrote:
>
> Hello everyone, I’m sure I’m doing something wrong here, but
> basically, I’m trying to render multiple frame graph subtrees into
> multiple texture targets, and then draw those as part of the final
> scene (kind of like seeing security camera feeds on a few textured
> quads).  Attached is my minimal test app which shows that only
> textures attached to Color0 seem to contain anything.  Is it because
> the surface is a QWindow?  I’ve tried a more complicated example with
> an offscreen render surface and an FBO with multiple color attachments
> added to it, but the textures I got back from that were still empty.
>
>  
>
> Tested this on Mac with Qt 5.13.0.
>
>  
>
> If anyone is curious about why you would want to do this, I need to
> render up to 3 different Qt3D scenes for integration into an external
> GL engine.  So different camera views and scene sub-trees need to be
> drawn onto separate textures each frame.
>
>  
>
>  
>
>  
>
>  
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D Multiple color targets not working

2019-08-01 Thread Gil H
Hello everyone, I’m sure I’m doing something wrong here, but basically, I’m 
trying to render multiple frame graph subtrees into multiple texture targets, 
and then draw those as part of the final scene (kind of like seeing security 
camera feeds on a few textured quads).  Attached is my minimal test app which 
shows that only textures attached to Color0 seem to contain anything.  Is it 
because the surface is a QWindow?  I’ve tried a more complicated example with 
an offscreen render surface and an FBO with multiple color attachments added to 
it, but the textures I got back from that were still empty.

 

Tested this on Mac with Qt 5.13.0.

 

If anyone is curious about why you would want to do this, I need to render up 
to 3 different Qt3D scenes for integration into an external GL engine.  So 
different camera views and scene sub-trees need to be drawn onto separate 
textures each frame.

 

 

 

 

<>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Render depth images

2019-06-19 Thread Grimm, Raphael (IAR)
Hi,
thanks for the hint.
Now I got several QTexture2D, but how can I access their data buffer
directly?
I did not see any function giving me access to some data buffer (but maybe I
am just blind).

In my application I do not want to display the images and need the precise
depth data (so the full floating point number).
In the best case I do not even want to have some window, the qt signal loop
or even requiring to be in a thread with a qt object tree  (the last two are
probably impossible).

Any tips on accessing the data buffer would be appreciated.

Raphael

-Original Message-
From: Paul Lemire  
Sent: Tuesday, 11 June, 2019 16:25
To: Grimm, Raphael (IAR) ; interest@qt-project.org
Subject: Re: [Interest] [Qt3D] Render depth images

Hi Raphael,


What you want is to do your rendering in 2 steps:

- Render your scene into a RenderTarget (with 2 attachments/textures, one
for color, one for depth)

- Render a full screen quad on which you display the depth texture.

We have some manual test in the Qt 3D sources that should show how to do
that:


https://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/deferred-renderer-qml

I hope that helps,

Paul


On 6/11/19 10:02 AM, Grimm, Raphael (IAR) wrote:


Hi,

I am new to Qt3D and want to render a depth image of a scene.

My problem is: I do not know how I can access the depth buffer.

Could someone give me an example or point me to the correct
functions and classes?

Thanks,

Raphael


 
___
Interest mailing list
Interest@qt-project.org <mailto:Interest@qt-project.org> 
https://lists.qt-project.org/listinfo/interest



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] Render depth images

2019-06-11 Thread Paul Lemire via Interest
Hi Raphael,

What you want is to do your rendering in 2 steps:

- Render your scene into a RenderTarget (with 2 attachments/textures,
one for color, one for depth)

- Render a full screen quad on which you display the depth texture.

We have some manual test in the Qt 3D sources that should show how to do
that:

https://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/deferred-renderer-qml

I hope that helps,

Paul

On 6/11/19 10:02 AM, Grimm, Raphael (IAR) wrote:
>
> Hi,
>
> I am new to Qt3D and want to render a depth image of a scene.
>
> My problem is: I do not know how I can access the depth buffer.
>
> Could someone give me an example or point me to the correct functions
> and classes?
>
> Thanks,
>
> Raphael
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest


smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Render depth images

2019-06-11 Thread Grimm, Raphael (IAR)
Hi,

I am new to Qt3D and want to render a depth image of a scene.

My problem is: I do not know how I can access the depth buffer.

Could someone give me an example or point me to the correct functions and
classes?

Thanks,

Raphael



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D: One-shot compute shader

2019-06-02 Thread Paul Lemire via Interest
If you can use Qt 5.13, ComputeCommand has a runType
property(Continuous/Manual) and a trigger function which you can use for
one shot compute calls.


https://doc-snapshots.qt.io/qt5-5.13/qt3drender-qcomputecommand.html


Another option would be to set the enabled property of your
DispatchCompute FG node to false once you know you don't need to execute
your compute shader.


Paul


On 6/1/19 1:21 AM, Daniel Proksch wrote:
> Hi all,
>
> I'm trying to implement a Qt3D FrameGraph (QML) that allows for
> one-shot dispatch of a compute shader.
> My current approach is to add a ComputeCommand component to my
> ComputeEntity whenever I want the dispatch to happen.
> When the compute task is done (i.e. in the next frame) I want to
> remove the ComputeCommand component again, so that the shader is no
> longer invoked.
>
> Is that approach reasonable?
> And is there a signal that is triggered whenever a frame is completed
> (so that I can remove the ComputeCommand)?
>
> Many thanks!
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest


smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D: One-shot compute shader

2019-05-31 Thread Daniel Proksch
Hi all,

I'm trying to implement a Qt3D FrameGraph (QML) that allows for one-shot 
dispatch of a compute shader.
My current approach is to add a ComputeCommand component to my ComputeEntity 
whenever I want the dispatch to happen.
When the compute task is done (i.e. in the next frame) I want to remove the 
ComputeCommand component again, so that the shader is no longer invoked.

Is that approach reasonable?
And is there a signal that is triggered whenever a frame is completed (so that 
I can remove the ComputeCommand)?

Many thanks!
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Fast refresh of Text2DEntity does not work

2019-04-30 Thread Volker Enderlein

Hi,


I'm facing a really awkward bug.

I have a Text2DEntity displaying a variable that increases every 100 ms. 
But sometimes the display is wrong. A texture is displayed that already 
has been shown some time ago. Therefore my value visually does not 
increase but jumps between arbitrary values.



Sometimes also the following message is logged:

Warning: [Qt3DRender::GLTexture] No QTextureData generated from Texture 
Generator yet



Searching the bug tracker leads to reports

https://bugreports.qt.io/browse/QTBUG-63561

and

https://bugreports.qt.io/browse/QTBUG-65775

They seem somewhat related although they should have been resolved in my 
Qt 13.0 beta version or do not apply anymore.



Are those bugs still present? And if they are, is there a workaround?


Cheers, Volker


--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] Does qt3d support occlusion query?

2019-04-24 Thread Philip Schuchardt
I'm interested in using occlusion query for an image processing task to
count pixels. Does Qt3D support occlusion query, if not, is there a way
call OpenGL commands directly to run the query?

Thanks,
Phi|ip
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D] What are active render targets for a ScreenRayCaster?

2019-03-28 Thread Volker Enderlein

Hi Mike,

thanks a lot for your valuable clarifications. When talking about the 
main area you mean the area where the three cameras overlap (two 
orthographic and one perspective)? I always get three hitsChanged 
signals emitted in this area, no matter where I click onto.

I see if I can put up a simple example that shows the mentioned behaviour.

Cheers, Volker

Am 28.03.2019 um 14:35 schrieb Mike Krus:

Hi Volker

if I remember correctly, ray casting will apply to all enabled surfaces. It’ll 
ignore off screen surfaces and surfaces where the cursor is outside the render 
area. I think it also ignores surfaces when an orthographic camera is used.

So in your case sounds like you should only get a single hit in the main area, 
and two when testing in the render areas.

5.13 is introducing a QNoPicking frame graph node to explicitly disable picking 
and ray casting on portions of the frame graph.
  
If you continue having issues with this, please create a JIRA ticket, ideally with a small example.


Regards,
Mike


On 28 Mar 2019, at 11:13, Volker Enderlein  
wrote:

Hi,

The KDAB article 
https://www.kdab.com/new-in-qt-3d-5-11-generalized-ray-casting/ states that the 
ScreeenRayCast test is performed for every active render target. I just 
stumbled over the question what an active render target is considered for a 
ScreenRayCaster.

My FrameGraph contains an orthographic background viewport/camera, a SceneGraph 
viewport/camera and an orthographic overlay viewport/camera that fill the 
entire normalized viewport.

Additionally two smaller viewport/camera exist at the bottom of the window for 
an axis gnomon and a fps counter.

When triggering a ScreenRayCaster test with the current mouse position the 
hitsChanged signal is emitted multiple times with different hits.

Traversing the scenegraph upwards from the hitted entity (mostly a 
DistanceFieldTextRenderer is hit) leads me to entities that let me doubt on the 
returned hit.


Anyone out there who can shed some light on it? Thanks in advance.


Cheers, Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D] What are active render targets for a ScreenRayCaster?

2019-03-28 Thread Volker Enderlein

Hi,

The KDAB article 
https://www.kdab.com/new-in-qt-3d-5-11-generalized-ray-casting/ states 
that the ScreeenRayCast test is performed for every active render 
target. I just stumbled over the question what an active render target 
is considered for a ScreenRayCaster.


My FrameGraph contains an orthographic background viewport/camera, a 
SceneGraph viewport/camera and an orthographic overlay viewport/camera 
that fill the entire normalized viewport.


Additionally two smaller viewport/camera exist at the bottom of the 
window for an axis gnomon and a fps counter.


When triggering a ScreenRayCaster test with the current mouse position 
the hitsChanged signal is emitted multiple times with different hits.


Traversing the scenegraph upwards from the hitted entity (mostly a 
DistanceFieldTextRenderer is hit) leads me to entities that let me doubt 
on the returned hit.



Anyone out there who can shed some light on it? Thanks in advance.


Cheers, Volker

--
 


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D: Support for loading binary glTF 2.0 files (*.glb)

2019-03-26 Thread Marcin Musial
Thank you for your quick reponses.

On Tue, Mar 26, 2019, 09:53 Sean Harmer via Interest <
interest@qt-project.org> wrote:

> Hi,
>
> We're working on complete glTF 2 support in Kuesa which is built on top of
> Qt 3D here:
>
> https://github.com/KDAB/kuesa
>
> Binary support is one of the next things on the backlog. Other missing
> features at present are morph target animations and multiple texture
> coordinate sets. These are planned for our next sprint.
>
> Cheers,
>
> Sean
> On 25/03/2019 22:29, Marcin Musial wrote:
>
> Hi,
>
> Are there any plans for 5.13 to support loading also binary glTF 2.0 files
> (*.glb)? Qt3DRender::QSceneLoader is expecting JSON glTF text files only.
>
> ___
> Interest mailing 
> listInterest@qt-project.orghttps://lists.qt-project.org/listinfo/interest
>
> --
> Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
> KDAB (UK) Ltd, a KDAB Group company
> Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
> Mobile: +44 (0)7545 140604
> KDAB - Qt Experts
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D: Support for loading binary glTF 2.0 files (*.glb)

2019-03-26 Thread Sean Harmer via Interest

Hi,

We're working on complete glTF 2 support in Kuesa which is built on top 
of Qt 3D here:


https://github.com/KDAB/kuesa

Binary support is one of the next things on the backlog. Other missing 
features at present are morph target animations and multiple texture 
coordinate sets. These are planned for our next sprint.


Cheers,

Sean

On 25/03/2019 22:29, Marcin Musial wrote:

Hi,

Are there any plans for 5.13 to support loading also binary glTF 2.0 
files (*.glb)? Qt3DRender::QSceneLoader is expecting JSON glTF text 
files only.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


--
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D: Support for loading binary glTF 2.0 files (*.glb)

2019-03-26 Thread Oleg Evseev
Hi,

I don't know about *.gl, but maybe you will be able to find related
information in glTF 2.0 support discussion
https://bugreports.qt.io/browse/QTBUG-61258 if you haven't seen it yet.

вт, 26 мар. 2019 г. в 01:30, Marcin Musial :

> Hi,
>
> Are there any plans for 5.13 to support loading also binary glTF 2.0 files
> (*.glb)? Qt3DRender::QSceneLoader is expecting JSON glTF text files only.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D: Support for loading binary glTF 2.0 files (*.glb)

2019-03-25 Thread Marcin Musial
Hi,

Are there any plans for 5.13 to support loading also binary glTF 2.0 files
(*.glb)? Qt3DRender::QSceneLoader is expecting JSON glTF text files only.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D Vulkan back-end

2019-02-21 Thread Daniel Proksch
Hi,

Does anyone know about plans for a Vulkan back-end for Qt3D?
Looks like there was some work started in the past ( 
https://codereview.qt-project.org/#/c/196945/ ) that was abandoned since.


Thanks!
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D setting LineWidth per GeometryRenderer/Entity

2019-02-06 Thread Volker Enderlein
Thanks Mike and Sean for your valuable input. It helps me to shape my 
solution.


Cheers, Volker

Am 06.02.2019 um 09:56 schrieb Mike Krus:

Hi

you should be able to control that using a  QLineWidth render state. And yes, 
that would require custom material or frame graph.

The raycasting-qml manual test that ships with Qt3D shows an example of 
creating a simple flat shading material for lines, would be easy to add line 
width control to that…


Mike



On 6 Feb 2019, at 08:20, Volker Enderlein  
wrote:

Hi all,


is it possible to set the LineWidth of a GeometryRenderer of primitive tpye 
Lines or do I need a Custom Material/Effect/FrameGraph node to achieve this?

Thanks for enlightening.


Cheers, Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

--
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D setting LineWidth per GeometryRenderer/Entity

2019-02-06 Thread Mike Krus via Interest
Hi

you should be able to control that using a  QLineWidth render state. And yes, 
that would require custom material or frame graph.

The raycasting-qml manual test that ships with Qt3D shows an example of 
creating a simple flat shading material for lines, would be easy to add line 
width control to that…


Mike


> On 6 Feb 2019, at 08:20, Volker Enderlein  
> wrote:
> 
> Hi all,
> 
> 
> is it possible to set the LineWidth of a GeometryRenderer of primitive tpye 
> Lines or do I need a Custom Material/Effect/FrameGraph node to achieve this?
> 
> Thanks for enlightening.
> 
> 
> Cheers, Volker
> 
> -- 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

--
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D setting LineWidth per GeometryRenderer/Entity

2019-02-06 Thread Mike Krus via Interest
Hi

you should be able to control that using a  QLineWidth render state. And yes, 
that would require custom material or frame graph.

The raycasting-qml manual test that ships with Qt3D shows an example of 
creating a simple flat shading material for lines, would be easy to add line 
width control to that…


Mike


> On 6 Feb 2019, at 08:20, Volker Enderlein  
> wrote:
> 
> Hi all,
> 
> 
> is it possible to set the LineWidth of a GeometryRenderer of primitive tpye 
> Lines or do I need a Custom Material/Effect/FrameGraph node to achieve this?
> 
> Thanks for enlightening.
> 
> 
> Cheers, Volker
> 
> -- 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

--
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D setting LineWidth per GeometryRenderer/Entity

2019-02-06 Thread Sean Harmer

Hi,

At present I think using a material per entity is the easiest way to 
achieve this. Make an effect that you can share between all your 
wireframe material instances and then "override" the line width in the 
state set. I think that should work.


Cheers,

Sean

On 06/02/2019 08:20, Volker Enderlein wrote:

Hi all,


is it possible to set the LineWidth of a GeometryRenderer of primitive 
tpye Lines or do I need a Custom Material/Effect/FrameGraph node to 
achieve this?


Thanks for enlightening.


Cheers, Volker

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D viewAll/viewEntity

2019-02-06 Thread Mike Krus via Interest
Hi

it’s mostly an oversight. The current calculations are only valid for 
perspective projection but it would possible to add separate code path for 
orthogonal projection. Not sure about the generalised project matrix…

Please file a JIRA ticket if it’s something you’re interested in.

Of course, contributions are more than welcome :)


Mike

> On 6 Feb 2019, at 08:17, Volker Enderlein  
> wrote:
> 
> Hi all,
> 
> why does the viewAll and viewEntity commands of QCamera only work in 
> PerspectiveProjection type?
> 
> Thanks for enlightening.
> 
> Cheers, Volker
> 
> -- 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

--
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D setting LineWidth per GeometryRenderer/Entity

2019-02-06 Thread Volker Enderlein

Hi all,


is it possible to set the LineWidth of a GeometryRenderer of primitive 
tpye Lines or do I need a Custom Material/Effect/FrameGraph node to 
achieve this?


Thanks for enlightening.


Cheers, Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D viewAll/viewEntity

2019-02-06 Thread Volker Enderlein

Hi all,

why does the viewAll and viewEntity commands of QCamera only work in 
PerspectiveProjection type?


Thanks for enlightening.

Cheers, Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D: A custom camera controller

2019-01-29 Thread Volker Enderlein

Hi all,

I implemented a custom camera controller (implementing the 
ExaminerViewer camera handling from OpenInventor) and don't know how to 
select the linearSpeed and the lookSpeed values dependent on the size of 
the scene as my scenegraph can be changed at runtime. I came up with a 
solution but it is not working as expected.


    auto heightAngle = theCamera->fieldOfView() / 180.0f * 
static_cast(M_PI);

    auto focalDist = theCamera->viewVector().length();
    auto height = 2.0f * focalDist * std::tan(heightAngle / 2.0f);
    height = height < 1.0f ? 1.0f : height;
    auto width = height / theCamera->aspectRatio();
    // NDC (left, right, bottom, top) (-1, 1, -1, 1)
    // MagnificationFactor: max(height, width)/linearSpeed()
    auto linearSpeedMagnificationFactor = std::max(height, 
width)/linearSpeed();


Are there any examples/experiences implementing custom camera controllers?

Thanks in advance,

Cheers, Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D: Handling a mix of transparent and opaque objects

2019-01-29 Thread Volker Enderlein

Hi all,


I have a mix of opaque and transparent objects in a varying SceneGraph 
and sometimes see rendering issues (the order of drawing is wrong, 
typically for Text2dEntities). As I saw from the examples a typical 
approach is to set up a two pass rendering in the FrameGraph and handle 
the drawing order by myself.


Are there any plans for Qt3D to support the handling of transparent 
objects out of the box?



Thanks in advance, Volker


--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D: Rendering issues with custom effects

2019-01-09 Thread Mike Krus via Interest
Hi

any chance you could try a more recent version? Lots of fixes since then…


Mike

> On 9 Jan 2019, at 10:59, Volker Enderlein  
> wrote:
> 
> Hi,
> 
> 
> 
> I am facing some rendering issues with custom effects in Qt3d. To mark some 
> of the entities selected I replace the existing material effect of an entity 
> with a newly created instance of a wireframe effect. When using the 
> robustwireframe shaders sometimes (but not always, it does not seem to be 
> reproducible) on some entities the underlying color (phong shading model) is 
> not set properly. 
> 
> I tried different shaders (also tried to set the fragment color directly) but 
> the result does not change: sometimes I see those rendering issues. 
> 
> And in some cases the following message is written to the console: 
> 
> QPainter::begin: Paint device returned engine == 0, type: 3
> QPainter::setCompositionMode: Painter not active
> QPainter::end: Painter not active, aborted
> 
> So I'm guessing, setting the custom QEffect causes some issues.
> 
> My question is: Should I avoid creating many instances of a custom wireframe 
> effect and reuse one instance for all selected entities or should I create a 
> separate instance for every entity (material)?
> 
>  
> 
> The left part of the image shows the wrong behaviour, the right part is the 
> expected rendering. 
> 
> Platform specs: Windows 7 x64, Visual Studio 2015, Qt 5.10.0, Qt3D 
> 
> Graphics specs: NVidia GeForce GTX 750 Ti/PCIe/SSE2, OpenGL 4.6.0 NVIDIA 
> 391.35
> 
> 
> 
> The definition of the effect is as follows:
> 
> 
> 
> WireFrameEffect::WireFrameEffect(Qt3DCore::QNode* parent/* = nullptr*/)
> : Qt3DRender::QEffect(parent)
> {
> addParameter(new Qt3DRender::QParameter(QStringLiteral("ka"), 
> QVector4D(0.1f, 0.1f, 0.1f, 1.0f)));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("kd"), 
> QVector4D(0.7f, 0.7f, 0.7f, 1.0f)));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("ks"), 
> QVector4D(0.95f, 0.95f, 0.95f, 1.0f)));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("ke"), 
> QVector4D(0.0f, 0.0f, 0.0f, 1.0f)));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("shininess"), 
> 128.0f));
> 
> addParameter(new 
> Qt3DRender::QParameter(QStringLiteral("light.position"), QVector4D(0.0f, 
> 0.0f, 0.0f, 1.0f)));
> addParameter(new 
> Qt3DRender::QParameter(QStringLiteral("light.intensity"), QVector3D(1.0f, 
> 1.0f, 1.0f)));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("line.width"), 
> 1.0f));
> addParameter(new Qt3DRender::QParameter(QStringLiteral("line.color"), 
> QVector4D(1.0f, 1.0f, 1.0f, 1.0f)));
> 
> auto technique = new Qt3DRender::QTechnique;
> {
> auto graphicsApiFilter = technique->graphicsApiFilter();
> 
> graphicsApiFilter->setApi(Qt3DRender::QGraphicsApiFilter::Api::OpenGL);
> 
> graphicsApiFilter->setProfile(Qt3DRender::QGraphicsApiFilter::OpenGLProfile::CoreProfile);
> graphicsApiFilter->setMajorVersion(3);
> graphicsApiFilter->setMinorVersion(1);
> 
> auto filterKey = new Qt3DRender::QFilterKey;
> filterKey->setName(QStringLiteral("renderingStyle"));
> filterKey->setValue(QStringLiteral("forward"));
> technique->addFilterKey(filterKey);
> 
> auto renderPass = new Qt3DRender::QRenderPass;
> {
> auto shaderProgram = new Qt3DRender::QShaderProgram;
> 
> shaderProgram->setVertexShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.vert";
> 
> shaderProgram->setGeometryShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.geom";
> 
> shaderProgram->setFragmentShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.frag";
> renderPass->setShaderProgram(shaderProgram);
> }
> technique->addRenderPass(renderPass);
> }
> addTechnique(technique);
> }
> 
> 
> Thanks in advance,
> 
> Cheers Volker
> 
> -- 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

--
Mike Krus | mike.k...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts



smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt3D: Rendering issues with custom effects

2019-01-09 Thread Volker Enderlein

Hi,


I am facing some rendering issues with custom effects in Qt3d. To mark 
some of the entities selected I replace the existing material effect of 
an entity with a newly created instance of a wireframe effect. When 
using the robustwireframe shaders sometimes (but not always, it does not 
seem to be reproducible) on some entities the underlying color (phong 
shading model) is not set properly.


I tried different shaders (also tried to set the fragment color 
directly) but the result does not change: sometimes I see those 
rendering issues.


And in some cases the following message is written to the console:

QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted

So I'm guessing, setting the custom QEffect causes some issues.

My question is: Should I avoid creating many instances of a custom 
wireframe effect and reuse one instance for all selected entities or 
should I create a separate instance for every entity (material)?



The left part of the image shows the wrong behaviour, the right part is 
the expected rendering.


Platform specs: Windows 7 x64, Visual Studio 2015, Qt 5.10.0, Qt3D

Graphics specs: NVidia GeForce GTX 750 Ti/PCIe/SSE2, OpenGL 4.6.0 NVIDIA 
391.35



The definition of the effect is as follows:


    WireFrameEffect::WireFrameEffect(Qt3DCore::QNode* parent/* = nullptr*/)
        : Qt3DRender::QEffect(parent)
    {
        addParameter(new Qt3DRender::QParameter(QStringLiteral("ka"), 
QVector4D(0.1f, 0.1f, 0.1f, 1.0f)));
        addParameter(new Qt3DRender::QParameter(QStringLiteral("kd"), 
QVector4D(0.7f, 0.7f, 0.7f, 1.0f)));
        addParameter(new Qt3DRender::QParameter(QStringLiteral("ks"), 
QVector4D(0.95f, 0.95f, 0.95f, 1.0f)));
        addParameter(new Qt3DRender::QParameter(QStringLiteral("ke"), 
QVector4D(0.0f, 0.0f, 0.0f, 1.0f)));
        addParameter(new 
Qt3DRender::QParameter(QStringLiteral("shininess"), 128.0f));


        addParameter(new 
Qt3DRender::QParameter(QStringLiteral("light.position"), QVector4D(0.0f, 
0.0f, 0.0f, 1.0f)));
        addParameter(new 
Qt3DRender::QParameter(QStringLiteral("light.intensity"), 
QVector3D(1.0f, 1.0f, 1.0f)));
        addParameter(new 
Qt3DRender::QParameter(QStringLiteral("line.width"), 1.0f));
        addParameter(new 
Qt3DRender::QParameter(QStringLiteral("line.color"), QVector4D(1.0f, 
1.0f, 1.0f, 1.0f)));


        auto technique = new Qt3DRender::QTechnique;
        {
            auto graphicsApiFilter = technique->graphicsApiFilter();
graphicsApiFilter->setApi(Qt3DRender::QGraphicsApiFilter::Api::OpenGL);
graphicsApiFilter->setProfile(Qt3DRender::QGraphicsApiFilter::OpenGLProfile::CoreProfile);
            graphicsApiFilter->setMajorVersion(3);
            graphicsApiFilter->setMinorVersion(1);

            auto filterKey = new Qt3DRender::QFilterKey;
filterKey->setName(QStringLiteral("renderingStyle"));
            filterKey->setValue(QStringLiteral("forward"));
            technique->addFilterKey(filterKey);

            auto renderPass = new Qt3DRender::QRenderPass;
            {
                auto shaderProgram = new Qt3DRender::QShaderProgram;
shaderProgram->setVertexShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.vert";
shaderProgram->setGeometryShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.geom";
shaderProgram->setFragmentShaderCode(shaderProgram->loadSource(QUrl(QStringLiteral("qrc:/shaders/robustwireframe.frag";
                renderPass->setShaderProgram(shaderProgram);
            }
            technique->addRenderPass(renderPass);
        }
        addTechnique(technique);
    }

Thanks in advance,

Cheers Volker

--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D][Android] Weird different performance on almost same class GPUs

2019-01-01 Thread Oleg Evseev
 I've tested another tablet, made test app and summarized all results I
have in bug report:
https://bugreports.qt.io/browse/QTBUG-72808

---
With regards, Oleg.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-19 Thread david crémoux
Then I would stay with the first solution I proposed, it will be more 
flexible in your case: regular text2dentity with custom frame graph 
branch and custom camera.


There is just one thing to be aware about the text2dentity, the entity 
doesn't do the rendering itself: it contains another entity which is 
taking card of the rendering (DistanceFieldTextRenderer).
So if you use a layer filter and attach it to the text2dentity, you 
should set it to be recursive to affect the rendering child entity.
Moreover this "rendering" entity set by default some render states, like 
the depth test, which may be boring to achieve the exact rendering you 
want (in my case it is ...).


david

On 19-Dec-18 11:14, Volker Enderlein wrote:
The number of Text2D elements is not known in advance and may differ. 
It's a simulation environment, where some textual information is added 
to a fairly high number of elements.
To avoid the data management for different kinds of entities my first 
idea was to create a specialized Text2d  entity that handles all the 
gory details in a custom material and provides an option to always face 
the camera.


Cheers Volker

Am 19.12.2018 um 08:37 schrieb david crémoux:

You're welcome.

I will most probably have to implement the same feature in a near 
future for the project I'm currently working on.


If making the custom camera is too much complex, there is a more basic 
way but involving more data management (depending on how much 2d text 
entities you have to display):
You still use a specific frame graph branch with a layer filter but 
with an identity camera.
Then you attach all your 2d text entities to your scene root entity 
and you update their transform/position on every camera transform/move.


david

On 19-Dec-18 10:05, Volker Enderlein wrote:

Hi David,

thanks for the answer. I wasn't thinking of that, as my knowledge 
about framegraphs is very limited. But this helps me further.


Cheers Volker

Am 18.12.2018 um 14:53 schrieb david crémoux:

Hello Volker,

I guess you can achieve it with regular QText2DEntity, with a 
specific frame graph branch in your rendering for your 2d text, a 
layer filter and a custom camera (based on your main camera).


david

On 18-Dec-18 14:37, Volker Enderlein wrote:

Hi all,

when building a rather complex Qt3D-Scene I needed some 2D-Text 
that has a 3D position, is always facing the camera, and fixed in 
size, independent of the camera settings.


While looking over the components provided by Qt3D I stumbled 
across Text2DEntity and thought about how it can be tweaked ot 
fulfill my requirements.


As all my requirements can be done inside a shader I thought about 
whether the QText2DMaterial that is used inside the class can be 
replaced by a custom material. But unfortunately the material is 
not accessible from outside.


Text2DEntity can be embedded in another class that applies the 
camera information to it, but is there an easier solution to this 
problem?


Cheers Volker






___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Qt3D][Android] Weird different performance on almost same class GPUs

2018-12-19 Thread Paul Lemire via Interest
Hi Oleg,

Could you specify the screen resolutions of your phones as well please?
(I suspect they are lower than the tablet)

From what you are describing (moving further/nearer/multisampling) it
seems you are having fragment shader performance limitations.

You didn't specify what the benchmarks were doing, ideally you should be
looking at a fragment fill rate benchmark.

If that's the case, not much that can be done here apart from:

1) Simplifying your fragment shaders

2) Reducing potential overdraws (use depth testing, culling)

3) Generally speaking, trying to limit the amount of fragments

Since it seems you are using Scene3D, would you happen to have a
fullscreen QtQuick Rectangle underneath as a background? From past
experience,  this itself can actually put a bit of strain on the
fragment performance directly. (Using an Item + the window's clear color
might provide a work around).

Hopefully this can be of some help,

Paul

On 18/12/2018 18:43, Oleg Evseev wrote:
> Hi all,
>
> I have two phones:
> Qualcomm Snapdragon 400 MSM8928, GPU Adreno 305, OpenGL ES 3.0, RAM 1Gb
> Qualcomm APQ8064 Snapdragon S4 Pro, GPU Adreno 320, OpenGL ES 3.0, RAM
> 2Gb
>
> And one tablet:
> MediaTek MT8735, GPU Mali-T720 (1 core), OpenGL ES 3.1, 1280x800,
> Android 8.1, RAM 2Gb
>
> According to internet Adreno 305 and Mali-T720 have close performance.
> I run several 3d benchmarks and Mali-T720 (tablet) show better results
> than Adreno 305.
>
> Benchmarks of CPU MT8735 is twice better than  Snapdragon 400.
>
> But my qt application with Scene3D on tablet works much slower than on
> these phones.
> 3D scene is no so complex - just a skybox, 3d model, several lines and
> simple "ground".
>
> tablet FPS vs phone (any, they are quite simple) FPS:
>
> When camera far from model (far from it)
> 60 vs 50+ ( Adreno 305) (40+  FPS on Adreno 320)
> Making camera very close to model drop down fps to:
> 18-25 vs  ~45
>
> Enabling anti-aliasing (Scene3D multisample: enable) dramatically
> slows down tablet. Multisampling has almost no effect on phones.
> 8-10 vs  ~40 (camera is close to model )
>
> Without 3dmodel and other stuff only skybox almost same result on tablet:
> 60+ FPS without and ~25 FPS with multisampling.
>
> Working with Qt 5.9.5. I've tested Qt 5.12 - same result.
>
> Thanks in advance for any help or tips what to check.
>
> ---
> With regards, Oleg.
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

-- 
Paul Lemire | paul.lem...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: S/MIME Cryptographic Signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-19 Thread Volker Enderlein
The number of Text2D elements is not known in advance and may differ. 
It's a simulation environment, where some textual information is added 
to a fairly high number of elements.
To avoid the data management for different kinds of entities my first 
idea was to create a specialized Text2d  entity that handles all the 
gory details in a custom material and provides an option to always face 
the camera.


Cheers Volker

Am 19.12.2018 um 08:37 schrieb david crémoux:

You're welcome.

I will most probably have to implement the same feature in a near 
future for the project I'm currently working on.


If making the custom camera is too much complex, there is a more basic 
way but involving more data management (depending on how much 2d text 
entities you have to display):
You still use a specific frame graph branch with a layer filter but 
with an identity camera.
Then you attach all your 2d text entities to your scene root entity 
and you update their transform/position on every camera transform/move.


david

On 19-Dec-18 10:05, Volker Enderlein wrote:

Hi David,

thanks for the answer. I wasn't thinking of that, as my knowledge 
about framegraphs is very limited. But this helps me further.


Cheers Volker

Am 18.12.2018 um 14:53 schrieb david crémoux:

Hello Volker,

I guess you can achieve it with regular QText2DEntity, with a 
specific frame graph branch in your rendering for your 2d text, a 
layer filter and a custom camera (based on your main camera).


david

On 18-Dec-18 14:37, Volker Enderlein wrote:

Hi all,

when building a rather complex Qt3D-Scene I needed some 2D-Text 
that has a 3D position, is always facing the camera, and fixed in 
size, independent of the camera settings.


While looking over the components provided by Qt3D I stumbled 
across Text2DEntity and thought about how it can be tweaked ot 
fulfill my requirements.


As all my requirements can be done inside a shader I thought about 
whether the QText2DMaterial that is used inside the class can be 
replaced by a custom material. But unfortunately the material is 
not accessible from outside.


Text2DEntity can be embedded in another class that applies the 
camera information to it, but is there an easier solution to this 
problem?


Cheers Volker





--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-18 Thread david crémoux

You're welcome.

I will most probably have to implement the same feature in a near future 
for the project I'm currently working on.


If making the custom camera is too much complex, there is a more basic 
way but involving more data management (depending on how much 2d text 
entities you have to display):
You still use a specific frame graph branch with a layer filter but with 
an identity camera.
Then you attach all your 2d text entities to your scene root entity and 
you update their transform/position on every camera transform/move.


david

On 19-Dec-18 10:05, Volker Enderlein wrote:

Hi David,

thanks for the answer. I wasn't thinking of that, as my knowledge about 
framegraphs is very limited. But this helps me further.


Cheers Volker

Am 18.12.2018 um 14:53 schrieb david crémoux:

Hello Volker,

I guess you can achieve it with regular QText2DEntity, with a specific 
frame graph branch in your rendering for your 2d text, a layer filter 
and a custom camera (based on your main camera).


david

On 18-Dec-18 14:37, Volker Enderlein wrote:

Hi all,

when building a rather complex Qt3D-Scene I needed some 2D-Text that 
has a 3D position, is always facing the camera, and fixed in size, 
independent of the camera settings.


While looking over the components provided by Qt3D I stumbled across 
Text2DEntity and thought about how it can be tweaked ot fulfill my 
requirements.


As all my requirements can be done inside a shader I thought about 
whether the QText2DMaterial that is used inside the class can be 
replaced by a custom material. But unfortunately the material is not 
accessible from outside.


Text2DEntity can be embedded in another class that applies the camera 
information to it, but is there an easier solution to this problem?


Cheers Volker




___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-18 Thread Volker Enderlein

Hi David,

thanks for the answer. I wasn't thinking of that, as my knowledge about 
framegraphs is very limited. But this helps me further.


Cheers Volker

Am 18.12.2018 um 14:53 schrieb david crémoux:

Hello Volker,

I guess you can achieve it with regular QText2DEntity, with a specific 
frame graph branch in your rendering for your 2d text, a layer filter 
and a custom camera (based on your main camera).


david

On 18-Dec-18 14:37, Volker Enderlein wrote:

Hi all,

when building a rather complex Qt3D-Scene I needed some 2D-Text that 
has a 3D position, is always facing the camera, and fixed in size, 
independent of the camera settings.


While looking over the components provided by Qt3D I stumbled across 
Text2DEntity and thought about how it can be tweaked ot fulfill my 
requirements.


As all my requirements can be done inside a shader I thought about 
whether the QText2DMaterial that is used inside the class can be 
replaced by a custom material. But unfortunately the material is not 
accessible from outside.


Text2DEntity can be embedded in another class that applies the camera 
information to it, but is there an easier solution to this problem?


Cheers Volker



--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-18 Thread Jason H
I don't know anything about Qt3D, but in 3D parlance, they are called "sprites"

https://www.kdab.com/new-in-qt-5-10-texture-based-animations-in-qt-3d/
https://doc.qt.io/qt-5.11/qt3dextras-qspritesheet.html


> Sent: Tuesday, December 18, 2018 at 6:37 AM
> From: "Volker Enderlein" 
> To: interest@qt-project.org
> Subject: [Interest] Qt3D How to draw 2D-Text always facing the Camera
>
> Hi all,
> 
> when building a rather complex Qt3D-Scene I needed some 2D-Text that has 
> a 3D position, is always facing the camera, and fixed in size, 
> independent of the camera settings.
> 
> While looking over the components provided by Qt3D I stumbled across 
> Text2DEntity and thought about how it can be tweaked ot fulfill my 
> requirements.
> 
> As all my requirements can be done inside a shader I thought about 
> whether the QText2DMaterial that is used inside the class can be 
> replaced by a custom material. But unfortunately the material is not 
> accessible from outside.
> 
> Text2DEntity can be embedded in another class that applies the camera 
> information to it, but is there an easier solution to this problem?
> 
> Cheers Volker
> 
> -- 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
> 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-18 Thread Philip Schuchardt
If you rendering in QtQuick you can use a Text{} item and project it's
position into screen space.

On Tue, Dec 18, 2018 at 10:46 AM Volker Enderlein <
volker.enderl...@ifm-chemnitz.de> wrote:

> Hi Oleg,
>
> thank you so much for your comment. I saw your entry in the bug tracker
> and therefore I tried to go the way with the custom material.
> Unfortunately I cannot access the underlying material definition of the
> utility classes that are used to render the text in Text2DEntity. As
> they are all private and not exported from Qt DLLs I would need to copy
> them, but that's something I would really try to avoid. The custom
> material part was straight forward, based on your bug report and on a
> previous implementation of a specialized material definition.
> But now I'm stuck with the missing access.
>
> Cheers Volker
>
> Am 18.12.2018 um 13:38 schrieb Oleg Evseev:
> > Hi Volker,
> >
> > Yes, you have to add custom material because
> > Qt3DRender::QShaderProgram s of default materials are inside private
> > class, so you can't change shaders' code source.
> >
> > Take a look at https://codereview.qt-project.org/#/c/182053/ (that was
> > for including in qt 3d, but you could easily use it as custom material
> > in your own app) and adopt it accordingly to Text2DMaterial.
> >
> > ---
> > With regards, Oleg
> >
> > вт, 18 дек. 2018 г. в 15:07, Volker Enderlein
> >  > >:
> >
> > Hi all,
> >
> > when building a rather complex Qt3D-Scene I needed some 2D-Text
> > that has
> > a 3D position, is always facing the camera, and fixed in size,
> > independent of the camera settings.
> >
> > While looking over the components provided by Qt3D I stumbled across
> > Text2DEntity and thought about how it can be tweaked ot fulfill my
> > requirements.
> >
> > As all my requirements can be done inside a shader I thought about
> > whether the QText2DMaterial that is used inside the class can be
> > replaced by a custom material. But unfortunately the material is not
> > accessible from outside.
> >
> > Text2DEntity can be embedded in another class that applies the camera
> > information to it, but is there an easier solution to this problem?
> >
> > Cheers Volker
> >
> > --
> >
> > ___
> > Interest mailing list
> > Interest@qt-project.org 
> > https://lists.qt-project.org/listinfo/interest
> >
>
> --
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] [Qt3D][Android] Weird different performance on almost same class GPUs

2018-12-18 Thread Oleg Evseev
Hi all,

I have two phones:
Qualcomm Snapdragon 400 MSM8928, GPU Adreno 305, OpenGL ES 3.0, RAM 1Gb
Qualcomm APQ8064 Snapdragon S4 Pro, GPU Adreno 320, OpenGL ES 3.0, RAM 2Gb

And one tablet:
MediaTek MT8735, GPU Mali-T720 (1 core), OpenGL ES 3.1, 1280x800, Android
8.1, RAM 2Gb

According to internet Adreno 305 and Mali-T720 have close performance.
I run several 3d benchmarks and Mali-T720 (tablet) show better results than
Adreno 305.

Benchmarks of CPU MT8735 is twice better than  Snapdragon 400.

But my qt application with Scene3D on tablet works much slower than on
these phones.
3D scene is no so complex - just a skybox, 3d model, several lines and
simple "ground".

tablet FPS vs phone (any, they are quite simple) FPS:

When camera far from model (far from it)
60 vs 50+ ( Adreno 305) (40+  FPS on Adreno 320)
Making camera very close to model drop down fps to:
18-25 vs  ~45

Enabling anti-aliasing (Scene3D multisample: enable) dramatically slows
down tablet. Multisampling has almost no effect on phones.
8-10 vs  ~40 (camera is close to model )

Without 3dmodel and other stuff only skybox almost same result on tablet:
60+ FPS without and ~25 FPS with multisampling.

Working with Qt 5.9.5. I've tested Qt 5.12 - same result.

Thanks in advance for any help or tips what to check.

---
With regards, Oleg.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt3D How to draw 2D-Text always facing the Camera

2018-12-18 Thread Volker Enderlein

Hi Oleg,

thank you so much for your comment. I saw your entry in the bug tracker 
and therefore I tried to go the way with the custom material. 
Unfortunately I cannot access the underlying material definition of the 
utility classes that are used to render the text in Text2DEntity. As 
they are all private and not exported from Qt DLLs I would need to copy 
them, but that's something I would really try to avoid. The custom 
material part was straight forward, based on your bug report and on a 
previous implementation of a specialized material definition.

But now I'm stuck with the missing access.

Cheers Volker

Am 18.12.2018 um 13:38 schrieb Oleg Evseev:

Hi Volker,

Yes, you have to add custom material because 
Qt3DRender::QShaderProgram s of default materials are inside private 
class, so you can't change shaders' code source.


Take a look at https://codereview.qt-project.org/#/c/182053/ (that was 
for including in qt 3d, but you could easily use it as custom material 
in your own app) and adopt it accordingly to Text2DMaterial.


---
With regards, Oleg

вт, 18 дек. 2018 г. в 15:07, Volker Enderlein 
>:


Hi all,

when building a rather complex Qt3D-Scene I needed some 2D-Text
that has
a 3D position, is always facing the camera, and fixed in size,
independent of the camera settings.

While looking over the components provided by Qt3D I stumbled across
Text2DEntity and thought about how it can be tweaked ot fulfill my
requirements.

As all my requirements can be done inside a shader I thought about
whether the QText2DMaterial that is used inside the class can be
replaced by a custom material. But unfortunately the material is not
accessible from outside.

Text2DEntity can be embedded in another class that applies the camera
information to it, but is there an easier solution to this problem?

Cheers Volker

-- 


___
Interest mailing list
Interest@qt-project.org 
https://lists.qt-project.org/listinfo/interest



--

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


  1   2   3   4   5   6   7   >