[SOLVED] ogl-es branch, shader driver (2), not rendering

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!
darkphoenix16
Posts: 8
Joined: Thu Nov 04, 2010 2:50 am

[SOLVED] ogl-es branch, shader driver (2), not rendering

Post by darkphoenix16 »

Hey,

I've been working with ogl-es for the past 4 months. I just switched from the 1.1 driver to the 2.0 driver. The 1.1 driver was becoming slow on my PC, not sure why.

I changed the shader path from "../../media/Shaders" to "data/shaders" in the irrlicht config header. The new path corresponds to the location of irrlicht's shaders in my game.

The shaders appear to load properly, but the fixed function shaders (and others but im only using fixed function) have a lot of "unable to find uniform" errors.

Code: Select all

Irrlicht Engine version 1.8.0-alpha
Microsoft Windows Vista Home Premium Edition  (Build 6000)
EglDisplay initialized. Egl version 1.3
Got 1 configs.
 Creating EglSurface with nativeWindow...
SUCCESS
SUCCESS
Creating EglContext...
Using renderer: OpenGL ES 2.0 ( SDK build: 2.06.26.0641 )
OpenGL_ES
Imagination Technologies (Host GL: `ATI Technologies Inc.`)
GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_query_matrix GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_IMG_read_format GL_OES_point_sprite GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_blend_substract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_vertex_half_float GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_depth24 GL_OES_depth_texture GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_stencil8 GL_OES_fragment_precision_high GL_OES_element_index_uint GL_IMG_texture_compression_pvrtc GL_OES_mapbuffer GL_EXT_multi_draw_arrays
Loading shader: data/shaders/COGLES2FixedPipeline.vsh
Loading shader: data/shaders/COGLES2FixedPipeline.fsh
Success.
Unable to find uniform : uUseLight
Unable to find uniform : uLightPosition
Unable to find uniform : uLightAmbient
Unable to find uniform : uLightDiffuse
Unable to find uniform : uLightSpecular
Unable to find uniform : uLightDirection
Unable to find uniform : uLightAttenuation
Unable to find uniform : uLightExponent
Unable to find uniform : uLightCutoff
Unable to find uniform : uMaterialSpecular
Unable to find uniform : uUseTexture
Unable to find uniform : uTextureMatrix
Unable to find uniform : uUseTexMatrix
I'm guessing that this is why my game renders in black and white (mostly white but I do have a few surfaces which are black). Is there something I did wrong during the build process? Perhaps I am using the engine improperly? To switch to egl 2 I just changed the driver type from EDT_OGLES1 to EDT_OGLES2.

Any help would be greatly appreciated.

Thanks!
Last edited by darkphoenix16 on Tue Apr 26, 2011 11:29 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 »

No, there was already a bug report which claimed that some (all?) actual implementations of the ogl-es drivers have a limit on the number of characters in a uniform name. So even without changing the path there would be this error. You simply have to rename them to shorter names.
darkphoenix16
Posts: 8
Joined: Thu Nov 04, 2010 2:50 am

Post by darkphoenix16 »

Thanks hybrid. Sorry I didn't catch that bug. I searched for "unable to find uniform" in the forums but didn't notice anything.
fluke9
Posts: 6
Joined: Sat Aug 04, 2012 12:13 pm

Re:

Post by fluke9 »

hybrid wrote:No, there was already a bug report which claimed that some (all?) actual implementations of the ogl-es drivers have a limit on the number of characters in a uniform name. So even without changing the path there would be this error. You simply have to rename them to shorter names.

Found the solution ;-)
Its not the namelength but how some drivers export uniform arrays.


http://irrlicht.sourceforge.net/forum/v ... 6&p=270913
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

When i tried to implement own Shaders in OPENGLES 2.0 getting "NO SHADER SUPPORT" error. But shaders provided in IOS project "COGLES2FixedPipeline" etc... works well. Can any one suggest what would be the reason ? Does't it allows own shaders ?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by Nadro »

Which device and OS? For Android You have to enable OGLES2 contex support in Your app xml file.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

Device: iPad 1.0
OS : IOS 6.0
Driver Type: OPENGL ES 2.0
Irrlicht version: 1.8

Default Shaders Provided in the downloaded file (COGLES2FixedPipeline.vsh,COGLES2Renderer2D etc..) works fine without Problems.
But When i tried to implement Separate Shaders Other than that getting "NO SHADER SUPPORT" ERROR.

I tried both of the formats following
s32 materialName=GPU->addShaderMaterial(...);
s32 materialName=GPU->addShaderMaterialFromFiles(...);
But same error.

What could be the remedy and reason ?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by Nadro »

In next weekend (currently I'm finishing my last product based on OGL ES1) I'll switch from OGL ES1 to OGL ES2 for my apps, so I will fix this issue (for next week it should be solved). Currently I'm too busy to fix it now :(
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

ok :-) . Hope, i will solve it as soon as possible. if Solved, will post "steps to follow" , else i should look for help.
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

To Implement Fake Instancing , its necessary to pass node's world arrays to shaders , That's the Main reason for me to Implement Separate Shaders . We Can't pass our "own uniforms" to Default FixedPipeline shaders provided in it.

Now Managed to compile Separate Shaders in OPENGL ES 2.0, But No use it always uses FixedPipeline shader(Provided Default) O/P to Display in Screen for SMGR->drawAll(). Even when i disabled FixedPipeline shaders , it Displays Blank Screen. Can any one suggest the reason ?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by Nadro »

How You use arrays in Your shader? Some drivers have problems with access a data from an arrays (thats why fixed pipeline shader builtin Irrlicht OGL ES2 doesn't work properly on some platforms eg. iOS).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

In GLES 2.0 we can access array by replacing fews lines in "COGLES2SLMaterialRenderer.cpp". I found the info here http://irrlicht.sourceforge.net/forum/v ... =1&t=46726.
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

After some Changes successfully implemented Separate Shaders in opengl ES 2.0 . its working well now :-) if any one finds difficult to work with separate shaders in es 2.0 , post your problems , hopefully we can solve it :-)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by Nadro »

I fixed issues with custom shaders in the latest revision (blending and alpha shaders doesn't work). I'll fix and clean up a code in a next days (currently OGL ES2 is my priority). I also prepared example for use custom shaders in iOS app (it may be use also as some irrlicht iOS example, because I included in them all source files + xib files for iPhone and iPad, only XCode proj is missing):
http://www.sendspace.com/file/u98oes

BTW. Remember to add files from "media/Shaders/" to Your iOS project resources group.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
vivekSivamRP
Posts: 66
Joined: Sat Sep 29, 2012 11:58 am

Re: [SOLVED] ogl-es branch, shader driver (2), not renderin

Post by vivekSivamRP »

What do u mean by alpha and blending shaders ?
Post Reply