anael-seghezzi / Maratis-4

Maratis version 4 (experimental)
GNU General Public License v2.0
64 stars 8 forks source link

Unable to see textures using OpenGLES 2 #10

Open ghost opened 8 years ago

ghost commented 8 years ago

screenshot - 21 02 2016 - 14 08 15

anael-seghezzi commented 8 years ago

The font on the right is technically a texture. But some things are missing on the left. What steps did you follow to compile? How did you activate OpenGLES 2 ? Where is it running ?

anael-seghezzi commented 8 years ago

MGui is not using shaders, so if you are running the full MaratisEditor using MES2Context, UI will not show. Font rendering is an exception because font rendering if not handle by MGui but by the general engine.

ghost commented 8 years ago

So I downloaded the engine from your repo then instead of having the default context renderer, OpenGL, I changed it to OpenGL ES 2 by adding it to cmakelist.txt in editor folder and adding some not implemented "virtual" functions to OpenGL ES 2 context. After that I was able to run the whole thing but without the images.

ghost commented 8 years ago

One more thing. I don't know exactly what you changed, but in this version of Maratis: https://github.com/dahnielson/Maratis I could easly navigate through the whole engine using QT Community, but now the build system has been changed and I can't jump to classes, nor I get colored syntax for classes within the engine :*( .

anael-seghezzi commented 8 years ago

Ok, so it's because MGui is not using shaders, as editors are mainly used on desktop that still support fixed pipeline. Maratis player will work normally. Do you need the editor to run on mobile or tablet ?

anael-seghezzi commented 8 years ago

That said, it's not very complex to have MGui working with OpenglES.

ghost commented 8 years ago

I'd like to be able to have everything running with openglES 2 that including the editor. Do you have any tips on how to approach this situation? I could try to figure out myself but it would be easy to get some guidance from you. :)

anael-seghezzi commented 8 years ago

In MES2Context.cpp I started to write a basic fixed pipeline simulation. In "enableVertexArray" you can see that I started to bind attribute to a "simpleFX", that would be a minimal shader.

anael-seghezzi commented 8 years ago

The other option is to port MGui to use shader-based pipeline. But the old code would need to be preserved if possible (with a #ifdef M_LEGACY), to keep an option for old hardware.

ghost commented 8 years ago

Everyone from 2007 till now has es 2 compatibility :)

anael-seghezzi commented 8 years ago

MGui rendering code is mainly inside "MGui2d.cpp"

anael-seghezzi commented 8 years ago

Well, true, a #ifdef doesn't cost much though.

ghost commented 8 years ago

Alright,I'm starting to understand how this is suppose to be working but the fact that I cant jump from classes to classes and that I cant see the syntax color from Maratis's classes bothers me :|.

ghost commented 8 years ago

Okay, #ifdef for the win.

anael-seghezzi commented 8 years ago

I don't think I can help with QT Community, there is no conceptual difference with Dahnielson's Cmake. Your project must not be configured well, the paths probably...

ghost commented 8 years ago

Hmm...I doubt that since I needed to copy & paste the .so from engine/msdk and mgui inside the editor in order to have them working where on Dahnielson's Cmake they were copied automatically,the only thing I needed to do was just to put the assets folder. Plus the QT settings are exactly the same on both projects and yet they work differently.

anael-seghezzi commented 8 years ago

How does QT Community completion works ? Does it depend on third party informations / doc / doxygen ?

ghost commented 8 years ago

No,it does not. I think the issue is related to the fact that the .so files are not build in the same directory so maybe that's why QT does not know where to take the information from.

ghost commented 8 years ago

I found the problem and now I'll change everything that's required and push it into my local repo and if you like the changes fell free to add it into the main repo.

anael-seghezzi commented 8 years ago

Completion is almost always build from source only (not connected with libraries), so be sure that all MSDK headers are added to your project.

ghost commented 8 years ago

For example instead of having: #include <MEngine.h> I changed it into: #include "../../../MSDK/MEngine/Includes/MEngine.h" and not everything works perfectly

anael-seghezzi commented 8 years ago

Mh, not a good solution, you just need to add the path of MSDK somewhere in your project. In your settings something like "additional include path".

anael-seghezzi commented 8 years ago

http://stackoverflow.com/questions/20701805/why-doesnt-qt-creator-find-included-headers-in-included-paths-even-though-qma