www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: lawless_c on July 24, 2015, 01:13:15 am

Title: shaders and OnResume()
Post by: lawless_c on July 24, 2015, 01:13:15 am
I've been having a problem for a while now with glsl shaders and OnResume().
Upon leaving my app to check something else i found the shaders would lose certain important data such as a colour value , what i would end up with
are shaders that instead of fading to the colour i wanted simply faded to black.

Simple fix i found was to use setUniform instead of setStaticUniform in my renderhooks.

Just thought i would let you all know as i was only able mention of similar problems involving textures and onresume but not shaders.
Title: Re: shaders and OnResume()
Post by: EgonOlsen on July 24, 2015, 07:35:11 am
Yes, that's normal behaviour. On a context loss, the shaders are losing all their data. So either use setUniform or recall setStaticUniform after the restart.
Title: Re: shaders and OnResume()
Post by: EgonOlsen on July 24, 2015, 07:37:58 am
...I should add this to the documentation, I guess.