View unanswered posts | View active topics It is currently Sun Jun 24, 2018 11:14 am



Reply to topic  [ 7 posts ] 
 shaders qt5.5.1 
Author Message

Joined: Mon Sep 05, 2011 3:54 pm
Posts: 14
Post shaders qt5.5.1
Hi!

We use GLC_lib from https://github.com/laumaya/GLC_lib/commits/master
With Qt5.4 shaders worked fine, but when using Qt5.5.1 shaders don't work correctly. What could be the problem?

thank you!


Thu Feb 25, 2016 2:32 pm
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: shaders qt5.5.1
Hello,
In order to help you, I need more information about the problem.


Fri Feb 26, 2016 8:49 am
Profile

Joined: Mon Sep 05, 2011 3:54 pm
Posts: 14
Post Re: shaders qt5.5.1
Hi!

Attached file contains a modified example11 with broken shader selection.
You need to put Democles.dae file to project (too big to add to the Forum).
Example works perfectly with qt5.4 and does not work with qt5.5.1.

I made a mistake, we use GLC_lib from [url]https://github.com/laumaya/GLC_lib/commits/develop[/url]

Thank you!


Attachments:
glcshadertest.zip [6.4 KiB]
Downloaded 224 times
Fri Feb 26, 2016 2:34 pm
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: shaders qt5.5.1
Hello,
In your code, you use a SIGNAL with doesn't exists :
Code:
QObject::connect(quickView, SIGNAL(contextInitialized()), loader, SLOT(loadShaders()));

Perhaps you have modified GLC_lib ?

Instead of using this kind of thing I purpose to overload the class GLC_QuickView like this :
Code:
class MyQuickView : public GLC_QuickView
{
public:
    MyQuickView(QWindow* pParent = 0);
    MyQuickView(QQmlEngine* pEngine, QWindow* pParent);
    MyQuickView(const QUrl& source, QWindow* pParent = 0);
    virtual ~MyQuickView();

public:
    void setLoader(ShaderLoader* pLoader)
    {m_pLoader= pLoader;}

protected:
    virtual void initializeGL();

private:
    ShaderLoader* m_pLoader;
};


Code:
void MyQuickView::initializeGL()
{
    Q_ASSERT(NULL != m_pLoader);
    m_pLoader->setVertexShader(":Shaders/select_glc.vert");
    m_pLoader->setFragShader(":Shaders/select_glc.frag");
    m_pLoader->loadShaders();
}

See attached file for the complete code which work for me.


Attachments:
example11.zip [1.38 MiB]
Downloaded 223 times
Fri Feb 26, 2016 6:58 pm
Profile

Joined: Mon Sep 05, 2011 3:54 pm
Posts: 14
Post Re: shaders qt5.5.1
Hello!

The example, we compile under Windows 7 x64 (GLC_lib x32)
selection shader under QT 5.5.1 makes elements transparent, but under QT 5.4.1 it's ok.
GLC_lib we did't change.

Thank you!


Mon Feb 29, 2016 3:40 pm
Profile

Joined: Mon Sep 05, 2011 3:54 pm
Posts: 14
Post Re: shaders qt5.5.1
Hello!
After calling this function

void GLC_QuickView::sceneGraphInitializedDone()
{
...
m_pQOpenGLContext->create();
...
}

we get this error:

ARB::createContext: wglCreateContextAttribsARB() failed (GL error code: 0x502) for format: QSurfaceFormat(version 4.5, options QFlags(0x4), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior 2, swapInterval 1, profile 2), shared context: 0x30000 ()
GDI::createContext: wglShareLists() failed.

This error appears only on Windows 7 with Qt 5.5.1.

Probably the error appears that
pContext and m_pQOpenGLContext are created in different threads


Thu Mar 03, 2016 1:38 pm
Profile

Joined: Mon Sep 05, 2011 3:54 pm
Posts: 14
Post Re: shaders qt5.5.1
Hello!

If someone is faced with a similar problem, we helped the appointment of an environment variable:

QSG_RENDER_LOOP= windows

Perhaps in QT5.5.1 something is not completed for multithreading.
Thank you!


Mon Mar 14, 2016 8:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.