- Home /
I found the problem.
One of the noises is more or less static and due to different initial sampling points, we get varying results.
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)
You know that you can link external sources? Also when copying licensed code you have to include the license information. The code is under an $$anonymous$$IT license. It's now allowed to redistribute it without the copyright and license information. I removed the code from your question and added a link to the repository which seems to be the source. If it's not the source, feel free to edit your question. However you should only include relevant information
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.
All objects have the exact same position, rotation and parameters.
$$anonymous$$y only lead is that a difference in fps may produce different results.
Follow this Question
Related Questions
Help with a see-through shader 0 Answers
How to manipulate a shader's alpha channel while using a texture? 1 Answer
shadertoy to unity,Shadertoy to unity 0 Answers
Shader - What is float3.xy? 1 Answer
How to Fade out Custom Unity Shader ? 0 Answers