Author Topic: FOW - Flickering in Linear color space  (Read 3527 times)

GrimmGames

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
FOW - Flickering in Linear color space
« on: May 30, 2014, 11:28:58 PM »
Hi Aren,

I switched the unity color space to linear, and now the FOW asset flickers during startup and during reveals.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: FOW - Flickering in Linear color space
« Reply #1 on: May 31, 2014, 01:28:27 PM »
Yeah, that's to be expected. Linear lighting has a curve on color intensity. Gamma lighting is linear, but linear lighting is curved (as misleading as it sounds).

You can't blend between fading-out textures that aren't using linear values (read: gamma lighting).

As far as I'm aware, Unity didn't provide any way of bypassing linear lighting sampling on textures created at run-time. Only via texture import settings.

GrimmGames

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: FOW - Flickering in Linear color space
« Reply #2 on: May 31, 2014, 02:52:41 PM »
As far as I'm aware, Unity didn't provide any way of bypassing linear lighting sampling on textures created at run-time. Only via texture import settings.

My good friend Lea Hayes just pointed out that there is an additional bool in the Texture2D constructor for linear color space, just after the mipmap bool:

Texture2D(int width, int height, TextureFormat format, bool mipmap, bool linear);

Setting this to true enables the FOW system to work properly in linear color space.

Cheers!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: FOW - Flickering in Linear color space
« Reply #3 on: June 01, 2014, 06:32:56 PM »
Ah, good to know, thanks.