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!
grafikrobot
Posts: 44
Joined: Wed Dec 26, 2007 11:42 pm

Post by grafikrobot »

Interesting... GL_EXT_texture_filter_anisotropic is defined without it having the extension.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

I found the bug point of GUI problem.

Code: Select all

//! sets the needed renderstates

void COGLES1Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel)

{

...
		m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-renderTargetSize.Height), -1.0, 1.0);


...
}

the problem comes from unsigned int operation. thus it should be modified as below.

Code: Select all

		m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0, 1.0);


________
HERBALAIRE
Last edited by seongnam on Fri Feb 25, 2011 9:41 am, edited 1 time in total.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

draw3DLine function is not working well... it should be changed as below... or drawVertexPrimitiveList2d3d function which needs to be modified.

Code: Select all

//! Draws a 3d line.
void COGLES1Driver::draw3DLine(const vector3df& start,
				const vector3df& end, SColor color)
{
	setRenderStates3DMode();

	u16 indices[] = {0,1};
	S3DVertex vertices[2];
	vertices[0] = S3DVertex(start.X,start.Y,start.Z, 0,0,1, color, 0,0);
	vertices[1] = S3DVertex(end.X,end.Y,end.Z, 0,0,1, color, 0,0);
#if 0
	drawVertexPrimitiveList2d3d(vertices, 2, indices, 1, EVT_STANDARD, EPT_LINES, EIT_16BIT, false);
#else
	drawVertexPrimitiveList2d3d(vertices, 2, indices, 1, EVT_STANDARD, EPT_LINES, EIT_16BIT, true);
#endif
}
Updated on March 8th :

the Actual problem came from "false" value for the thread parameter, if you change that to "true", it works fine.
________
Steroid Rehab Dicussion
Last edited by seongnam on Fri Feb 25, 2011 9:41 am, edited 3 times in total.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

Any idea for these issues ?
1. why the flame in the "08.SpecialFX" doesn't operate transparent effect properly...
the phenomenon is very weird because it work when I select stencil buffer option.
and if I don't select the option and light is in the back of the frame, it is working well, but if the light(the floating globe) is in the front of the flame... it show opaque effect.

2. beside the flame, there is a expanding/shrinking light object... but it is just showing as grey cubic.

3. the dragon in the "06.2DGraphics" doesn't go with alpha channel... I remember that it had a transparent effect.
________
California Medical Marijuana Dispensary
Last edited by seongnam on Fri Feb 25, 2011 9:41 am, 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 »

Would you *please* update your repository :!: All those things you mentioned have been fixed ages ago :idea:
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

which version are you saying ?
I downloaded the sources from your SourceForge CVS tree...today... and compared with my version...but just couple of different and everything are same with my version.

SCM Repositories - irrlicht
Files shown: 421
Directory revision: 2250 (of 2257)

if you don't have any problem in your system..it might be only issue in my system.
Linux(Fedora 10), X11 and PowerVR OpenGLES 1.1 simulator.

Anyway... it is problem in my system... could you point out where you changed for the problems ?.... I'd like to take a look the changed points.
________
Ecstasy Rehab Forum
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, 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 »

All the required changes (such as the ifdef and the cast to s32) are already in the ogl-es branch. So it cannot be missing in your code, at least if you have the latest revision.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

I had done double checking codes... if your repository is not in the source forge, it can be possible to me to get different sources because I downloaded that from the ogl-es branch in source forge, and I saw your recent update in the tree.
thus, I believe that I have the latest sources.

Anyway, this is a summery in my testing with example applications and I found some difference against OGL. some features are not available with OGLES 1.1... but I think we may find alternative way to support similar functionality. so please consider about this list.

1. 06. 2D graphics.
- Alpha channel is not working for bitmaps. ( no transparent : showing pink colour )

2. 08. Special FX
- Dynamic shadow is not working ( no effect )
- Fire flame does not working transparent effect when the light is in the front angle.
when the light is in the back... it is working. ( partially effect )
- light effect inside water wave is not working.( no effect )
- expanding flame beside fire frame is not working...( effect: grey box )

