Discussion:
Offscreen rendering question...
(too old to reply)
rickbsgu
2011-02-28 14:40:04 UTC
Permalink
Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface

* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.
So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.
It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()
{
savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");
if (!savePath.isEmpty())
{
drawToBuffer = true;
bSurface = new QGLPixelBufferSurface();
bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));
connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);
this->update();
}
}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{
drawToBuffer = false;
disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));
QImage img = bSurface->pixelBuffer()->toImage();
delete bSurface;
img.save(savePath, "PNG");
QMessageBox::information(parentWidget(), "Information", "Image saved...");
}
(paint routine)
----------------
<...>
if (drawToBuffer)
painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)
{
painter->popSurface();
emit drawToPBufDone();
}

________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
r***@public.gmane.org
2011-02-28 21:35:00 UTC
Permalink
You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a separate QGLContext with its own state that isn't shared with the widget's QGLContext. You can make it share at construction time, but the QGLPainter is bound to a specific QGLContext. QGLFramebufferObject works within the original widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible to implement QGLPixelBufferSurface properly, so I better remove it or find some way for the QGLPainter to switch to another context as part of the surface switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org [qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on request to save.)
2. set a flag so that the next render will know we're to render to a pixel buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the QGLPixelBufferSurface onto the painter, draw, and then pop the QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering is done - that slot extracts the image from the member QGLPixelBufferSurface, saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...", ".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()), Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
rickbsgu
2011-02-28 23:15:20 UTC
Permalink
Thanks - that did work better. I had to re-bind the textures and I lose the
anti-aliasing, but it draws! :)

I was under the impression that doing the 'pushSurface' took care of the context
switching...?

Anyway, I think QGLPixelBufferSurface may still be what I need: I actually don't
want to draw to the screen. I'm doing that now just as a sanity check, and then
pushing it off to an off-screen device to see the result.

What I really want is to just gen a scene, render it directly into a buffer, and
save the buffer off in a .png, with no visual interaction. If
QGLPixelBufferSurface is the only GL context, would it work in this capacity?

Next test will be in this vein. I still need to figure out how to get
anti-aliasing on the buffer, though...

Thanks,
rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a
separate QGLContext with its own state that isn't shared with the widget's
QGLContext. You can make it share at construction time, but the QGLPainter is
bound to a specific QGLContext. QGLFramebufferObject works within the original
widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible
to implement QGLPixelBufferSurface properly, so I better remove it or find some
way for the QGLPainter to switch to another context as part of the surface
switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
Rhys Weatherley
2011-03-01 02:21:00 UTC
Permalink
On Tuesday, March 01, 2011, ext rickbsgu wrote:
> Thanks - that did work better. I had to re-bind the textures and I lose
> the anti-aliasing, but it draws! :)
>
> I was under the impression that doing the 'pushSurface' took care of the
> context switching...?

The way the code works requires that the context be the same. While it would
be possible to change the QGLPainterPrivate to a different context's
information, that would also entail shifting to a completely different surface
stack. The subsequent popSurface() wouldn't know how to switch back.

I've added a Q_ASSERT() to the code to warn when the QGLContext changes during
a pushSurface().

> Anyway, I think QGLPixelBufferSurface may still be what I need: I actually
> don't want to draw to the screen. I'm doing that now just as a sanity
> check, and then pushing it off to an off-screen device to see the result.
>
> What I really want is to just gen a scene, render it directly into a
> buffer, and save the buffer off in a .png, with no visual interaction. If
> QGLPixelBufferSurface is the only GL context, would it work in this
> capacity?

You can use QGLPainter::begin() with the QGLPixelBufferSurface as an argument
to get this effect. You just can't do it with pushSurface().

OpenGL pbuffers are practically obsolete - I wouldn't recommend using them for
code you intend to support over the long term.

Cheers,

Rhys.
rickbsgu
2011-03-13 21:35:15 UTC
Permalink
I'm a little confused on this...

The doc indicates that there is an included lib, but if I build without
'system_3ds' invoked, it doesn't work & I don't think I get the plugin. If I
build it with 'system_3ds' invoked, it works on 10.5 and 10.6 intel Macs - not
PPC. Doesn't work on PPC or Win. Does intel Mac have a 3ds import library on
board by default?

What exactly is the name of the plugin? Do I have to have it, or does it get
built into the library somehow? If so, is there a build flag or some such thing
I need to specify to get it to happen?

Can this even pick up 3ds files without having to supply the external .3ds lib?

Some clarification would be appreciated.

thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a
separate QGLContext with its own state that isn't shared with the widget's
QGLContext. You can make it share at construction time, but the QGLPainter is
bound to a specific QGLContext. QGLFramebufferObject works within the original
widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible
to implement QGLPixelBufferSurface properly, so I better remove it or find some
way for the QGLPainter to switch to another context as part of the surface
switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
s***@public.gmane.org
2011-03-14 05:18:09 UTC
Permalink
Hi Rick,

Sorry about the confusion here. I recently added support for the Asset Importer library and that should be the preferred support for all formats - pretty much it deprecates .obj and .3ds support from our previous plugins. You can get the old previous plugins by CONFIG += old_importer.

We integrated a source tree for lib3ds back in 2010 and by default you get that unless you CONFIG +system_3ds (and usually the paths for your copy of the lib3ds library specified). The file is usually lib3ds.so or whatever for your platform. I don't think Mac OSX would ship with lib3ds - you'd have to configure, make, make install the source package for lib3ds.

The answer is that assimp should be doing the job for you and if it isn't then that is a bug.


________________________________________
From: qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org [qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org]
Sent: Monday, March 14, 2011 7:35 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] 3ds support.

I'm a little confused on this...

The doc indicates that there is an included lib, but if I build without 'system_3ds' invoked, it doesn't work & I don't think I get the plugin. If I build it with 'system_3ds' invoked, it works on 10.5 and 10.6 intel Macs - not PPC. Doesn't work on PPC or Win. Does intel Mac have a 3ds import library on board by default?

What exactly is the name of the plugin? Do I have to have it, or does it get built into the library somehow? If so, is there a build flag or some such thing I need to specify to get it to happen?

Can this even pick up 3ds files without having to supply the external .3ds lib?

Some clarification would be appreciated.

thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a separate QGLContext with its own state that isn't shared with the widget's QGLContext. You can make it share at construction time, but the QGLPainter is bound to a specific QGLContext. QGLFramebufferObject works within the original widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible to implement QGLPixelBufferSurface properly, so I better remove it or find some way for the QGLPainter to switch to another context as part of the surface switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org> [qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>] On Behalf Of ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-qt3d-/***@public.gmane.org>]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on request to save.)
2. set a flag so that the next render will know we're to render to a pixel buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the QGLPixelBufferSurface onto the painter, draw, and then pop the QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering is done - that slot extracts the image from the member QGLPixelBufferSurface, saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...", ".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()), Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
rickbsgu
2011-03-14 13:41:17 UTC
Permalink
Ok, so, if I'm reading this right:

1) The asset importer library is included.
2) The asset importer library should read the .3ds file.

My current problem is that it looks like it's crashing on model read. After
that, it seems to crash on texture generation.

On the latter, I might not have had the tga plugin installed. Am verifying
that, now.

Caught in configuration/update hell....

rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "sarah.j.smith-***@public.gmane.org" <sarah.j.smith-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, March 14, 2011 1:18:09 AM
Subject: RE: [Qt-3d] 3ds support.

Hi Rick,

Sorry about the confusion here. I recently added support for the Asset Importer
library and that should be the preferred support for all formats - pretty much
it deprecates .obj and .3ds support from our previous plugins. You can get the
old previous plugins by CONFIG += old_importer.


We integrated a source tree for lib3ds back in 2010 and by default you get that
unless you CONFIG +system_3ds (and usually the paths for your copy of the lib3ds
library specified). The file is usually lib3ds.so or whatever for your
platform. I don't think Mac OSX would ship with lib3ds - you'd have to
configure, make, make install the source package for lib3ds.

The answer is that assimp should be doing the job for you and if it isn't then
that is a bug.


________________________________________
From: qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org]
Sent: Monday, March 14, 2011 7:35 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] 3ds support.

I'm a little confused on this...

The doc indicates that there is an included lib, but if I build without
'system_3ds' invoked, it doesn't work & I don't think I get the plugin. If I
build it with 'system_3ds' invoked, it works on 10.5 and 10.6 intel Macs - not
PPC. Doesn't work on PPC or Win. Does intel Mac have a 3ds import library on
board by default?

What exactly is the name of the plugin? Do I have to have it, or does it get
built into the library somehow? If so, is there a build flag or some such thing
I need to specify to get it to happen?

Can this even pick up 3ds files without having to supply the external .3ds lib?

Some clarification would be appreciated.

thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a
separate QGLContext with its own state that isn't shared with the widget's
QGLContext. You can make it share at construction time, but the QGLPainter is
bound to a specific QGLContext. QGLFramebufferObject works within the original
widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible
to implement QGLPixelBufferSurface properly, so I better remove it or find some
way for the QGLPainter to switch to another context as part of the surface
switch.

Cheers,

Rhys.
________________________________________
From:
qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
[qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>]
] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-qt3d-/***@public.gmane.org>]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
s***@public.gmane.org
2011-03-15 02:54:25 UTC
Permalink
Hi Rick,

I built the project from your "Oops here's the project email" - I guess that is referring to this issue?

For me it loads and displays the bookcover.3ds model, with its texture rendered, just fine using Asset Importer with qt3d/master

If you can give some more details on the crashes - platform, stack trace, error messages and so on - ideally as an actual bug report (and attach the relevant files to the report) - that would be great.

I can then have a go at fixing whatever the problem is - bit thin on detail right now.

Regards plug in issues - you can do export QT_DEBUG_PLUGINS to help with seeing if plugins are found.

Rgds,

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>




On 14/03/2011, at 11:41 PM, ext rickbsgu wrote:

Ok, so, if I'm reading this right:

1) The asset importer library is included.
2) The asset importer library should read the .3ds file.

My current problem is that it looks like it's crashing on model read. After that, it seems to crash on texture generation.

On the latter, I might not have had the tga plugin installed. Am verifying that, now.

Caught in configuration/update hell....

rickb

________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: "sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>" <sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>>
To: rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-qt3d-/***@public.gmane.org>; qt-3d-j2+***@public.gmane.org.com<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
Sent: Mon, March 14, 2011 1:18:09 AM
Subject: RE: [Qt-3d] 3ds support.

Hi Rick,

Sorry about the confusion here. I recently added support for the Asset Importer library and that should be the preferred support for all formats - pretty much it deprecates .obj and .3ds support from our previous plugins. You can get the old previous plugins by CONFIG += old_importer.

We integrated a source tree for lib3ds back in 2010 and by default you get that unless you CONFIG +system_3ds (and usually the paths for your copy of the lib3ds library specified). The file is usually lib3ds.so<http://lib3ds.so> or whatever for your platform. I don't think Mac OSX would ship with lib3ds - you'd have to configure, make, make install the source package for lib3ds.

The answer is that assimp should be doing the job for you and if it isn't then that is a bug.


________________________________________
From: qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:***@qt.nokia.com> [qt-3d-bounces+sarah.j.smith=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>] On Behalf Of ext rickbsgu [rbmailer-qt3d-/***@public.gmane.orgm<mailto:rbmailer-qt3d-/***@public.gmane.org>]
Sent: Monday, March 14, 2011 7:35 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
Subject: [Qt-3d] 3ds support.

I'm a little confused on this...

The doc indicates that there is an included lib, but if I build without 'system_3ds' invoked, it doesn't work & I don't think I get the plugin. If I build it with 'system_3ds' invoked, it works on 10.5 and 10.6 intel Macs - not PPC. Doesn't work on PPC or Win. Does intel Mac have a 3ds import library on board by default?

What exactly is the name of the plugin? Do I have to have it, or does it get built into the library somehow? If so, is there a build flag or some such thing I need to specify to get it to happen?

Can this even pick up 3ds files without having to supply the external .3ds lib?

Some clarification would be appreciated.

thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: "rhys.weatherley-***@public.gmane.org<mailto:rhys.weatherley-***@public.gmane.org>" <rhys.weatherley-***@public.gmane.org<mailto:rhys.weatherley-***@public.gmane.org>>
To: rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-qt3d-/***@public.gmane.org>; qt-3d-j2+***@public.gmane.org.com<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a separate QGLContext with its own state that isn't shared with the widget's QGLContext. You can make it share at construction time, but the QGLPainter is bound to a specific QGLContext. QGLFramebufferObject works within the original widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible to implement QGLPixelBufferSurface properly, so I better remove it or find some way for the QGLPainter to switch to another context as part of the surface switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org><mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrfQFizaE/***@public.gmane.orgm>> [qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:***@qt.nokia.com><mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>>] On Behalf Of ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-***@yahoo.com><mailto:rbmailer-qt3d-/***@public.gmane.org<mailto:rbmailer-qt3d-/***@public.gmane.org>>]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org><mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org<mailto:qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org>>
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on request to save.)
2. set a flag so that the next render will know we're to render to a pixel buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the QGLPixelBufferSurface onto the painter, draw, and then pop the QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering is done - that slot extracts the image from the member QGLPixelBufferSurface, saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...", ".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()), Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
rickbsgu
2011-03-13 21:49:00 UTC
Permalink
I wouldn't get rid of the QGLPixelBufferObject support - it's useful when you
don't want to have to paint to a widget. In my current example, I'm using a
small 200x200 widget to preview. On save image request, I can redraw in the
QGLPixelBufferObject at something like 5x the size. When I scale down the
resulting image back to the 200x200 size with the appropriate smoothing and
anti-aliasing flags, it comes out nice and sharp.

The way I'm getting around the context issue is by deleting the viewer,
instantiating the QGLPixelBufferObject, and then recreating the scene with that
context active.

Seems to work fine. I'm not sure how I'd do this with an FBO without showing
some big widget.

rickb
________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a
separate QGLContext with its own state that isn't shared with the widget's
QGLContext. You can make it share at construction time, but the QGLPainter is
bound to a specific QGLContext. QGLFramebufferObject works within the original
widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible
to implement QGLPixelBufferSurface properly, so I better remove it or find some
way for the QGLPainter to switch to another context as part of the surface
switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
rickbsgu
2011-03-13 23:59:36 UTC
Permalink
Is this no longer in sync w/ qt 4.7-stable? I pulled the latest updates on qt
4.7-stable, and the latest updates from qt3d master-stable.

I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a member of
QDeclarativePixmap' and 'Asynchronous is not a member of QDeclarativePixmap'.

I used to get this if I didn't checkout 'master-stable' - now it's happening.

Is there a way to build without declarative - I'm not using it right now,
anyway.

Please advise.

rickb

________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, February 28, 2011 4:35:00 PM
Subject: RE: [Qt-3d] Offscreen rendering question...

You may have more luck with a QGLFramebufferObject. QGLPixelBuffer creates a
separate QGLContext with its own state that isn't shared with the widget's
QGLContext. You can make it share at construction time, but the QGLPainter is
bound to a specific QGLContext. QGLFramebufferObject works within the original
widget context so the QGLPainter won't get confused.

I myself forgot about the context switching issue - that may make it impossible
to implement QGLPixelBufferSurface properly, so I better remove it or find some
way for the QGLPainter to switch to another context as part of the surface
switch.

Cheers,

Rhys.
________________________________________
From: qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[qt-3d-bounces+rhys.weatherley=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext rickbsgu
[rbmailer-qt3d-/***@public.gmane.org]
Sent: Tuesday, March 01, 2011 12:40 AM
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] Offscreen rendering question...

Hi, all -

Need to save a scene to an image file. I'm presuming a couple of things:

* The way to do this is with a QGLPixelBufferSurface
* QGLView sets up a QGLWidgetSurface somewhere, and that surface can be
switched.
* within the paintGL func, I can push a QGLPixelBufferSurface onto the
QGLPainter, draw to that, and then pop it off to resume normal widget rendering.

So, here's what I've done (in my QGLView-derived class):

1. create a member QGLPixelBufferSurface and set a QGLPixelBuffer in that (on
request to save.)
2. set a flag so that the next render will know we're to render to a pixel
buffer
3. call 'update()' to force a re-render.
4. In the 'paint' function, I call 'pushSurface' on the QGLPainter to push the
QGLPixelBufferSurface onto the painter, draw, and then pop the
QGLPixelBufferSurface back off.
5. after rendering, a signal is called to notify the caller that the rendering
is done - that slot extracts the image from the member QGLPixelBufferSurface,
saves it, and cleans up.

It crashes with a 'bad memory access' when the QGLPainter is trying to draw the
glElements in qglindexbuffer (trying to draw the QGLSceneNode).

I suspect that some aspect of my initial presumptions are incorrect.

Here are the code snippets.

Any thoughts appreciated.

(slot that receives 'save' request)
-----------------------------------------

void ModelView::saveToImage()

{

savePath = QFileDialog::getSaveFileName(parentWidget(), "Save Image as...",
".", "PNG (*.png)");

if (!savePath.isEmpty())

{

drawToBuffer = true;

bSurface = new QGLPixelBufferSurface();

bSurface->setPixelBuffer(new QGLPixelBuffer(QSize(250, 250)));

connect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()),
Qt::QueuedConnection);

this->update();

}

}

(slot called after the draw is done)
------------------------------------
void ModelView::onDrawToPBufDone()

{

drawToBuffer = false;

disconnect(this, SIGNAL(drawToPBufDone()), this, SLOT(onDrawToPBufDone()));

QImage img = bSurface->pixelBuffer()->toImage();

delete bSurface;

img.save(savePath, "PNG");


QMessageBox::information(parentWidget(), "Information", "Image saved...");



}


(paint routine)
----------------
<...>
if (drawToBuffer)

painter->pushSurface(bSurface);

<... draw stuff ...>


if (drawToBuffer)

{

painter->popSurface();

emit drawToPBufDone();

}


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>
s***@public.gmane.org
2011-03-14 09:59:13 UTC
Permalink
Hi Rick,

This is an ongoing source of pain for us - we depend on some private headers in declarative and now of course they have changed those API's half-way through minor dot-point, and there is no way to reliably test for the change. My apologies.

If you want to get it to build you can manually change those #ifdef's inside qdeclarativeeffect.cpp to use the other compilation branch.

Look for the two lines like #if QT_VERSION >= 0x040703 - and change to #if 0 or #if 1 - to suit whatever actual Qt version you have. Given that its complaining "Options is not a member" the attached patch should do this.

Horrible - yes I know.

Or you should be able to rebuild Qt with declarative turned off, and then qt3d will detect that and compile with declarative turned off as well. To be honest that is not a compile setup that we test with much these days - because there is not way to simply turn it off and on without recompiling Qt. So tho' it should work in theory, I don't know that it works in fact.

Regards,

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>
rickbsgu
2011-03-14 20:13:48 UTC
Permalink
Forgot to attach...


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
r***@public.gmane.org
2011-03-14 10:39:12 UTC
Permalink
>Is this no longer in sync w/ qt 4.7-stable? I pulled the latest updates on qt 4.7-stable, and the latest updates from qt3d master-stable.
>
>I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a member of QDeclarativePixmap' and 'Asynchronous is not a member of QDeclarativePixmap'.
>
>I used to get this if I didn't checkout 'master-stable' - now it's happening.

*sigh* There was a change made to the qt/4.7 branch a while ago that introduced Options. But that change didn't make it into 4.7.2 (or 4.7-stable yet apparently), so I changed the #ifdef to check for 4.7.3. But our automated build farm only updates the qt build used for qt3d every week or so. This is causing a build failure that is stopping qt3d's master being integrated into master-stable. Hopefully this problem will clear in a few days. The following bug reports are related to this see-saw problem with QDeclarativePixmap:

http://bugreports.qt.nokia.com/browse/QTBUG-17239
http://bugreports.qt.nokia.com/browse/QTBUG-17872

>Is there a way to build without declarative - I'm not using it right now, anyway.

You'll probably need to hack the .pro files in Qt/3D to remove the relevant subdirectories. Or switch to Qt 4.8 (aka qt/master) which shouldn't exhibit the see-saw effect that the different 4.7 branches have.

Cheers,

Rhys.
rickbsgu
2011-03-14 15:44:42 UTC
Permalink
So, this probably has to do with some lack of understanding on my part, but....

I'm instantiating a viewer and building up a scene. In that scene I'm reading
in a model and applying a texture to a mesh in the model
(using QGLTexture2D and setting that in a QGLMaterial.) The texture is loaded
from a resource file - I'm using setImage to set the texture image. The image
is valid, so I know I'm getting that.

When I try to bind the texture, it complains with 'texture upload failed, error
code 0x501, enum: 3553 (de1)'

This works swimmingly well on Mac (intel), but not at all on win (or mac ppc, I
might add....) I'm enabling GL_TEXTURE_2D in an init call after creating the
view (I would think QGLTexture2D would do that, or insure it's called,
somewhere, already.) Is there something else I need to init/set on win to get
the texture to happen?

Poring over the documentation as I send.... I know enough OpenGL to be
dangerous...

thanks,
rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, March 14, 2011 6:39:12 AM
Subject: RE: [Qt-3d] master-stable not building with qt 4.7-stable

>Is this no longer in sync w/ qt 4.7-stable? I pulled the latest updates on qt
>4.7-stable, and the latest updates from qt3d master-stable.
>
>I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a member of
>QDeclarativePixmap' and 'Asynchronous is not a member of QDeclarativePixmap'.
>
>I used to get this if I didn't checkout 'master-stable' - now it's happening.

*sigh* There was a change made to the qt/4.7 branch a while ago that introduced
Options. But that change didn't make it into 4.7.2 (or 4.7-stable yet
apparently), so I changed the #ifdef to check for 4.7.3. But our automated
build farm only updates the qt build used for qt3d every week or so. This is
causing a build failure that is stopping qt3d's master being integrated into
master-stable. Hopefully this problem will clear in a few days. The following
bug reports are related to this see-saw problem with QDeclarativePixmap:

http://bugreports.qt.nokia.com/browse/QTBUG-17239
http://bugreports.qt.nokia.com/browse/QTBUG-17872

>Is there a way to build without declarative - I'm not using it right now,
>anyway.

You'll probably need to hack the .pro files in Qt/3D to remove the relevant
subdirectories. Or switch to Qt 4.8 (aka qt/master) which shouldn't exhibit the
see-saw effect that the different 4.7 branches have.

Cheers,

Rhys.
Robinson, David
2011-03-15 10:22:31 UTC
Permalink
Hi rickb,

I also get this same error in bindTexture() when using the Windows
Virtual Machine in XP mode. For me it was related to the OpenGL v1.1
only support available in XP mode due to the hardware virtualisation and
lack of support for graphics. I solved my problems by changing to
VirtualBox.



All the same I thought textures should work and they do until in my
QML/3D app I change scene, then I lose all image format support
altogether including UI controls and content. So there is a nasty bug
there but I worked around it.



Can you try running the Qt OpenGL example Textures and when you do are
the dice numbers visible?

What OpenGL version are you running on XP and Mac?



Regards

David Robinson



From: qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[mailto:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf
Of rickbsgu
Sent: 14 March 2011 15:45
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] QGLTexture2D upload failing on win...



So, this probably has to do with some lack of understanding on my part,
but....

I'm instantiating a viewer and building up a scene. In that scene I'm
reading in a model and applying a texture to a mesh in the model
(using QGLTexture2D and setting that in a QGLMaterial.) The texture is
loaded from a resource file - I'm using setImage to set the texture
image. The image is valid, so I know I'm getting that.

When I try to bind the texture, it complains with 'texture upload
failed, error code 0x501, enum: 3553 (de1)'

This works swimmingly well on Mac (intel), but not at all on win (or mac
ppc, I might add....) I'm enabling GL_TEXTURE_2D in an init call after
creating the view (I would think QGLTexture2D would do that, or insure
it's called, somewhere, already.) Is there something else I need to
init/set on win to get the texture to happen?

Poring over the documentation as I send.... I know enough OpenGL to be
dangerous...

thanks,
rickb



________________________________

A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________

From: "rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, March 14, 2011 6:39:12 AM
Subject: RE: [Qt-3d] master-stable not building with qt 4.7-stable

>Is this no longer in sync w/ qt 4.7-stable? I pulled the latest
updates on qt 4.7-stable, and the latest updates from qt3d
master-stable.
>
>I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a
member of QDeclarativePixmap' and 'Asynchronous is not a member of
QDeclarativePixmap'.
>
>I used to get this if I didn't checkout 'master-stable' - now it's
happening.

*sigh* There was a change made to the qt/4.7 branch a while ago that
introduced Options. But that change didn't make it into 4.7.2 (or
4.7-stable yet apparently), so I changed the #ifdef to check for 4.7.3.
But our automated build farm only updates the qt build used for qt3d
every week or so. This is causing a build failure that is stopping
qt3d's master being integrated into master-stable. Hopefully this
problem will clear in a few days. The following bug reports are related
to this see-saw problem with QDeclarativePixmap:

http://bugreports.qt.nokia.com/browse/QTBUG-17239
http://bugreports.qt.nokia.com/browse/QTBUG-17872

>Is there a way to build without declarative - I'm not using it right
now, anyway.

You'll probably need to hack the .pro files in Qt/3D to remove the
relevant subdirectories. Or switch to Qt 4.8 (aka qt/master) which
shouldn't exhibit the see-saw effect that the different 4.7 branches
have.

Cheers,

Rhys.



Scanned for viruses by Mimecast <http://www.mimecast.co.uk/> .


Please refer to www.anite.com for individual Anite company details. The contents of this e-mail and any attachments are for the intended recipient only. If you are not the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege. Contracts cannot be concluded with us nor legal service effected by email.

Anite plc
Registered in England No.1798114
Registered Office: 353 Buckingham Avenue Slough Berks SL1 4PF United Kingdom VAT Registration No. GB 787 418187

Scanned for viruses by Mimecast.
rickbsgu
2011-03-15 11:15:46 UTC
Permalink
Hi, David -

Ooo - good call.

I was actually wondering if the VM might have had something to do with it, and I
forgot to relate it in the original post.

My bad.

Dang. I did the pageflip example (which uses textures) on the VM and it seemed
to work fine, which was my basis for presuming a) texutres would work fine in
this environment and b) something was not right with my code.

Still doesn't answer why it's not working on PPC mac, though. Or is that a 1.1
issue, too? Textures aren't that exotic and have been around a long while. I'm
surprised I'm getting issues, but if Qt3D is using 2.0 and these boxes only
support 1.1, that's an issue. Maybe I can get around it by coding raw GL using
1.1 constructs? Ptui.

thanks much.


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "Robinson, David" <David.Robinson-***@public.gmane.org>
To: rickbsgu <rbmailer-qt3d-/***@public.gmane.org>; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Tue, March 15, 2011 6:22:31 AM
Subject: RE: [Qt-3d] QGLTexture2D upload failing on win...


Hi rickb,
I also get this same error in bindTexture() when using the Windows Virtual
Machine in XP mode. For me it was related to the OpenGL v1.1 only support
available in XP mode due to the hardware virtualisation and lack of support for
graphics. I solved my problems by changing to VirtualBox.

All the same I thought textures should work and they do until in my QML/3D app I
change scene, then I lose all image format support altogether including UI
controls and content. So there is a nasty bug there but I worked around it.

Can you try running the Qt OpenGL example Textures and when you do are the dice
numbers visible?
What OpenGL version are you running on XP and Mac?

Regards
David Robinson

From:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[mailto:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of
rickbsgu
Sent: 14 March 2011 15:45
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] QGLTexture2D upload failing on win...

So, this probably has to do with some lack of understanding on my part, but....

I'm instantiating a viewer and building up a scene. In that scene I'm reading
in a model and applying a texture to a mesh in the model
(using QGLTexture2D and setting that in a QGLMaterial.) The texture is loaded
from a resource file - I'm using setImage to set the texture image. The image
is valid, so I know I'm getting that.

When I try to bind the texture, it complains with 'texture upload failed, error
code 0x501, enum: 3553 (de1)'

This works swimmingly well on Mac (intel), but not at all on win (or mac ppc, I
might add....) I'm enabling GL_TEXTURE_2D in an init call after creating the
view (I would think QGLTexture2D would do that, or insure it's called,
somewhere, already.) Is there something else I need to init/set on win to get
the texture to happen?

Poring over the documentation as I send.... I know enough OpenGL to be
dangerous...

thanks,
rickb


________________________________

A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch



________________________________

From:"rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, March 14, 2011 6:39:12 AM
Subject: RE: [Qt-3d] master-stable not building with qt 4.7-stable

>Is this no longer in sync w/ qt 4.7-stable? I pulled the latest updates on qt
>4.7-stable, and the latest updates from qt3d master-stable.
>
>I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a member of
>QDeclarativePixmap' and 'Asynchronous is not a member of QDeclarativePixmap'.
>
>I used to get this if I didn't checkout 'master-stable' - now it's happening.

*sigh* There was a change made to the qt/4.7 branch a while ago that introduced
Options. But that change didn't make it into 4.7.2 (or 4.7-stable yet
apparently), so I changed the #ifdef to check for 4.7.3. But our automated
build farm only updates the qt build used for qt3d every week or so. This is
causing a build failure that is stopping qt3d's master being integrated into
master-stable. Hopefully this problem will clear in a few days. The following
bug reports are related to this see-saw problem with QDeclarativePixmap:

http://bugreports.qt.nokia.com/browse/QTBUG-17239
http://bugreports.qt.nokia.com/browse/QTBUG-17872

>Is there a way to build without declarative - I'm not using it right now,
>anyway.

You'll probably need to hack the .pro files in Qt/3D to remove the relevant
subdirectories. Or switch to Qt 4.8 (aka qt/master) which shouldn't exhibit the
see-saw effect that the different 4.7 branches have.

Cheers,

Rhys.


Scanned for viruses by Mimecast.

Please refer to www.anite.com for individual Anite company details. The contents
of this e-mail and any attachments are for the intended recipient only. If you
are not the intended recipient, you are not authorised to and must not disclose,
copy, distribute, or retain this message or any part of it. It may contain
information which is confidential and/or covered by legal professional or other
privilege. Contracts cannot be concluded with us nor legal service effected by
email.

Anite plc
Registered in England No.1798114
Registered Office: 353 Buckingham Avenue Slough Berks SL1 4PF United Kingdom
VAT Registration No. GB 787 418187
Scanned for viruses by Mimecast.
rickbsgu
2011-03-16 00:52:43 UTC
Permalink
Hi, Daniel -

We've noted that my test environment is a VM (VMWare Fusion 3.1.2 on an Intel
Mac 10.6.6.)

You indicated the VM supports OpenGL1.1. So, I guess the question is, is Qt3D
dependent on OpenGL2.0 or greater? At least the texture binding mechanism?

I've gone through the pageflip demo (which works), but that's doing some pretty
intricate glEnables and detection under the covers, that I'm not real savvy on.

Given that Qt still works on older platforms, I would expect that Qt3D would
fall back on OpenGL1.1 support, if the card doesn't support later versions.

thanks,
rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "***@nokia.com" <daniel.pope-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org
Sent: Tue, March 15, 2011 7:51:50 PM
Subject: RE: [Qt-3d] QGLTexture2D upload failing on win...


Seems to be working on WinXP for me
 but that’s one a purely Windows machine,
so


Note sure why it isn’t working for you. Will look into it a little more.

- o O o -
Did you know that more than 150 Ents are killed in the paper making process each
year.
Who will help us defeat evil wizards when the last Ent is gone?
Help save the Ents - please think before you print.

From:qt-3d-bounces+daniel.pope=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[mailto:qt-3d-bounces+daniel.pope=nokia.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of ext
rickbsgu
Sent: Tuesday, March 15, 2011 9:16 PM
To: Robinson, David; qt-3d-***@public.gmane.orgkia.com
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

Hi, David -

Ooo - good call.

I was actually wondering if the VM might have had something to do with it, and I
forgot to relate it in the original post.

My bad.

Dang. I did the pageflip example (which uses textures) on the VM and it seemed
to work fine, which was my basis for presuming a) texutres would work fine in
this environment and b) something was not right with my code.

Still doesn't answer why it's not working on PPC mac, though. Or is that a 1.1
issue, too? Textures aren't that exotic and have been around a long while. I'm
surprised I'm getting issues, but if Qt3D is using 2.0 and these boxes only
support 1.1, that's an issue. Maybe I can get around it by coding raw GL using
1.1 constructs? Ptui.

thanks much.


________________________________

A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch



________________________________

From:"Robinson, David" <David.Robinson-***@public.gmane.org>
To: rickbsgu <rbmailer-***@yahoo.com>; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Tue, March 15, 2011 6:22:31 AM
Subject: RE: [Qt-3d] QGLTexture2D upload failing on win...
Hi rickb,
I also get this same error in bindTexture() when using the Windows Virtual
Machine in XP mode. For me it was related to the OpenGL v1.1 only support
available in XP mode due to the hardware virtualisation and lack of support for
graphics. I solved my problems by changing to VirtualBox.

All the same I thought textures should work and they do until in my QML/3D app I
change scene, then I lose all image format support altogether including UI
controls and content. So there is a nasty bug there but I worked around it.

Can you try running the Qt OpenGL example Textures and when you do are the dice
numbers visible?
What OpenGL version are you running on XP and Mac?

Regards
David Robinson

From:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[mailto:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf Of
rickbsgu
Sent: 14 March 2011 15:45
To: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: [Qt-3d] QGLTexture2D upload failing on win...

So, this probably has to do with some lack of understanding on my part, but....

I'm instantiating a viewer and building up a scene. In that scene I'm reading
in a model and applying a texture to a mesh in the model
(using QGLTexture2D and setting that in a QGLMaterial.) The texture is loaded
from a resource file - I'm using setImage to set the texture image. The image
is valid, so I know I'm getting that.

When I try to bind the texture, it complains with 'texture upload failed, error
code 0x501, enum: 3553 (de1)'

This works swimmingly well on Mac (intel), but not at all on win (or mac ppc, I
might add....) I'm enabling GL_TEXTURE_2D in an init call after creating the
view (I would think QGLTexture2D would do that, or insure it's called,
somewhere, already.) Is there something else I need to init/set on win to get
the texture to happen?

Poring over the documentation as I send.... I know enough OpenGL to be
dangerous...

thanks,
rickb


________________________________

A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch



________________________________

From:"rhys.weatherley-***@public.gmane.org" <rhys.weatherley-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Mon, March 14, 2011 6:39:12 AM
Subject: RE: [Qt-3d] master-stable not building with qt 4.7-stable

>Is this no longer in sync w/ qt 4.7-stable? I pulled the latest updates on qt
>4.7-stable, and the latest updates from qt3d master-stable.
>
>I'm getting errors in qtdeclarativeeffect.cpp - 'Options is not a member of
>QDeclarativePixmap' and 'Asynchronous is not a member of QDeclarativePixmap'.
>
>I used to get this if I didn't checkout 'master-stable' - now it's happening.

*sigh* There was a change made to the qt/4.7 branch a while ago that introduced
Options. But that change didn't make it into 4.7.2 (or 4.7-stable yet
apparently), so I changed the #ifdef to check for 4.7.3. But our automated
build farm only updates the qt build used for qt3d every week or so. This is
causing a build failure that is stopping qt3d's master being integrated into
master-stable. Hopefully this problem will clear in a few days. The following
bug reports are related to this see-saw problem with QDeclarativePixmap:

http://bugreports.qt.nokia.com/browse/QTBUG-17239
http://bugreports.qt.nokia.com/browse/QTBUG-17872

>Is there a way to build without declarative - I'm not using it right now,
>anyway.

You'll probably need to hack the .pro files in Qt/3D to remove the relevant
subdirectories. Or switch to Qt 4.8 (aka qt/master) which shouldn't exhibit the
see-saw effect that the different 4.7 branches have.

Cheers,

Rhys.


Scanned for viruses by Mimecast.

Please refer to www.anite.com for individual Anite company details. The contents
of this e-mail and any attachments are for the intended recipient only. If you
are not the intended recipient, you are not authorised to and must not disclose,
copy, distribute, or retain this message or any part of it. It may contain
information which is confidential and/or covered by legal professional or other
privilege. Contracts cannot be concluded with us nor legal service effected by
email.

Anite plc
Registered in England No.1798114
Registered Office: 353 Buckingham Avenue Slough Berks SL1 4PF United Kingdom
VAT Registration No. GB 787 418187
Scanned for viruses by Mimecast.
s***@public.gmane.org
2011-03-16 07:44:34 UTC
Permalink
Hi Rick,

Gah - just saw that one email went direct to me and now somehow the list has caught up - rendering some of my recent post out of date. Danny - if you've already tried it disregard. :-)

Regarding OpenGL 1.1, we aren't explicitly dependent on OpenGL 2, and in fact we do have compilation paths to explicitly support it. That goes back to the inception of the Qt3D project when support across the various OpenGL versions was a big part of the Qt3D portability story.

But to be honest our core development happens on MacOSX 10.6, Ubuntu 10.x and Windows XP - all of which support OpenGL 2. OpenGL 1.x is not a platform that gets tested very often. Mobile development is also on OpenGL ES 2 platforms. PPC mac - hmm, I think we have one around the place somewhere...

I think outside of those core platforms its a case of "your mileage may vary" and while we'd definitely accept a bug report for those platforms, it would be lower priority.

Like you I build on Intel Mac and then use VM's to check Linux and Win, but I know from experience that shaders do not work on VMWare Fusion on Linux, with an Ubuntu 10.x guest system; and it does not surprise me that shaders are flaky on Win guests.

One thing you could try is what I do on Linux guest on VMWare which is to force it to fixed function by changing the source code as per the attached patch. This is only relevant or worthwhile if for some reason QT_OPENGL_ES_1 is not getting properly detected by Qt.

I did upgrade to the latest VMWare fusion because of the promise of OpenGL support for Windows, so its a bit disappointing. However - this thread offers a workaround - http://communities.vmware.com/message/1405895 - enabling a different driver, to get OpenGL 2 support.

Might be worth a try.

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>
Robinson, David
2011-03-16 10:38:17 UTC
Permalink
The point I was trying to make was that the problem which was:

'When I try to bind the texture, it complains with 'texture upload
failed, error code 0x501, enum: 3553 (de1)'

comes from the Qt code in bindTexture() not the Qt3D project.



The Qt OpenGL example Textures can be used to reproduce this issue with
OpenGL v1,1.



About VM's I would have thought the Qt team would favour VirtualBox over
fusion, after all it is a Qt based project! J



Regards

David Robinson



From: qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
[mailto:qt-3d-bounces+david.robinson=anite.com-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org] On Behalf
Of sarah.j.smith-***@public.gmane.org
Sent: 16 March 2011 07:45
To: rbmailer-qt3d-/***@public.gmane.org
Cc: qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...



Hi Rick,



Gah - just saw that one email went direct to me and now somehow the list
has caught up - rendering some of my recent post out of date. Danny -
if you've already tried it disregard. :-)



Regarding OpenGL 1.1, we aren't explicitly dependent on OpenGL 2, and in
fact we do have compilation paths to explicitly support it. That goes
back to the inception of the Qt3D project when support across the
various OpenGL versions was a big part of the Qt3D portability story.



But to be honest our core development happens on MacOSX 10.6, Ubuntu
10.x and Windows XP - all of which support OpenGL 2. OpenGL 1.x is not
a platform that gets tested very often. Mobile development is also on
OpenGL ES 2 platforms. PPC mac - hmm, I think we have one around the
place somewhere...



I think outside of those core platforms its a case of "your mileage may
vary" and while we'd definitely accept a bug report for those platforms,
it would be lower priority.



Like you I build on Intel Mac and then use VM's to check Linux and Win,
but I know from experience that shaders do not work on VMWare Fusion on
Linux, with an Ubuntu 10.x guest system; and it does not surprise me
that shaders are flaky on Win guests.



One thing you could try is what I do on Linux guest on VMWare which is
to force it to fixed function by changing the source code as per the
attached patch. This is only relevant or worthwhile if for some reason
QT_OPENGL_ES_1 is not getting properly detected by Qt.



I did upgrade to the latest VMWare fusion because of the promise of
OpenGL support for Windows, so its a bit disappointing. However - this
thread offers a workaround -
http://communities.vmware.com/message/1405895 - enabling a different
driver, to get OpenGL 2 support.



Might be worth a try.



Sarah Smith

Senior Engineer Team Lead Qt3D

Nokia Qt Development Frameworks

Mobile: +61 448 283 476

sarah.j.smith-***@public.gmane.org





Scanned for viruses by Mimecast <http://www.mimecast.co.uk/> .


Please refer to www.anite.com for individual Anite company details. The contents of this e-mail and any attachments are for the intended recipient only. If you are not the intended recipient, you are not authorised to and must not disclose, copy, distribute, or retain this message or any part of it. It may contain information which is confidential and/or covered by legal professional or other privilege. Contracts cannot be concluded with us nor legal service effected by email.

Anite plc
Registered in England No.1798114
Registered Office: 353 Buckingham Avenue Slough Berks SL1 4PF United Kingdom VAT Registration No. GB 787 418187

Scanned for viruses by Mimecast.
rickbsgu
2011-03-16 17:25:12 UTC
Permalink
The point I was trying to make was that the problem which was:
‘When I try to bind the texture, it complains with 'texture upload failed, error
code 0x501, enum: 3553 (de1)'
comes from the Qt code in bindTexture() not the Qt3D project.


The Qt OpenGL example Textures can be used to reproduce this issue with OpenGL
v1,1.

I see - so this is essentially an OpenGL1.1 support issue in Qt proper, then?


About VM’s I would have thought the Qt team would favour VirtualBox over fusion,
after all it is a Qt based project! J

Interesting to know - I'll tuck that away, somewhere for future reference.
Last I checked there was an issue moving VirtualBox Windows VMs from machine to
machine, which I do a lot.

Thanks,
rickb


Regards
David Robinson
rickbsgu
2011-03-16 18:29:36 UTC
Permalink
Hi - thanks all for the attention on this.

I'll be sending a more comprehensive test on what I'm trying to do - which
includes some off-screen rendering - when I can get it together.

I have created a 2d fall-back implementation in the event the HW doesn't support
OGL or offscreen rendering in some useful flavor. That's what's in-place now,
until I can get the Qt3D/QGL issues cleaned up.

As far as the older OpenGL versions - this product is targeted to schools,
which are notorious for not having the latest and greatest HW. In fact, I
kinda choked on having to support PPC macs, but it's required (we got a PPC
machine cheap on e-Bay.) The client uses VMs extensively for testing, so I
need to either support it or at least fall-back gracefully if it's not
possible. ES is not on the horizon at this time, although it could be if we
decide to go to a portable device.

The general scenario goes like this:

1. Create a cover w/ html using QWebPage.
2. The webpage is rendered offscreen to an image.
3. The image is applied as a texture to a mesh on the model.

4. The user types information interactively - each keystroke regens the page
(scene) and reapplies the cover.
5. When the user is done, an action triggers offscreen rendering of the 3d
image to an icon.I got this to mostly work on Mac, but with issues. The
second light doesn't work, multi-sampling/antialiasing didn't seem to work at
all on win (it did draw the geometry), and in the offscreen rendering, the
texture doesn't seem to map across the full geometry of the mesh, so I get a
big, black border around the texture. Kinda ugly.

Anyway, one issue at a time. I'd like to figure out how to get this simple test
working on all platforms before going further.

Sarah: I'll check out the thread.

Thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "sarah.j.smith-***@public.gmane.org" <sarah.j.smith-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org
Cc: daniel.pope-***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Wed, March 16, 2011 3:44:34 AM
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

Hi Rick,

Gah - just saw that one email went direct to me and now somehow the list has
caught up - rendering some of my recent post out of date. Danny - if you've
already tried it disregard. :-)

Regarding OpenGL 1.1, we aren't explicitly dependent on OpenGL 2, and in fact we
do have compilation paths to explicitly support it. That goes back to the
inception of the Qt3D project when support across the various OpenGL versions
was a big part of the Qt3D portability story.

But to be honest our core development happens on MacOSX 10.6, Ubuntu 10.x and
Windows XP - all of which support OpenGL 2. OpenGL 1.x is not a platform that
gets tested very often. Mobile development is also on OpenGL ES 2 platforms.
PPC mac - hmm, I think we have one around the place somewhere...

I think outside of those core platforms its a case of "your mileage may vary"
and while we'd definitely accept a bug report for those platforms, it would be
lower priority.

Like you I build on Intel Mac and then use VM's to check Linux and Win, but I
know from experience that shaders do not work on VMWare Fusion on Linux, with an
Ubuntu 10.x guest system; and it does not surprise me that shaders are flaky on
Win guests.

One thing you could try is what I do on Linux guest on VMWare which is to force
it to fixed function by changing the source code as per the attached patch. This
is only relevant or worthwhile if for some reason QT_OPENGL_ES_1 is not getting
properly detected by Qt.

I did upgrade to the latest VMWare fusion because of the promise of OpenGL
support for Windows, so its a bit disappointing. However - this thread offers a
workaround - http://communities.vmware.com/message/1405895 - enabling a
different driver, to get OpenGL 2 support.

Might be worth a try.


Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org
rickbsgu
2011-03-18 23:13:59 UTC
Permalink
Ok, I think we've determined that the VM OpenGL 1.1 is a problem.

Still two issues:

1) Second light doesn't show (not on Mac, anyway)

2) PPC Mac still isn't working.

Any illumination on these?

thanks,
rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: rickbsgu <rbmailer-qt3d-/***@public.gmane.org>
To: sarah.j.smith-***@public.gmane.org; daniel.pope-***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Wed, March 16, 2011 2:29:36 PM
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...


Hi - thanks all for the attention on this.

I'll be sending a more comprehensive test on what I'm trying to do - which
includes some off-screen rendering - when I can get it together.

I have created a 2d fall-back implementation in the event the HW doesn't support
OGL or offscreen rendering in some useful flavor. That's what's in-place now,
until I can get the Qt3D/QGL issues cleaned up.

As far as the older OpenGL versions - this product is targeted to schools,
which are notorious for not having the latest and greatest HW. In fact, I
kinda choked on having to support PPC macs, but it's required (we got a PPC
machine cheap on e-Bay.) The client uses VMs extensively for testing, so I
need to either support it or at least fall-back gracefully if it's not
possible. ES is not on the horizon at this time, although it could be if we
decide to go to a portable device.

The general scenario goes like this:

1. Create a cover w/ html using QWebPage.
2. The webpage is rendered offscreen to an image.
3. The image is applied as a texture to a mesh on the model.

4. The user types information interactively - each keystroke regens the page
(scene) and reapplies the cover.
5. When the user is done, an action triggers offscreen rendering of the 3d
image to an icon.I got this to mostly work on Mac, but with issues. The
second light doesn't work, multi-sampling/antialiasing didn't seem to work at
all on win (it did draw the geometry), and in the offscreen rendering, the
texture doesn't seem to map across the full geometry of the mesh, so I get a
big, black border around the texture. Kinda ugly.

Anyway, one issue at a time. I'd like to figure out how to get this simple test
working on all platforms before going further.

Sarah: I'll check out the thread.

Thanks,
rickb



________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch





________________________________
From: "sarah.j.smith-***@public.gmane.org" <sarah.j.smith-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org
Cc: daniel.pope-***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Wed, March 16, 2011 3:44:34 AM
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

Hi Rick,

Gah - just saw that one email went direct to me and now somehow the list has
caught up - rendering some of my recent post out of date. Danny - if you've
already tried it disregard. :-)

Regarding OpenGL 1.1, we aren't explicitly dependent on OpenGL 2, and in fact we
do have compilation paths to explicitly support it. That goes back to the
inception of the Qt3D project when support across the various OpenGL versions
was a big part of the Qt3D portability story.

But to be honest our core development happens on MacOSX 10.6, Ubuntu 10.x and
Windows XP - all of which support OpenGL 2. OpenGL 1.x is not a platform that
gets tested very often. Mobile development is also on OpenGL ES 2 platforms.
PPC mac - hmm, I think we have one around the place somewhere...

I think outside of those core platforms its a case of "your mileage may vary"
and while we'd definitely accept a bug report for those platforms, it would be
lower priority.

Like you I build on Intel Mac and then use VM's to check Linux and Win, but I
know from experience that shaders do not work on VMWare Fusion on Linux, with an
Ubuntu 10.x guest system; and it does not surprise me that shaders are flaky on
Win guests.

One thing you could try is what I do on Linux guest on VMWare which is to force
it to fixed function by changing the source code as per the attached patch. This
is only relevant or worthwhile if for some reason QT_OPENGL_ES_1 is not getting
properly detected by Qt.

I did upgrade to the latest VMWare fusion because of the promise of OpenGL
support for Windows, so its a bit disappointing. However - this thread offers a
workaround - http://communities.vmware.com/message/1405895 - enabling a
different driver, to get OpenGL 2 support.

Might be worth a try.


Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org
s***@public.gmane.org
2011-03-18 23:28:29 UTC
Permalink
Hi Rick,
________________________________________
From: ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org]
Sent: Saturday, March 19, 2011 9:13 AM
To: rickbsgu; Smith Sarah.J (Nokia-MS-Qt/Brisbane); Pope Daniel (Nokia-MS/Brisbane); qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

>> Ok, I think we've determined that the VM OpenGL 1.1 is a problem.

Did the driver change trick not work at all?

Can we please capture into a bug report what exactly the problem is? I know its discussed below. Depending on workload its still much more likely to get fixed that way. Who knows others might be keen on it and vote it up too - then we're really going to be shamed into prioritising it. :-) http://bugreports.qt.nokia.com -- component Qt3D

What I'm interested to discover is why its not using the fixed function pipeline...

>> Still two issues:

>> 1) Second light doesn't show (not on Mac, anyway)

I know in the past we have had issues with lights - the limitation was in the shaders. But I believe this was fixed, so this sounds like a bug also. If you could post a bit of demo code on a bug report we'll prioritise fixing that - I was actually discussing multiple lights with Julian just a day or two ago, and its something that is quite important that it works.

>> 2) PPC Mac still isn't working.

I don't see that this should be hard to get working. We definitely have a PPC machine around here - I will get access to it and take a look. Endian issues might be the problem. Again - bug report please, with the compile break or stack trace or whatever and I'll take a look next week.

>> Any illumination on these?
>>
>> thanks,
>> rickb

________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: rickbsgu <rbmailer-qt3d-/***@public.gmane.org>
To: sarah.j.smith-***@public.gmane.org; daniel.pope-***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Wed, March 16, 2011 2:29:36 PM
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

Hi - thanks all for the attention on this.

I'll be sending a more comprehensive test on what I'm trying to do - which includes some off-screen rendering - when I can get it together.

I have created a 2d fall-back implementation in the event the HW doesn't support OGL or offscreen rendering in some useful flavor. That's what's in-place now, until I can get the Qt3D/QGL issues cleaned up.

As far as the older OpenGL versions - this product is targeted to schools, which are notorious for not having the latest and greatest HW. In fact, I kinda choked on having to support PPC macs, but it's required (we got a PPC machine cheap on e-Bay.) The client uses VMs extensively for testing, so I need to either support it or at least fall-back gracefully if it's not possible. ES is not on the horizon at this time, although it could be if we decide to go to a portable device.

The general scenario goes like this:

1. Create a cover w/ html using QWebPage.
2. The webpage is rendered offscreen to an image.
3. The image is applied as a texture to a mesh on the model.
4. The user types information interactively - each keystroke regens the page (scene) and reapplies the cover.
5. When the user is done, an action triggers offscreen rendering of the 3d image to an icon.

I got this to mostly work on Mac, but with issues. The second light doesn't work, multi-sampling/antialiasing didn't seem to work at all on win (it did draw the geometry), and in the offscreen rendering, the texture doesn't seem to map across the full geometry of the mesh, so I get a big, black border around the texture. Kinda ugly.

Anyway, one issue at a time. I'd like to figure out how to get this simple test working on all platforms before going further.

Sarah: I'll check out the thread.

Thanks,
rickb


________________________________
A mind is not a vessel to be filled,
it is a fire to be ignited.
-- Plutarch
<http://map.datastormusers.com/user1.cfm?user=1018>


________________________________
From: "sarah.j.smith-***@public.gmane.org" <sarah.j.smith-***@public.gmane.org>
To: rbmailer-qt3d-/***@public.gmane.org
Cc: daniel.pope-***@public.gmane.org; qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Sent: Wed, March 16, 2011 3:44:34 AM
Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...

Hi Rick,

Gah - just saw that one email went direct to me and now somehow the list has caught up - rendering some of my recent post out of date. Danny - if you've already tried it disregard. :-)

Regarding OpenGL 1.1, we aren't explicitly dependent on OpenGL 2, and in fact we do have compilation paths to explicitly support it. That goes back to the inception of the Qt3D project when support across the various OpenGL versions was a big part of the Qt3D portability story.

But to be honest our core development happens on MacOSX 10.6, Ubuntu 10.x and Windows XP - all of which support OpenGL 2. OpenGL 1.x is not a platform that gets tested very often. Mobile development is also on OpenGL ES 2 platforms. PPC mac - hmm, I think we have one around the place somewhere...

I think outside of those core platforms its a case of "your mileage may vary" and while we'd definitely accept a bug report for those platforms, it would be lower priority.

Like you I build on Intel Mac and then use VM's to check Linux and Win, but I know from experience that shaders do not work on VMWare Fusion on Linux, with an Ubuntu 10.x guest system; and it does not surprise me that shaders are flaky on Win guests.

One thing you could try is what I do on Linux guest on VMWare which is to force it to fixed function by changing the source code as per the attached patch. This is only relevant or worthwhile if for some reason QT_OPENGL_ES_1 is not getting properly detected by Qt.

I did upgrade to the latest VMWare fusion because of the promise of OpenGL support for Windows, so its a bit disappointing. However - this thread offers a workaround - http://communities.vmware.com/message/1405895 - enabling a different driver, to get OpenGL 2 support.

Might be worth a try.

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org<mailto:sarah.j.smith-***@public.gmane.org>
s***@public.gmane.org
2011-03-21 07:17:22 UTC
Permalink
Hi,

See below.



On 19/03/2011, at 9:28 AM, ext sarah.j.smith-***@public.gmane.org wrote:

> Hi Rick,
> ________________________________________
> From: ext rickbsgu [rbmailer-qt3d-/***@public.gmane.org]
> Sent: Saturday, March 19, 2011 9:13 AM
> To: rickbsgu; Smith Sarah.J (Nokia-MS-Qt/Brisbane); Pope Daniel (Nokia-MS/Brisbane); qt-3d-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
> Subject: Re: [Qt-3d] QGLTexture2D upload failing on win...
>
>>> Ok, I think we've determined that the VM OpenGL 1.1 is a problem.
>
> Did the driver change trick not work at all?
>


> What I'm interested to discover is why its not using the fixed function pipeline...

http://bugreports.qt.nokia.com/browse/QTBUG-18241

http://developer.qt.nokia.com/forums/viewthread/381/

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
sarah.j.smith-***@public.gmane.org
rickbsgu
2011-03-14 20:11:33 UTC
Permalink
Hi -

Here's a small project that is a pretty good encapsulation of what I'm trying to
do.

The relevant classes are:

Dialog - serves as the mainframe. Contains a frame that is the parent of the
viewer.
Scene - contains the scene - loads a 3ds model and applies a texture to one of
the meshes.
Viewer - views the scene.

This works great on Mac intel. Crashes on everything else, esp win.

Notes:

1. My understanding of OpenGL is pretty simplistic.
2. QGLAbstractScene::loadScene() (in Scene.cpp) crashes in optimized build -
works ok in debug build. Have to try unoptimized release build, next, I guess.

3. The texture is loaded and applied in 3DSMesh_5 - it should be the front
cover of the book.
4. I'm calling QGLFormat::setSampleBuffers(true) on the format, and enabling
GL_MULTISAMPLE (which on Win is GL_MULT?) on render, but I'm not getting it on
Windows. Not getting any anti-aliasing at all, there. I'm pretty sure win
supports OpenGL anti-aliasing?

5. You can dump the scene by uncommenting the qDumpScene call around line 46 in
Scene.cpp
6. The second light doesn't work. Mac or win, near as I can tell.Any help
appreciated. I'm kind of up against the wall on this.

Later,
rickb
Loading...