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 mrgohut · Sep 15, 2014 at 08:32 PM · errorshadersnow

ats Snow Suite - problem with DX11

I imported ats Snow Suite which works perfectly without DX11, but when i turn on DX11 option everything change color to pink except trees and grass, i have this error in shader:

incorrect number of arguments to numeric-type constructor

this lane:

 o.Gloss = half(snowAmount*(1-snowtex.rgb));

and this is all shader:

 Shader "snowShader Bumped Diffuse" {
 Properties {
     _Color ("Main Color", Color) = (1,1,1,1)
     _MainTex ("Base (RGB)", 2D) = "white" {}
     _BumpMap ("Normalmap", 2D) = "bump" {}
 }
 
 SubShader {
     Tags { "RenderType"="Opaque" }
     LOD 300
 
 CGPROGRAM
 #pragma surface surf Lambert vertex:snow
 #pragma exclude_renderers flash
 //#pragma target 3.0
 
 
 sampler2D _MainTex;
 sampler2D _SnowTex;
 sampler2D _BumpMap;
 fixed4 _Color;
 
 float _snowShininess;
 float _SnowAmount;
 float _SnowStartHeight;
 sampler2D _SnowTexture;
 
 struct Input {
     float2 uv_MainTex;
     float2 uv_BumpMap;
     fixed4 color : COLOR;
     float3 worldPos;
     fixed3 MyWorldNormal;
 };
 
 
 void snow (inout appdata_full v, out Input o) {    
     o.MyWorldNormal = normalize(mul((float3x3)_Object2World, v.normal));
 }
 
 
 void surf (Input IN, inout SurfaceOutput o) {
 
     fixed4 col = tex2D(_MainTex, IN.uv_MainTex) * _Color;
     fixed4 snow = tex2D(_SnowTex, IN.uv_MainTex);
     o.Alpha = col.a;
     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
     
     // get snow texture // distribution might be stored in alpha
     half4 snowtex = tex2D( _SnowTexture, IN.uv_MainTex);
     
     // clamp(IN.MyWorldNormal.y + 0.6, 0, 1) = allows snow even on orthogonal surfaces // (1-col.b) = take the blue channel to get some kind of heightmap
     float snowAmount = (_SnowAmount * (clamp(IN.MyWorldNormal.y + 0.6, 0, 1)) * (1-col.b) *.8 + clamp(o.Normal.y, 0, 1) * _SnowAmount * .25);
 
     // clamp snow to _SnowStartHeight
     snowAmount = snowAmount * clamp((IN.worldPos.y - _SnowStartHeight)*.0125, 0, 1);
     
     // sharpen snow mask
     snowAmount = clamp(pow(snowAmount,6)*256, 0, 1);
     
     o.Alpha = 0.0;    
 
     // mix 
     o.Albedo = col.rgb * (1-snowAmount) + snowtex.rgb*snowAmount;
     o.Gloss = half(snowAmount*(1-snowtex.rgb));
     o.Specular = _snowShininess;
     
     // smooth normal
     o.Normal = normalize(lerp(o.Normal, float3(0,0,1), snowAmount*.50));
     
 }
 ENDCG  
 }
 
 FallBack "Diffuse"
 }
 

what's wrong ? ;/

Comment
Add comment · Show 4
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 mrgohut · Sep 17, 2014 at 09:59 AM 0
Share

nothing ?

avatar image TomKamin · Oct 22, 2014 at 04:15 PM 0
Share

I have that problem even when i have DX11 off :-(

avatar image AntonJG · Jul 20, 2015 at 12:44 PM 0
Share

I have this error!

Did you find a fix/work around??

avatar image Annick · Sep 02, 2015 at 09:37 AM 0
Share

I have the same problem all objects are kind of purple/pink. I thought its because of my newer Unity version. Does someone figure out why it isnt working?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jessespike · Sep 02, 2015 at 05:05 PM

Provide the correct number of arguments as the error suggests:

  o.Gloss = snowAmount*(1-snowtex.rgb);

After doing that, you'll get another error:

'snow': output parameter 'o' not completely initialized.

So initialize the output:

  void snow (inout appdata_full v, out Input o) {    
        UNITY_INITIALIZE_OUTPUT(Input, o);

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Raycasting in script suddenly stopped working 1 Answer

Shader compiler error - failed to read correct magic number 2 Answers

Errors with ENDCG in shaders 1 Answer

Parse Error on OutlinedDiffuse Shader 0 Answers

Shader error in ... : Syntax error at line 30 1 Answer


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