3. 09. Mashviewer
- Wire overlay is not working ( change whole object to grey colour without wire effect )

4. 10.Shaders
- ps & vs & EMT_Transparent effect is not working...
because OGLES 1.1 doesn't have shader, I agree with not to make effect.. but OGLES can make transparent effect for the object... thus It can be extended.
- ps & vs & EMT_Solid is not working
same with upper issue.

5. 11.PerPixelLighting
- globe doesn't have earth texture instead wall texture.
- Bump mapping is not working
I am not sure whether it is possible to support this feature with OGLES 1.1
- Parallax is not working.
I understand it is not implemented yet.

6. 12.TerrainRendering
- wire frame is not showing as 09. Mashviewer problem.

7. 13.RenderToTexture
- there is no light source on the back of the flying object.
________
FAMILY GUY ADVICE
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 2 times in total.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

If you migrate pre-implemented codes in 1.4 to render plygons, you can fix wire frame problem.
3. 09. Mashviewer
- Wire overlay is not working ( change whole object to grey colour without wire effect )

6. 12.TerrainRendering
- wire frame is not showing as 09. Mashviewer problem.

Code: Select all

		//note that PolygonMode in OpenGL ES is not directly supported. The following provides
		//a workaround for PolygonMode(GL_LINES) or PolygonMode(GL_POINTS). However, the wireframe
		//mode, which corresponds to GL_LINES, is inefficiently emulated because a large number
		//of function calls are needed.
        //
		//QUAD_STRIP, QUADS and POLYGON are also not directly supported. We use triangle strips,
		//triangle loops to render them.
#if 1
		case EPT_TRIANGLE_STRIP:
			if(Material.Wireframe)
			{
				for(s32 i = 0; i<primitiveCount; i++)
					glDrawElements(GL_LINE_LOOP, 3, GL_UNSIGNED_SHORT, (u16 *)indexList+i);
			}
			else
				glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_STRIP, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_TRIANGLE_FAN:
			if(Material.Wireframe)
			{
				//draw the outer line loop
				glDrawElements(GL_LINE_LOOP, primitiveCount, GL_UNSIGNED_SHORT, indexList);

				//draw inner lines
				u16 lineIndex[2];
				lineIndex[0] = *((u16 *)indexList);
				for(s32 i = 2; i <= primitiveCount; i++)
				{
					lineIndex[1] = *((u16 *)indexList + i);
					glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, lineIndex);
				}
			}
			glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_FAN, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_TRIANGLES:
			if(Material.Wireframe)
			{
				for(s32 i = 0; i < primitiveCount; i++)
					glDrawElements(GL_LINE_LOOP, 3, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*3));
			}
			else
				glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLES, primitiveCount*3, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_QUAD_STRIP:
			if(Material.Wireframe)
			{
				u16 lineIndex[4];
				for(s32 i = 0; i < primitiveCount; i++)
				{
					lineIndex[0] = *((u16 *)indexList + (i*2));
					lineIndex[1] = *((u16 *)indexList + (i*2+1));
					lineIndex[2] = *((u16 *)indexList + (i*2+3));
					lineIndex[3] = *((u16 *)indexList + (i*2+2));
					glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, lineIndex);
				}
			}
			else
				glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_STRIP, primitiveCount*2+2, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_QUADS:
			if(Material.Wireframe)
			{
				for(s32 i = 0; i < primitiveCount; i++)
					glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*4));
			}
			else if(Material.PointCloud)
				glDrawElements(GL_POINTS, primitiveCount*4, GL_UNSIGNED_SHORT, indexList);
			else
			{
                for(s32 i = 0; i < primitiveCount; i++)
					glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, (u16 *)indexList+(i*4));
			}
			break;
		case EPT_POLYGON:
			if(Material.Wireframe)
			{
				for(s32 i = 0; i < primitiveCount; i++)
					glDrawElements(GL_LINE_LOOP, primitiveCount, GL_UNSIGNED_SHORT, indexList);
			}
			else
				glDrawElements(Material.PointCloud ? GL_POINTS : GL_TRIANGLE_FAN, primitiveCount, GL_UNSIGNED_SHORT, indexList);
			break;
