unify StaticBackground.cs not working

Hi,

Found StaticBackground.cs in unify website, got real excited at first!

But the code seems not compatible at all because RenderBeforeQueues has been removed in unity 3

// You can place this directly onto your camera.

using UnityEngine;

[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Static Background")]
public class StaticBackground : MonoBehaviour {
    public Texture2D background;

    [RenderBeforeQueues( 1000 )]
    void OnRenderObject( int queueIndex ) {
        if( background != null )
            Graphics.Blit( background, RenderTexture.active );
    }

}

Is there such a simple and optimal way still with unity 3?

Thanks for your help,

Jean

Hello,

Actually found the way to fix this :)

I am using OnPreRender,

Note that it works as well with OnPreCull but in Unity editor, it covers the whole Game tab including the top bar, Maybe in game, it's actually better to use OnPreCull, but I don't know enough on that, so I will stick to OnPreRender, unless someone explains which one is better.

// You can place this directly onto your camera.

using UnityEngine;

public class StaticBackground : MonoBehaviour {
    public Texture2D background;

    void OnPreRender (){
        if( background != null )
            Graphics.Blit( background, RenderTexture.active );
    }

}

Bye,

Jean