Horde3D

Next-Generation Graphics Engine
It is currently 24.09.2018, 10:38

All times are UTC + 1 hour




Post new topic Reply to topic  [ 154 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next
Author Message
 Post subject: Re: OpenGL ES Port
PostPosted: 16.01.2011, 01:01 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi skaiware,

Sorry it's a little hack n' slash, the code in there was untested (except for me testing it) so I can only go by what my environment is set up to produce... :) I'm using the latest Nokia Qt SDK with this.

The code in ES_test differs greatly to what I'm using now so I'll commit the code I'm using right now. Bare in mind stuff like shadowmaps won't work out of the box due to the N900 not exposing depth textures (and I haven't got around to making my bit-shifting RGBA4-to-depth render target shader to work yet, and I probably won't bother due to the performance problems with multi-pass rendering on the device).

Updated ES_test just then, please test this as well as Horde_Qt_ES in Samples.

Thanks!

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 20.01.2011, 00:27 
Offline

Joined: 23.06.2010, 09:38
Posts: 6
Hi Alex
You're really welcome. Congrats.
But it still does not compile :
First, dont know why but in my Qt Creator environment QMAKE is not defined.
Anyway we can add it at the very beginning of horde3d.pro with : DEFINES += QMAKE
Then it correctly #include "Terrain/Source/extension.h"
But then :
../Extensions/Terrain/Source/extension.h:22: error: expected class-name before '{' token

In order to give maemo community (in the devel repository) a first demo of Horde3d in order to find more guys to help you, would n't it be simpler to forget Terrain addon fot the moment ?

Kind regards,
S.


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 21.01.2011, 14:58 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi skaiware,

I forgot to commit the latest terrain source from the main branch into this one, just updated it then (recently all the source was encompassed into the Horde3D namespace so this is most likely why it failed to compile). Terrain might not work out of the box because I haven't adjusted the shaders yet (pretty much just the precisions need to be set in the fragment program lowp/mediump/highp to the uniforms/sampler2D's). Hope this helps.

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 25.01.2011, 03:43 
Offline

Joined: 25.01.2011, 03:41
Posts: 1
"Moving the tranformations to the shader shouldn't be a big problem, should it?"

Why it will be a big problem and what will be the problem for this.

---------------
Blazer Jackets


Last edited by martyseilh on 07.02.2011, 08:19, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 27.01.2011, 00:55 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
martyseilh wrote:
"Moving the tranformations to the shader shouldn't be a big problem, should it?"

Why it will be a big problem and what will be the problem for this.

Sorry I don't think I'm following you, where was this quoted?

It might be a really old comment about having no built-in matrices with ES 2.0 for shaders, don't worry though as Horde does these now on its own even in the regular SVN releases (not beta4) as I think they're deprecated in desktop GL 3.x or 4.x so they needed to be changed anyway.

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 04.03.2011, 03:53 
Offline

Joined: 04.03.2011, 03:39
Posts: 2
Location: Darwin, Australia
Hi Everyone,

Just discovered this project yesterday :O
I really like the layout of the code and simplicity of the API, so last night I downloaded the latest ES version from svn and tried to get an iPad app running in the simulator using the knight demo.

Alot of compile errors due to PLATFORM_MAC including Carbon.h. I added a check in utPlatform.h to undef PLATFORM_MAC if PLATFORM_IOS is defined. That cleared up that issue. Everything is compiling, however right now its just rendering a blank screen.

I went through it with the debugger but it was late (and I haven't slept much lately) and I was too tired to hold a thought together. Will get some more time this weekend to look at it however.

Has anyone succeeded in getting this project running under iOS? Or any ideas where I should look at first to start debugging? I admit, after one day my knowledge of the project is pretty limited :P


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 04.03.2011, 06:48 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi couchman,

I haven't tried it with iOS just yet but I plan on soon when I have spare time. What you might be looking for is when Horde changes the default framebuffer back to 0 it needs to be set to 1 for iOS to render properly. I think I stubbed it with a special #define DEFAULT_FRAMEBUFFER or something along those lines (check egRendererBase.cpp, warning, there's some messy #ifdef's caused by me!). So if you can, just check to see if it is changing to 1 when it detects PLATFORM_IOS... :) Also define it to be ES2.0, I forget also what this #define is called exactly, I'm at work so I can't really check for you right now.

Also my utOpenGL.h code might have some odd #ifdefs specific for iOS, I need to look into this if it isn't working out of the box... This code has only been tested on Maemo/N900 sorry!

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 04.03.2011, 12:46 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
Considering the Carbon issue it might be already fixed in the trunk, since we did remove the Carbon framework from GLFW a while ago.

Regarding the FBO problem it might be better to use

Code:
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prevFBO);


to get the FBO bound before starting the rendering within Horde and reset it to this one after finish rendering. That would avoid problems with other rendering backends that might be used parallel to Horde. Setting it to one instead of zero might work for this special case within IOS, but if you have multiple FBOs this won't work unless you get the real FBO used before starting the Horde rendering as suggested above .


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 08.03.2011, 05:02 
Offline

