Author Topic: shaders and OnResume()  (Read 2001 times)

Offline lawless_c

  • int
  • **
  • Posts: 96
    • View Profile
shaders and OnResume()
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shaders and OnResume()
« Reply #1 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shaders and OnResume()
« Reply #2 on: July 24, 2015, 07:37:58 am »
...I should add this to the documentation, I guess.