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 Earlybird · May 01, 2015 at 09:12 AM · unity 5shadersurface shadersplatmap

Splat Map shader no longer working in Unity 5

Hi we have a shader for our terrain splat maps that is no longer working even though it worked fine in Unity 4?

Here is the shader and the error we're getting: Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 16 (on )

I know that the issue is related to it trying to pass too many textures but i dont understand why this is now a problem and how best to correct this?

Any advice would be warmly welcome :)

 Properties {
     _Splat0 ("Layer 1", 2D) = "white" {}
     _Splat1 ("Layer 2", 2D) = "white" {}
     _Splat2 ("Layer 3", 2D) = "white" {}
     _Splat3 ("Layer 4", 2D) = "white" {}
     _Control ("Control (RGBA)", 2D) = "white" {}
 }
                 
 SubShader {
     Tags {"RenderType" = "Opaque"}
     
 CGPROGRAM
 #pragma surface surf Lambert 
 #pragma exclude_renderers xbox360 ps3
 #pragma target 3.0
 
 struct Input {
     float2 uv_Control;
     float2 uv_Splat0;
     float2 uv_Splat1;
     float2 uv_Splat2;
     float2 uv_Splat3;
 };
  
 sampler2D _Control,_Splat0,_Splat1,_Splat2,_Splat3;
  
 void surf (Input IN, inout SurfaceOutput o) {
     fixed4 splat_control = tex2D (_Control, IN.uv_Control).rgba;
         
     fixed3 lay1 = tex2D (_Splat0, IN.uv_Splat0) * splat_control.r;
     fixed3 lay2 = tex2D (_Splat1, IN.uv_Splat1) * splat_control.g;
     fixed3 lay3 = tex2D (_Splat2, IN.uv_Splat2) * splat_control.b;
     fixed3 lay4 = tex2D (_Splat3, IN.uv_Splat3) * splat_control.a;
     //o.Alpha = 0;
     o.Albedo.rgb = lay1 + lay2 + lay3 + lay4;
 }
 ENDCG 
 }
 Fallback "Diffuse"
 }
Comment
Add comment · Show 2
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 Earlybird · May 01, 2015 at 09:53 AM 0
Share

adding "nolightmap" after the Lambert lighting setup seems to fix it but im not sure what this is doing? I am still seeing shadows which is good but I would prefer to understand what im disabling? Is this related to baked lighting like a beast light map?

avatar image Tomi-Tukiainen · Jan 27, 2016 at 05:46 AM 0
Share

Hi, did you ever find a workaround? I have the same problem but adding "nolightmap" will cause shadows disappear. Our game is for mobile so I'd like to avoid changing the shader model. Thanks!

1 Reply

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

Answer by ApeRage · Jun 24, 2015 at 10:42 AM

The shader model you are using won't support that many UV maps. Change #pragma target 3.0 to #pragma target 4.0

Shader model 4 is only supported by DirectX 11, ps4, and xboxOne though. Here is the link the info. http://docs.unity3d.com/Manual/SL-ShaderPrograms.html

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 Earlybird · Jun 29, 2015 at 02:18 PM 0
Share

this does work but the actual issue is that the GI function within the new standard shaders light rig is using additional texture interpolators compared to the legacy shaders from unity 4.

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

21 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

Related Questions

Control cubemap reflection amount from metallic and smoothness properties 0 Answers

Multipass Surface Shader with _CameraDepthNormalsTexture 0 Answers

Unlit terrain shader 0 Answers

Simple cartoon water shader shoreline 1 Answer

Transparent shadow in surface shader 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