Author Topic: Change shader's default texture to "black"  (Read 5773 times)

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Change shader's default texture to "black"
« on: November 29, 2013, 04:37:25 AM »
Hey Aren,

could you change the default texture of your shader's to "black"? When I load my shop UI I have a lot of UITexture widgets representing thumbnails. I assign the corresponding textures dynamically at runtime and because I don't want the user have to wait until every thumbnail is loaded, I display the widgets immediately. Now because the default shader texture is "white" you can see a white square that later changes to the correct texture.

With the default texture is "black" this won't happen.

  1. _MainTex ("Base (RGB), Alpha (A)", 2D) = "black" {}

PS: I could disable/enable the widgets when loaded but hey, why the hazzle when it could be that easy ;)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Change shader's default texture to "black"
« Reply #1 on: November 29, 2013, 09:09:07 AM »
Hmm... good point. I wonder if someone will complain if I do that though...

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Change shader's default texture to "black"
« Reply #2 on: November 29, 2013, 09:16:49 AM »
How does that solve the problem? Won't it just be a black square that changes to the right texture?

You should have a placeholder texture that you use until the right one is downloaded, then there's not problem and you have complete control.

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Change shader's default texture to "black"
« Reply #3 on: November 29, 2013, 09:17:35 AM »
Nope, black is rendered totally transparent.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Change shader's default texture to "black"
« Reply #4 on: November 29, 2013, 09:23:40 AM »
"black" seems to imply (0, 0, 0, 0).

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Change shader's default texture to "black"
« Reply #5 on: November 29, 2013, 09:34:52 AM »
Dammit, Color-class, alpha 0 is not black! :)

Asse

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: Change shader's default texture to "black"
« Reply #6 on: November 29, 2013, 09:36:54 AM »
They may have named it transparent but I tried - that didn't work  ;)