how to convert - i.uv.xyz - into discrete X, Y, Z values?

I have a function

			float noise3d(float3 p, int octaves)
			{
				float freq = _Frequency, amp = 0.5;
				float sum = 0;	
				for(int i = 0; i < octaves; i++) 
				{
					sum += inoise(p * freq) * amp;
					freq *= _Lacunarity;
					amp *= _Gain;
				}
				return sum;
			}

I wish to use different proportions on XYZ axes, different multipliers, so I need to access them individually.
this is okay:

	float n = noise3d(i.uv.xyz, 4);

When I write the function like this doesn’t work:

float n = noise3d(i.uv.x, i.uv.y, i.uv.z, 2);

what do I need to do?

Atleast your noise function takes float3 parameter, instead of 3 separate floats…

this should accept it:

float noise3d(float px, float py, float pz, int octaves)

or instead, just use:

float n = noise3d(float3(i.uv.x, i.uv.y, i.uv.z), 2);

thank you so much I thought I had tried option 2 and I forgot a comma :slight_smile:

the experiment went okay except that now there is a seam, so I have to find an equivalent of world.transformpoint for the shader? is that possible, would I have to change the noise equations themselves? ok i see this, Cg Programming/Unity/Shading in World Space - Wikibooks, open books for an open world
so I have coded this line float3 worldPos = mul (_Object2World, i.uv).xyz;
it working :smile: … sorry shaders are very scary and difficult :stuck_out_tongue: