Unity 3.0 - Image Effects

Hey, all,

I’m trying to script the use of image effects, but it doesn’t seem to be going my way.

If I try to use something like this:

     public GrayscaleEffect GSEffect;

     void Start()
     {
          GSEffect = Camera.main.gameObject.GetComponent (typeof (GrayscaleEffect)) as GrayscaleEffect;
     }

     void Update()
     {
          GSEffect.active = false;
     }

The camera goes entirely blank. All I want to do is to be able to turn the effect on and off?

Anyone have any ideas?

Cheers,

SB

I don’t think Unity iPhone supports them. At least it didn’t in 2, not sure about 3.

License feature comparison.

It does support them. Just need to sort out how to turn them off…

iPhone Pro indeed has now render textures.

But quite some of these shaders are a horrible idea to directly use. they are autoupgraded for the surface shader system and for the idevices you might want to use glsl and write optimized idevice shaders instead of relyong on the surface shader + cg → glsl conversion and the performance of the resulting shaders

I see the glsl page in the ShaderLab reference manual but I don’t see any actual examples. Are there any?

dreamora, thanks for that tip - I didn’t realize it was coming in U3 but it does indeed work :smile:

Sweet

I think there are a small handfull on the unify wiki and similar.

The official docs are cg focused, I think that state unhappily even holds for U3 iphone (for unity 1.x it was of no impact as it does not offer programmable pipeline support)

@S7ARBVCK and Dreamora

Sweet! Didn’t realize that, haven’t played with the iPhone stuff in the beta. Guess there’s another reason to upgrade my iPhone license.

What happens if you set the component’s enabled variable to false?

Yeah, I think it is the enabled component you need to be setting not the active.

Regards,
Matt.