OpenGLES 1.1 Driver Porting Issues

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

regarding the 06. 2D graphics problem, I don't think that is 16bit textures and 32bit textures problem because of .bmp image style such as 2ddemo.bmp and below my setting for EGL configuration.

Code: Select all

	EGLint attribs[] =
	{
		EGL_RED_SIZE, 8,
		EGL_GREEN_SIZE, 8,
		EGL_BLUE_SIZE, 8,
		EGL_ALPHA_SIZE, 8,
		EGL_BUFFER_SIZE, 16,
		EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
		EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
		EGL_DEPTH_SIZE, 16,
		EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
		EGL_NONE, 0
	};
	EGLConfig config;
	EGLint num_configs;
	if (!eglChooseConfig(EglDisplay, attribs, &config, 1, &num_configs))
	{
		Printer::log("Could not get config for OpenGL-ES1 display.");
	}
additionally, when I trace the makeColorKeyTexture(...) function, It passed through the 32bit ECF_A8R8G8B8 operation logic :

Code: Select all

	else
	{
		s32 *p = (s32*)texture->lock();
		if (!p)
		{
			Printer::log("Could not lock texture for making color key channel.", ELL_ERROR);
			return;
		}
		dimension2d<u32> dim = texture->getSize();
		s32 pitch = texture->getPitch() / 4;
		// color with alpha disabled (fully transparent)
		const s32 refZeroAlpha = 0x00ffffff & color.color;
		const s32 pixels = pitch * dim.Height;
		for (s32 pixel = 0; pixel < pixels; ++ pixel)
		{
			// If the colour matches the reference colour, ignoring alphas,
			// set the alpha to zero.
			if(((*p) & 0x00ffffff) == refZeroAlpha)
			{
				if(zeroTexels)
					(*p) = 0;
				else
					(*p) = refZeroAlpha;
			}
			++p;
		}
thus, the format is definitely ARGB32bits, the desired pixels are filled with refZeroAlpha value... and the system is 32bit system... :cry:
________
LOVE STORIES DICUSSION
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 1 time in total.
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

OK i understand that. The good news is that you (hybrid) plan to port it to the pandora, i didn't know that. It's a good news so i may just drop this "project" since you will of course do it better than me. Of course if you need it, i'll be able to test some things for you.

Another note, the OGLES drivers seems to support BRGA888, i don't understand why they didn't added it to the gles 1.1 one..
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Cpasjuste wrote:OK i understand that. The good news is that you (hybrid) plan to port it to the pandora, i didn't know that. It's a good news so i may just drop this "project" since you will of course do it better than me. Of course if you need it, i'll be able to test some things for you.
Yes, I announced the port about 6 month ago on the pandora forum. I'll assess the changes necessary for OpenGL-RGBA-support in the whole engine, or doing it (slightly less performant) in the driver.
The colorkey method is probably always changing to 32bit, in order to support a full alpha range. I'll have a look at it.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I've just fixed a bug in the extension recognition. Due to a change in the extension string the last extension (for imgtec drivers usually the BGRA8888 extension) was not properly recognized. Mabe you can test the most recent SVN revision again?
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

It's still a no go :x

If i don't change anything in the code, all textures are white.

If i change all GL_BGRA def to GL_RGBA in the "void COGLES1Texture::copyTexture(bool newTexture)" function, textures are loaded correctly but there is the color problem.

Still a change, there is no more error when initializing the engine on the extensions query :

Code: Select all

Irrlicht Engine version 1.6 SVN
Linux 2.6.27-omap1 #1 Fri Mar 13 22:06:26 GMT 2009 armv7l
Creating X window...
Using plain X visual
Visual chosen: : 33
Using renderer: OpenGL ES-CM 1.1
OpenGL_ES OpenVG 
Imagination Technologies
EGL_KHR_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image 
GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_EXT_multi_draw_arrays GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_IMG_texture_stream GL_IMG_vertex_program 
Loaded mesh: ../../media/sydney.md2
Loaded texture: /home/root/nfs/irrlicht-latest-ogl-es/media/sydney.bmp
Quit message received.
Last edited by Cpasjuste on Thu May 07, 2009 12:49 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, ok. Then we'll probably need the color changes.
Which extensions are reported upon startup?
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

Look up :p
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, the error listed on startup was due to a missing check for a supported extension, I just had it ifdef'ed. However, the get was using in invalid enum then :(
Strange that the extension is listed as being supported, but still is not. I'll try to start with a rather local version which only converts the images upon upload. This would require less changes to the engine.
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

Note that the 06 exemple (2d graphics) works correctly out of the box.

I think i'v seens somewhere that the bgra extention is only available with the OVG sgx driver.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I thought that the hardware profiles would manage such things. Moreover, having the extension listed in the string, but still issuing errors on its use seems odd :?
Example 6 seems to have had some problems with the old emulation. I've changed to 2.04 yesterday and it fixed this problem :D The only problem I've seen so far (depsite the color problem) is a renderstate bug visible in example 8: The volume light sometimes switches to a solid black box. Looks like the material is not properly enabled in each cycle.
The wireframe mode is currently being emulated by rendering with GL_LINES instead of GL_TRIANGLES. This leads to some artifacts when rendering, but works pretty good for debugging purposes. A better solution will need some more work on the VBOs and will have to wait until maybe Irrlicht 1.7 or later.
BTW: What FPS is achieved for the examples?
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

On the 02 exemple (q3 bsp) i get around 50 fps :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, not bad. Een more since the q3 levels still don't get any speedup from VBOs. Does example 12 work? The terrain already is static in VBOs, at least for the vertices.
I've now added support for non-BGRA platforms. However, once the flag is set to support the extension Irrlicht will still use that format. You should add
FeatureAvailable[IRR_IMG_texture_format_BGRA8888]=false;
in line 162 of COGLESExtensionHandler.cpp to override the extension.
the current solution converts the images each time they are uploaded to the GPU. With careful locking this should be only upon scene loading.
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

Ok, just tested the latest svn.

First : your latest correction is working great, texture are now working correctly out of the box. The sgx ogles 1.1 driver really don't have bgra8888 support while it's listed as supported ..

In fact, fps are worst than i tought, since the last test i did was with white textures, which mean they were not loaded correctly, fps was of course better. But i think it's still great, on the q3 map i get around 35 fps, i'm sure with proper optimisations we could get a better one.
The worst fps i had was on the collision exemple, around 10 fps.

Exemple 12 work great.

There's still a bug left, there is a (maybe) blending problem. Some textures are transparent while they shouldn't. I will try to take a look to see if i can identify the problem. Here is some screenshot to understand ( do not look at fps, screenshot are took from VNC which slow down the whole thing ) :


Image

Image

I think you are doing a pretty good job, you will be the first to have a great, simple, working 3d engine on the Pandora.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ah yes, I also saw this problem in your video. I thought it was due to the problem of the wrong alpha values. However, now it looks like it's a zbuffer problem. I'll check the setup and add some outputs to the framebuffer creation.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

New version is much better then before( good impression )... but still it has some looking points: I have checked on Linux Fedora 10 with Power VR 2.04 version.

firstly, as shown in the previous picture, all the Irrlicht logo has a Z order or alpha problem.

02.Quake3Map
It is interesting side effect.
when I run the program on old Linux machine with ATI graphic card, it looks fine except the red lava ditch... it is showing totally white( like totally missing )
but, with Intel on board chipset, I got the same problem as previous report ( Cpasjuste's report: alpha blending problem ), I will double check the difference because I saw the side effect with almost 1 week old version.
seems like GL_BGRA problem or new version problem...

08.SpecialFX
the violet colour flame which is periodically changing to grey box. It depend on the camera angle.
1 week old version : it was running even though there is no any effect for real time shadow effect option, but new version has a segmentation fault.

11.PerPixelLighting :
It has a different effect for each options( diffuse, bump, parallax ) whatever it was correct operation or not, but new version has only one operation.
- my impression was only parallax was not working well for the previous version

13.RenderToTexture
when you move mouse to change camera angle, the screen is stuttering. I saw some version has the problem, but the last version( before April ) didn't have the problem.

18.SplitScreen
Video mode switching is not working and totally kill video signal output when you push Alt+Tab key

21.Quake3Explorer
I could run this application with almost 1 week ago even though it had a video mode switching problem from the full screen game to console as the Alt+Tab Key problem, but it is not working on today snapshot at all.
________
MOTORCYCLE TIRES
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 1 time in total.
Post Reply