Author Topic: 3D 'Prefab Toolbar' Snapshots always show up grey?  (Read 5278 times)

Talsidor

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 4
  • Lead Programmer at CardboardKeep.com
    • View Profile
    • Cardboard Keep
3D 'Prefab Toolbar' Snapshots always show up grey?
« on: June 01, 2014, 09:27:07 PM »
Hey everyone,

I've created a few prefab toolbar entries for 3D objects, and set up custom snapshot points for them, but all the snapshots show up as the level's skybox with a greyed out sillouhette of the object's mesh over the top.
I turned off fog and adjusted level lighting, but they made no difference to the snapshot. Any suggestions?
The attached image demonstrates the issue.

Thanks :)
Lead Programmer, Cardboard Keep

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #1 on: June 02, 2014, 11:30:58 PM »
What shader is used by the object? Transparent shaders write to alpha, and generally should not be mixed with render textures due to how Unity works.

Talsidor

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 4
  • Lead Programmer at CardboardKeep.com
    • View Profile
    • Cardboard Keep
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #2 on: June 03, 2014, 02:18:44 AM »
What shader is used by the object? Transparent shaders write to alpha, and generally should not be mixed with render textures due to how Unity works.
Hi Aren,
The object is using the built-in Unity toon shader. No transparency.
Lead Programmer, Cardboard Keep

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #3 on: June 04, 2014, 01:58:01 AM »
Unity doesn't have a built-in toon shader... And the fact that it doesn't have transparency doesn't mean that the shader isn't using the alpha channel for something.

For example the default diffuse shader that comes with Unity uses the alpha channel to specify "glow" areas (legacy glow system that hasn't been used in years), resulting in all objects coming out semi-transparent when rendered into a texture.

Talsidor

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 4
  • Lead Programmer at CardboardKeep.com
    • View Profile
    • Cardboard Keep
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #4 on: June 04, 2014, 02:02:34 AM »
Sorry, by built-in I mean it's a Standard Asset, in the Toon Shading package. Looking at the shader it seems to just set the alpha to 0, could that be causing it?
Lead Programmer, Cardboard Keep

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #5 on: June 04, 2014, 02:29:33 AM »
Yup, that would do it. It writes to the alpha channel, and marks it as zero, thus resulting in a fully transparent set of pixels that still write to depth. Change it to 1.

Talsidor

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 4
  • Lead Programmer at CardboardKeep.com
    • View Profile
    • Cardboard Keep
Re: 3D 'Prefab Toolbar' Snapshots always show up grey?
« Reply #6 on: June 04, 2014, 08:58:13 PM »
Yep working great now. Thanks  :)
Lead Programmer, Cardboard Keep