Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by pepperedereppep · Oct 21, 2010 at 12:01 AM · texturematerialimagelightflat

flat material?(no light info)

Hi everyone.. newbie question here.. I'm looking for a "flat" material.. should be easy but I can't find it in unity. basically a material that receives no light/shadow info, only texture... any help is appreciated, thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by IJM · Oct 21, 2010 at 12:09 AM

You can use this shader for that:

Shader "CtrlJ/Unlit" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }
    Category {
       Lighting Off
       ZWrite On
       Cull Back
       SubShader {
            Pass {
               SetTexture [_MainTex] {
                    constantColor [_Color]
                    Combine texture * constant, texture * constant 
                 }
            }
        } 
    }
}
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image pepperedereppep · Oct 25, 2010 at 04:48 AM 0
Share

Thanks. seems to be working.. One more thing, how do I do this to a diffuse transparent shader so that if I have the texture applied, i get the transparency as well? thanks!

avatar image
0
Best Answer

Answer by Jessy · Oct 21, 2010 at 01:59 AM

Do what IJM said, or, if you need no tinting, make it even slightly faster and less complicated:

http://www.unifycommunity.com/wiki/index.php?title=Texture_Only#ShaderLab_-_Texture_Only.shader

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RudyTheDev · Aug 06, 2014 at 12:26 PM 0
Share

Since the site is now dead (and why you copy-paste ins$$anonymous$$d of linking;) ):

 Shader "Texture Only" {
 
 Properties {
     _$$anonymous$$ainTex ("Texture", 2D) = ""
 }
 
 SubShader {Pass {   // iPhone 3GS and later
     GLSLPROGRA$$anonymous$$
     varying mediump vec2 uv;
    
     #ifdef VERTEX
     void main() {
         gl_Position = gl_$$anonymous$$odelViewProjection$$anonymous$$atrix * gl_Vertex;
         uv = gl_$$anonymous$$ultiTexCoord0.xy;
     }
     #endif
    
     #ifdef FRAG$$anonymous$$ENT
     uniform lowp sampler2D _$$anonymous$$ainTex;
     void main() {
         gl_FragColor = texture2D(_$$anonymous$$ainTex, uv);
     }
     #endif     
     ENDGLSL
 }}
 
 SubShader {Pass {   // pre-3GS devices, including the September 2009 8GB iPod touch
     SetTexture[_$$anonymous$$ainTex]
 }}
  
 }
avatar image
0

Answer by Tobbe Olsson · Oct 21, 2010 at 02:06 AM

I use the various particle materials for materials where I don't need any lighting. There's alpha blended, additive, and just plain diffuse. All have tinting though so if you don't need that Jessy's reply is the best...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by vikingfabian-com · Dec 07, 2013 at 09:39 AM

The "CtrlJ/Unlit"-shader worked fine until I used transparent textures. Later found this that is both self-lit, flat and transparent:

 Shader "AlphaSelfIllum" {
     Properties {
         _Color ("Color Tint", Color) = (1,1,1,1)
         _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
     }
     Category {
        Lighting On
        ZWrite Off
        Cull Back
        Blend SrcAlpha OneMinusSrcAlpha
        Tags {Queue=Transparent}
        SubShader {
             Material {
                Emission [_Color]
             }
             Pass {
                SetTexture [_MainTex] {
                       Combine Texture * Primary, Texture * Primary
                 }
             }
         } 
     }
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Add an image to a plane in a prefab hdrp 2021.2.12 1 Answer

dynamic images for textures ar runtime 2 Answers

Repeating Material texture 0 Answers

Set image as material 0 Answers

Rotate Material (Cylinder) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges