2 Octave 3D Noise Vertex Shader Demo

For Nvidia owners:
http://www.pocketmoon.com/3dnoise.zip

Based on Nvidia’s vnoise demo, I’ve squeezed two octaves of 3D noise into an 118 instruction Vertex Shader (noise.vp)

It’s animated (moves through noise space in the y direction) and you can select different objects by using the keys 1,2,3…

I like the BLOB (object 1). It reminds me of a recurring nightmare I used to have when I was ill as a child!!!

Let me know if it works for you.

Cheers

Rob J.

Yeah it works, but theres probably more efficient ways of creating the same effect. What can you do with it, that really makes use of the power needed to compute that?

Nutty

you surprise me nutty! It interests me to do it.

Also lets just say I wanted to do better than the Nvidia guy who wrote the original

Rob

Wow, that is really cool Thanks for posting it.

– Zeno

I’m not knocking it, nice to see ppl try and improve stuff. Just we know it’s quite expensive to compute, and was wondering what you’d actually use it for?

When I make it animate, a black ball moves slowly away from me and then when it’s real small it starts to do its thing…which looks like a blob thats trying to give birth to something.

I have a GeForce2

[This message has been edited by WhatEver (edited 06-08-2002).]

WhatEver - there’s a bug in the original code when you turn animation on!

It should be auto-animated anyway.
You can move the viewpoint around and zoom in/out with the mouse and combinations of ctrl/shift …

Nutty - It’s proved a very valuable excersise! My heavily optimised C Perlin Noise code, which I use in the Procedural Planet (and other) demo’s, now appears bloated compared to my 50 instruction Vertex Shader code. I shall now be re-visiting my C code soon! Anyway, who’s to say that at the end of the day my procedural planet has more GPU free than CPU and therefore can spare a few shaders to get a nice ocean

Yeah, I admit it, Rob - you’re a better vertex shader coder than me! If you were calculating the normals as well, then maybe I’d be impressed

And if you guys think vertex shader Perlin noise is pointless, you should see some of the stuff they don’t let me release!

Sound synthesis or data encryption vertex shaders, anyone?

Originally posted by pocketmoon:
[b]
Also lets just say I wanted to do better than the Nvidia guy who wrote the original

Rob

[/b]

Simon! Excellent, your first Post

I was hoping you’d read the post and respond - it’s always great to get the pro’s involved here.

Originally posted by simongreen:
Yeah, I admit it, Rob - you’re a better vertex shader coder than me! If you were calculating the normals as well, then maybe I’d be impressed

I put it down to age and experience. My first experience of hardware rendering was dragging a screwdriver across the board of a TRS-80 and watching the screen corrupt… though I’m sure you’d easily win a vertex shader shootout.

Oh and I’ll have the normals in there by wednesday

Maybe Nvidia should have a Obfuscated Vertex Shader contest!

Originally posted by pocketmoon:
Maybe Nvidia should have a Obfuscated Vertex Shader contest!

that again lets me think about how well the extensions of nvidia are designed. its quite easy to get obfuscated code without doing anything bad, not important if registercombiners or vertexshaders… /methinks the ext-design is not THAT well done

don’t look at my registercombinerssetup for perpixelbumpmappedselfshadowedinclfakedspecularlightinginonepass (with only 2 general combiners, i have a gf2 only…). THAT is obfuscated

Originally posted by simongreen:
If you were calculating the normals as well, then maybe I’d be impressed

Ok It’s wednesday

I have two octaves of 3D pseudo perlin noise with the normals derived from the weighted sum of the surface normals of both octaves together with a final diffuse lighting calc all in 127 instructions.

I’m calculating the noise surface normal by doing two more sets of lattice value interpolation (for each octave), one offset by a small x amount, the other by a small y amount (K.A. Forward Differencing ?)

In effect caculating:
X = noise(x+dx, y, z)
Z = noise(x,y,z+dz)

and normalising the vector
(X,1,Z) to get the apprix surface normal.

By interpolating between Y/Y+1 first you only have to repeat the last two stages of the interpolations (X/X+1 & Z/Z+1) and you can do both dx and dz calculations at the same time by some fiendish swizzling!

All I have to do is test it when I get home!

VP Source and a demo later if it works. A grivelling retraction later if it doesn’t.

ta ta

Rob J.

http://www.pocketmoon.com/3dnoise.zip

As promised

you can submit this to nvidia. as far as i know they haven’t yet implemented the noise function for cg… but i would suggest you to write an optimized one-octave one… as else you would fill up the power of a gf3/4 with just one instruction in the cg

I saw this, and thought of you, pocketmoon: http://www.flipcode.com/cgi-bin/msg.cgi?showThread=07-15-2002&forum=iotd&id=-1

cheers, knackered, i’ll check it out.

I laughed when Cg was launched - I’d like to see someone try and get Cg to compile an equivalent shader down to 128 instructions