![]() O.grabUV = ComputeGrabScreenPos(o.vertex) įixed4 texcol = tex2Dproj(_BackgroundTexture, i.grabUV) Of course, unless I'm mistaken Unity doesn't even allow enormously large textures anyway. However, I don't know how Unity handles all of this stuff. ![]() O.vertex = UnityObjectToClipPos(v.vertex) Most PC systems these days have 4GB to 8GB of memory, so it is hardly a problem even if you have tons of sprites and resources in memory. Shader "Unit圓dTips/GrayscaleTransparent" If you want certain objects to ignore the grayscale effect too you can just render them in front of the mask overlay. Make sure the depth layer of the grayscale texture is higher than the other textures you’re wanting to be affected. If you’re using NGUI create a UI Texture as the overlay texture and set the shader to the grayscale shader. Save the shader below and if you’re using Unity Canvas add a custom material using the shader to your sprite renderer. Grayscale shader example with a square sprite on NGUI (Next Generation UI) Try the grayscale shader yourself! Set the material of a Unity Canvas sprite renderer or NGUI UITexture to this shader and everything with a lower depth index will be rendered in grayscale (black and white). This Unity grayscale shader allows everything behind an object mask be rendered in grayscale.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |