在 vtkGPUVolumeRayCastMapper_HeaderFS.glsl中
vec4 noiseValue=texture2D(noiseTexture,pos.xy*100.0); // with repeat/tiling mode on the noise texture.
pos+=(noiseValue.x)*rayDir;
用途:
// 2D noise texture to jitter the starting point of the ray in order to
// remove patterns when the opacity transfer function make the data on the
// border of the dataset to be visible.
这里的噪声纹理用PerlinNoise
this->NoiseTexture=new float[size*size];
this->NoiseTextureSize=size;
vtkPerlinNoise *noiseGenerator=vtkPerlinNoise::New();
noiseGenerator->SetFrequency(size,1.0,1.0);
noiseGenerator->SetPhase(0.0,0.0,0.0);
noiseGenerator->SetAmplitude(amplitude);