# Cg noise() function?

**URL:** https://discussions.unity.com/t/cg-noise-function/394387
**Category:** Shaders & Materials
**Tags:** Shaders
**Created:** [July 4, 2009, 3:13am UTC](https://discussions.unity.com/t/cg-noise-function/394387 "2009-07-04T03:13:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![God-at-play](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/god-at-play/32/208129_2.png) [@God-at-play](https://discussions.unity.com/u/God-at-play)
#### Post date: [July 4, 2009, 3:13am UTC](https://discussions.unity.com/t/cg-noise-function/394387/1 "2009-07-04T03:13:38Z")

</div>

I’m trying to code a jittering effect in a vertex shader instead of using a script, which I’m currently using already. The goal is to offset each vertex by some randomly set amount every frame.

Looking at the functions in the Cg standard library, there’s a noise function that I could use like this:

```auto
v.vertex.xyz += noise(_Time) * _NoiseAmount;

```

But that isn’t working. Is noise() not supported? Is there another way to do this in a vertex shader?

---

<div class="post-metadata">

### Author: ![shawn\_1](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/shawn_1/32/376429_2.png) [@shawn\_1](https://discussions.unity.com/u/shawn_1)
#### Post date: [July 5, 2009, 6:08pm UTC](https://discussions.unity.com/t/cg-noise-function/394387/2 "2009-07-05T18:08:41Z")

</div>

If I recall correctly, noise does not work. When I need noise I just make a noise texture and sample that.

---

<div class="post-metadata">

### Author: ![anon\_52864273](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@anon\_52864273](https://discussions.unity.com/u/anon_52864273)
#### Post date: [July 12, 2009, 8:33pm UTC](https://discussions.unity.com/t/cg-noise-function/394387/3 "2009-07-12T20:33:43Z")

</div>

You can try playing with sin/tan it’s not random,  
but sometimes it looks even better.
