OSL object space

Hello,

I am building some procedural 3d noises (simple cell noise for now) and am struggling to ensure they adhere to object space.

my position source is :

vector SOURCE = vector (“world”, P[0],P[1],P[2])

the noise I use is:
noise(cell, SOURCE, random_Seed, number).

The results work fine, however, they stick to being in world space - which is correct as per the above.

The Problem:
using
vector SOURCE = vector (“object”, P[0],P[1],P[2])
OR
SOURCE = transform(“object”, SOURCE)

results in adjusting scale and position as I would expect - except it does not stick to the object when it is moved.
My current guess is, the cell noise does need some more info or is not truly independent from uvs, which is the direction I am investigating currently.

Does anyone maybe know how I could pin a simple cell noise to my object using a shader, not a texture? Goal is to generate a 3d noise that locks on my object using OSL.

VRay 6, Maya 2020.

Thank you!!

Hello,

Could you share your whole OSL shader? I don’t believe the noise function from the OSL standard library takes that number of parameters. Code like this:
point UVW = transform(“object”, P);
out = noise(“cell”, UVW);

should produce the same noise even when the world coordinates change. I’m not sure if you’re using a helper function, but maybe the random_seed parameter from your example depends on the world coordinates?