Author Topic: Textures over other textures have display issues  (Read 2710 times)

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Textures over other textures have display issues
« on: July 19, 2013, 04:04:20 PM »
Hello,

I have these textures and I attached UIButtonScale script to them so they look nice when I hover mouse pointer over them.
The problem is, that once they return to the initial size, they remove the drawing of the backgound texture.
I tried changing the depth with Z so that the scaling textures are closer to the map than the background texture. It didn't matter. Problem persisted.

This problem also moves to one panel to another after that.

Here is a pic :

« Last Edit: July 19, 2013, 04:48:33 PM by primus88 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Textures over other textures have display issues
« Reply #1 on: July 19, 2013, 06:52:10 PM »
To understand what's happening, tilt your scene view camera. You will then be able to tell which widgets get grouped together, which will hopefully cue you in as to why you're running into this issue.

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: Textures over other textures have display issues
« Reply #2 on: July 20, 2013, 02:36:53 AM »
It seems that when changing the scene, the GUI does not reset. It remembers were previous textures were and somehow keeps that part of the screen clear, not allowing new textures to appear. Anyway to reset the GUI or something ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Textures over other textures have display issues
« Reply #3 on: July 20, 2013, 03:54:39 AM »
Sounds like you are using 'depth pass' option on your panel for some reason -- turn that off. Also make sure that your UI camera clears depth.

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: Textures over other textures have display issues
« Reply #4 on: July 21, 2013, 08:28:14 AM »
I have only the panel tool option selected. Nothing else.

You can check it's behavior here :
https://dl.dropboxusercontent.com/u/180942420/PublicHoarder/HoarderWeb.html

It does this GUI problem only in webplayer and editor. If I make standalone build it work ok.

Very important, if resize the player window while the game is working, the GUI refreshes and looks ok.
For the UIRoot I have the following settings :

Scaling style : Pixel Perfect
Manual height 900
Minimum Height 900
Maximum Height 900
« Last Edit: July 21, 2013, 08:54:23 AM by primus88 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Textures over other textures have display issues
« Reply #5 on: July 22, 2013, 05:03:02 AM »
Not sure what to look at there. It's a single main menu screen with some text and clicking stuff does nothing.

As I said, double check the clear settings on your cameras. There MUST be a camera that clears color as the first thing to be drawn (this also clears depth). The second camera to draw (the UI camera) must be set to clear depth only.

You also have to make sure that you never scale things to/from scale of 0.

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: Textures over other textures have display issues
« Reply #6 on: July 22, 2013, 07:18:30 AM »
Sorry but I don't quite understand what drawing and clearing depth by camera means.

EDIT : Is this what you ment ?

Culling Mask

The Culling Mask is used for selectively rendering groups of objects using Layers. More information on using layers can be found here.

Commonly, it is good practice to put your User Interface on a different layer, then render it by itself with a separate Camera set to render the UI layer by itself.

In order for the UI to display on top of the other Camera views, you'll also need to set the Clear Flags to Depth only and make sure that the UI Camera's Depth is higher than the other Cameras

primus88

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 50
    • View Profile
Re: Textures over other textures have display issues
« Reply #7 on: July 22, 2013, 11:14:07 AM »
Wow!
Changing that little flag clear from Don't clear to Depth only made the entire difference.

Sometimes, the smallest thing makes the biggest difference.

Thanks for the help!