• 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 /
This question was closed Feb 06, 2018 at 06:14 PM by Oruji for the following reason:

I found the problem.

One of the noises is more or less static and due to different initial sampling points, we get varying results.

avatar image
0
Question by Oruji · Feb 06, 2018 at 09:34 PM · shadershader programmingshaderlab

Vertex Noise Shader Mismatch on Different Computers

We have a fragment shader with three noises. It produces the results we are after when we tweak it on one computer, but the same parameters behave differently on another computer. We cannot figure out why the results differ. The mismatch is quite big. The noise is about 100% stronger on one computer.

What in the shader could be causing this discrepancy? The scenes are near identical.

Any input is appreciated. Thanks.

 v2f vert(appdata_t v)
 {
     v2f o;
     o.vertex = UnityObjectToClipPos(v.vertex);

     float4 worldPos = mul (unity_ObjectToWorld, v.vertex);

     float noise_a  =  _NoiseAAmount *  snoise(worldPos.xy * _NoiseAFrequency + float2(_Time.x * _NoiseATimeScale, 0));
     float noise_b  =  _NoiseBAmount *  snoise(worldPos.xy * _NoiseBFrequency + float2(_Time.x * _NoiseBTimeScale, 0));
     float noise_c =    _NoiseCAmount*clamp(snoise(worldPos.xy * _NoiseCFrequency + float2(_Time.x * _NoiseCTimeScale, 0) ), 0, 0.75);

     noise_a = (noise_c) * noise_a;
     noise_b = noise_b*(noise_a/_NoiseC);
     o.vertex.x += noise_a + noise_b;

     o.color = v.color;
     o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
     return o;
 }`

`

Snoise:

edit (removed code for snoise, added link)

SimplexNoise2D.hlsl

Comment
Add comment · Show 5
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 Oruji · Feb 06, 2018 at 04:07 PM 0
Share

snoise is from SimplexNoise2D.hlsl

Show more comments
avatar image Bunny83 · Feb 06, 2018 at 04:23 PM 0
Share

Uhm, the noise depends on the worldspace positions of the vertices. So if you have the exact same object at the exact same position, rotation and scale and using the exact same parameters for the material you should get the same output. However if the object is only moved or rotated slightly the result might look completely different. You may want to include a screen shot or a short video of the two different results.

Show more comments

0 Replies

  • Sort: 

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

121 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

Related Questions

'UnityObjectToClipPos': cannot implicitly convert from 'float4x4' to 'float4'? 1 Answer

Shader inverts uv map only once, how to fix it? 0 Answers

How to adapt this shader into a transparent one (alpha blend) 0 Answers

I need help upgrading a shader script to be compatible with URP. 0 Answers

How to remove a color from texture using 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