#else
		case EPT_TRIANGLE_STRIP:
			glDrawElements(GL_TRIANGLE_STRIP, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_TRIANGLE_FAN:
			glDrawElements(GL_TRIANGLE_FAN, primitiveCount+2, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_TRIANGLES:
			glDrawElements(GL_TRIANGLES, primitiveCount*3, GL_UNSIGNED_SHORT, indexList);
			break;
		case EPT_QUAD_STRIP:
// TODO ogl-es
//			glDrawElements(GL_QUAD_STRIP, primitiveCount*2+2, indexSize, indexList);
			break;
		case EPT_QUADS:
// TODO ogl-es
//			glDrawElements(GL_QUADS, primitiveCount*4, indexSize, indexList);
			break;
		case EPT_POLYGON:
// TODO ogl-es
//			glDrawElements(GL_POLYGON, primitiveCount, indexSize, indexList);
			break;
#endif
________
EXTREME Q VAPORIZER
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 1 time in total.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

When I tested 06.2DGraphics example... I got below error message...
It came from glTexSubImage2D API calling... but I couldn't figure out why I had the error message...

while I was trying to check all the functionality with example applications... I doubt that the OpenGL 1.1 driver was verified....
Loaded texture: /root/irrlicht-ogl-es-basis/media/2ddemo.bmp
GL_INVALID_VALUE
Could not glTexImage2D
GL_INVALID_VALUE
Could not glTexImage2D

Code: Select all

	void* source = Image->lock();

	if (newTexture)

		glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, Image->getDimension().Width,

			Image->getDimension().Height, 0, PixelFormat, PixelType, source);

	else

		glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, Image->getDimension().Width,

			Image->getDimension().Height, PixelFormat, PixelType, source);

	Image->unlock();



	if (Driver->testGLError())

		os::Printer::log("Could not glTexImage2D", ELL_ERROR);

________
Lukumi dicussion
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 1 time in total.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

while I was looking the difference between 06. 2D graphics & 04. Movement sample application, I realized that only difference is whether program goes through makeColorKeyTexture(...) API to add colorKey in case of 06. 2D graphics...
, but the Irrlicht logo file for 04. Movement sample application does already have the colorKey in PNG file, thus it doesn't go through the API.
and both use same blending function & COGLES1Driver::draw2DImage API to draw picture, but the effect is different.
04. Movement has the transparent effect with the logo
06. 2D graphics draw pink color which should have transparent effect.

does anyone have idea why it has different effect ?
________
Halfbaked
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, 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 »

16bit textures and 32bit textures. With an alpha channel the textures are loaded into 32bit textures, otherwise they are often loaded to 16bit textures for memory saving.
Cpasjuste
Posts: 8
Joined: Tue Apr 21, 2009 1:20 pm

Post by Cpasjuste »

seongnam did you fix the color problem ?

I'm currently trying to get irrlicht running on the pandora, but it does not support bgra too so i have to switch texture format to rgb, but have the same problem than you i think (blue colors and transparant one .. ).
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, that's why I applied for a developer version - hope to get one of the early ones of mass production 8)
The problem in that case is that the BGRA8888 extension is missing. I have made an Irrlicht version once which did work with the OpenGL color scheme. However, it requires lots of changes in the whole engine. That's why I simply hoped for support for the extension (just as on the iPhone). But I can revive the code in the next weeks.
seongnam
Posts: 28
Joined: Mon Feb 23, 2009 5:53 am

Post by seongnam »

As the hybrid's statement, if the system doesn't support BRGA888 extension, it requires changing architecture..., but I am not thinking the impact is to Irrlicht engine itself..it could be isolated to only OGLES1 driver.
________
Zx14 Vs Hayabusa
Last edited by seongnam on Fri Feb 25, 2011 9:42 am, edited 1 time in total.
Post Reply