Reply To: Projector and Unity

Home Forums Syphon Syphon Implementations – User Projector and Unity Reply To: Projector and Unity

#4603
Brian Chasalow
Participant

Solved- my mistake earlier, it was a bad suggestion to use mainTexture- the Projector shaders use “_ShadowTex” in their shaders instead of _MainTex, so you need to access their textures differently.

First, use the Projector/Multiply or Projector/Light shader. Second, add the Falloff texture to the falloff texture of the shader (just like in the prefab Unity provides)

Then do this:

void Awake ()
{
_texture = new Texture2D(desiredWidth, desiredHeight, TextureFormat.ARGB32, false);
_texture.Apply(false);
Projector proj = gameObject.GetComponent<Projector>();
_texture.wrapMode = TextureWrapMode.Clamp;
proj.material.SetTexture(“_ShadowTex”, _texture);
}

everything else should be the same/ just work.