Joined: 04.03.2011, 03:39
Posts: 2
Location: Darwin, Australia
Well, some progress.. I didnt get as much time over the weekend as I wanted, but I got something rendering on the screen :D

Some issues, I was getting EXC_BAD_ACCESS while binding textures. It was trying to set texture unit 12? Is this the shadowmap texture? I looked around for where the texture data might be set by but I couldn't find it..

The other problem is that the scene is rendered to a small section of the screen in the bottom-left hand corner. Totally no Idea on that one.

I'll post a screenshot later tonight after I get home.

Cheers


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 08.03.2011, 09:30 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
couchman wrote:
Some issues, I was getting EXC_BAD_ACCESS while binding textures. It was trying to set texture unit 12? Is this the shadowmap texture? I looked around for where the texture data might be set by but I couldn't find it..

Maybe the IPhone does not have that much texture units. See the posts some pages before.

couchman wrote:
The other problem is that the scene is rendered to a small section of the screen in the bottom-left hand corner. Totally no Idea on that one.
I'll post a screenshot later tonight after I get home.

Probably some viewport issues.


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 08.03.2011, 11:25 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Very cool couchman! Afaik Horde3D defaults to 320x240 so you might need to manually set EAGLview to the right resolution, or there's a few calls to make like these:
Code:
   // Resize viewport
   h3dSetNodeParamI( _cam, H3DCamera::ViewportXI, 0 );
   h3dSetNodeParamI( _cam, H3DCamera::ViewportYI, 0 );
   h3dSetNodeParamI( _cam, H3DCamera::ViewportWidthI, width );
   h3dSetNodeParamI( _cam, H3DCamera::ViewportHeightI, height );

   // Set virtual camera parameters
   h3dSetupCameraView( _cam, 45.0f, (float)width / height, 0.1f, 1000.0f );
//   h3dResizePipelineBuffers( _hdrPipeRes, width, height );
   h3dResizePipelineBuffers( _forwardPipeRes, width, height );

If you can share the code that would be great! I got Xcode and my ipod touch setup tonight and was about to tackle it... :)

Edit: Yeah iOS supports 8 texture units on SGX and 2 texture units on MBX so set that guy to 7. :)

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 11.04.2011, 05:18 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi couchman,

How far did you end up with Horde on iOS? I've currently got the SDK and iOS version 4.2 running on my ipod touch and I keep getting EXC_BAD_ACCESS on the most trivial stuff like extension checking and later a template to create a group node, really weird (I don't have the specifics here at work but I'll share them when I get home). This could be just the simulator as I can only debug with that at the moment until I work out why I can't on my ipod touch...

If you have code which starts up Horde already could you please share it so I can further the port progression? Thanks!

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 22.04.2011, 09:36 
Offline

Joined: 22.04.2011, 09:13
Posts: 2
I'm currently trying to port it to android using native activities (android 2.3)
so far h3dInit() works...

I guess the next step is to adapt the resources loading since, on android, resources files are stored in a zip like file (the apk) and stdio can't be used for these
any hints/tips would be welcome...

btw: looking at knight_es demo, I see that some textures are in .pvr format (I guess it's a custom compressed texture used on PVR gpu)... what about GPU which don't support this format...
I'm running on a HTC Desire with a Qualcomm SoC using an Adreno200 gpu, I think AMD/ATI compressed texture are supported...

also, what workflow could be used to commit back my changes, svn branches, patches, whole tar archive?

loki


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 23.04.2011, 01:42 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi loki,
The pvr file is a container format so you can create an RGB565 cube map, I just made it pvrtc format for testing on my phone, the branch is a bit of a raw testing state right now. I've got a bit of code for an android port using nvidia's sample code so it is compatible with 2.2 froyo, but it still needs debugging (hopefully I get time to finish it over the easter break!)

Nvidia has an apk loader which works a lot like C's file loading and I've made a h3dutLoadResourcesFromDisk function that uses this, I will share when I get home.

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL ES Port
PostPosted: 26.04.2011, 13:45 
Offline

Joined: 22.04.2011, 09:13
Posts: 2
ok, could you push your code, so I don't redo your work?

personally, for this kind of project, I would forget android 2.2, it will be a mess to handle through JNI (not impossible)
android 2.3 is not yet widely deployed, but it's changing slowly and until we get horde3d running correctly, android 2.3 will be deployed on majors devices (hopefully)

I've already ported an OpenGL ES 2.0 2D engine (orx-project.org) and basically, if it's running on iPhone, it'll run on android

what are the currents limitations/issues with horde3D on OpenGL ES 2.0?

about the pvrtc file... on Qualcomm there is an equivalent tool to build an ATI compressed texture which could be used on the HTC desire, but the problem is more general... on android you have to detect at runtime which format is supported (only ETC1 should be supported on all android devices, but it doesnt support alpha channel)
any thoughts on this ?

loki


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 154 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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® Forum Software © phpBB Group