Page 1 of 1

[gles2] [MyGUI] [decal pass] [tex_address_mode wrap] SOLVED

Posted: Thu Nov 27, 2014 11:41 pm
by nero81af
Dear ogre community,

I'm trying a multipass material with ambient, per_light and decal pass. The glsl version of the shaders are working perfectly. The mesh shaded is a simple plane with parallax map and two shadow maps (two spot lights). The plane is created with ogre and I'm tiling uv maps (16 repetitions in u and 16 in v). The problem is that the decal pass is ignoring the wrap directive on material. Also the normal map in the per_light pass is correctly wrapped. Is this a known bug?

thanks everyone for helping me out!!

p.s.
using a singlepass material and only one light / shadow map everything works perfectly. Also the normal map in the per_light pass is correctly wrapped.

Re: [gles2] [decal pass] [tex_address_mode wrap] bug

Posted: Fri Nov 28, 2014 8:36 pm
by nero81af
I've tried out many systems (iphone android) including emulators and all give me the same behaviour. I'm quite sure it's a bug of the gles2 render system. Where texture parameters are passed to the decal pass? can be the StateCacheManager causing this? is there a way to force tex_address_mode via code to the decal pass of a technique? is there some platform specific behaviour I should check out?

Re: [gles2] [decal pass] [tex_address_mode wrap] bug

Posted: Fri Nov 28, 2014 8:50 pm
by spacegaier
Can you please create a JIRA ticket for the bug complete with an easy example to reproduce (materials, shader, etc.). Thank you.

Re: [gles2] [decal pass] [tex_address_mode wrap] bug

Posted: Fri Nov 28, 2014 11:52 pm
by nero81af
ok! I'll try to

Re: [gles2] [decal pass] [tex_address_mode wrap] bug

Posted: Sat Nov 29, 2014 9:28 am
by nero81af
I could not create a simple example without including the specific case of my project. Btw I found out where the problem is. It's the state cache. If I force texture addressing without using the cache the problem seems solved. I'll try to understand why that happens and eventually submit a patch

Re: [gles2] [decal pass] [tex_address_mode wrap] bug

Posted: Tue Dec 02, 2014 12:41 am
by nero81af
Finally I've found out. The problem is a mix of state cache and MyGUI. Actually MyGUI is doing something that messes up with last object rendered which has a decal pass. What is happening is that mygui is clamping a texture ogre is using. I could not found out exactly why but simply disabling all texture units (instead of all but the first) in the begin() method of MyGUI OgreRenderManager line 490. So commenting out

mRenderSystem->_disableTextureUnitsFrom(1);

and adding before initializing texture settings

mRenderSystem->_disableTextureUnitsFrom(0);

solved the problem, so no ogre bug! :D