Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by javb92 · Aug 26, 2018 at 11:46 PM · shadershadersunlit

How to change this Shader lit to unlit?

hello guys, I have found this awesome shader to rotate the matrix on the material, but I cant figured out how to get this thing in unshade way. what I need to replace or add? I need that the black hole have a rotate texture but in unshade way. alt text here is the shader:

  Shader "Custom/RotateUVs" {
         Properties {
             _MainTex ("Base (RGB)", 2D) = "white" {}
             _Color ("Alpha", Color) = (1,1,1,1)
             _RotationSpeed ("Rotation Speed", Float) = 2.0
         }
         SubShader {
             Tags { "RenderType"="Transparent" "Queue" = "Transparent" }
             LOD 200
          
             CGPROGRAM
             #pragma surface surf Lambert vertex:vert
    
             sampler2D _MainTex;
             float4 _Color;
    
             struct Input {
                 float2 uv_MainTex;
             };
    
             float _RotationSpeed;
  
             void vert (inout appdata_full v) {
                 v.texcoord.xy -=0.5;
                 float s = sin ( _RotationSpeed * _Time );
                 float c = cos ( _RotationSpeed * _Time );
                 float2x2 rotationMatrix = float2x2( c, -s, s, c);
                 rotationMatrix *=0.5;
                 rotationMatrix +=0.5;
                 rotationMatrix = rotationMatrix * 2-1;
                 v.texcoord.xy = mul ( v.texcoord.xy, rotationMatrix );
                 v.texcoord.xy += 0.5;
             }
    
             void surf (Input IN, inout SurfaceOutput o) {
                 half4 c = tex2D (_MainTex, IN.uv_MainTex);
                 o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * 1;
                 o.Albedo *=  _Color.rgb;
                 o.Alpha = _Color.a;
             }
             ENDCG
         }
         FallBack "Diffuse"
     }

thanks in advance guys.

Comment
Add comment · Show 3
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 NoDumbQuestion · Aug 27, 2018 at 01:40 AM 1
Share

go to unity archive. Download Unity default shader. They have unlit-lit shader in those folder.

All you have to do is compare both of these shader code. And figure the that 1 line of code make your shader become unlit.

I know it is related to #pragma surface surf Lambert vertex:vert. But I am not sure what is unlit surface.

avatar image javb92 NoDumbQuestion · Aug 27, 2018 at 02:03 AM 0
Share

yeah, I have tried that, but I cant get it works, I tested with :

  #pragma surface surf NoLighting

and:

 fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
      {
          fixed4 c;
          c.rgb = s.Albedo; 
          c.a = s.Alpha;
          return c;
      }

but I lose the rotation of the shader.

avatar image NoDumbQuestion javb92 · Aug 27, 2018 at 02:10 AM 0
Share

i am sorry it was not about surface. I just skim through unity unlit tutorial.

https://unity3d.com/learn/tutorials/topics/graphics/anatomy-unlit-shader

Try to add their frag and vert function

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by joan_stark · Feb 18, 2021 at 11:06 PM

I don't really know, but where did you find this shader?

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

211 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unlit shader not showing color in main preview 0 Answers

How to Change the Shader Color? 0 Answers

A problem with a shader to make a window transparent 0 Answers

Getting Color Generated from Shader to Script to Shader 0 Answers

Volumetric Light with VR in URP have a weird clipping... Any ideas? 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