Confusion on Noise TOP output range

Hello! I’m trying to get an animated Noise TOP with the output range from -1 to 1, but I’m not quite sure how to do that. I’ve set my offset to 0 and my amplitude to 1 which I though would center the noise on 0 and have a max value of 1, but I’m still getting values > 1 and < -1.

What would I do to get the output pixels to be such that the max value is 1 and the min value is -1.


Setting your noise TOP to 8-bit fixed will clamp vals to 0 to 1. You can then use a math TOP to re-range your values -1 to 1 (though you’ll need to change the pixel format to 16 bit or greater. I think that will get you closer to what you’re after here, though you may still see some quantized values.

1 Like

Another solution would be to use LimitTOP which has different options to deal with values going over a limit (clamp, mirror, loop).

1 Like

Thank you both @raganmd and @michelchrome! Using 8 bit values seems to work. I’m using this texture in a GLSL TOP compute shader that is outputting 32 bit color buffers. I just took the 0 to 1 values and mapped it to -1 to 1 in my code. Is there going to be any issue with mixing float precision between 8 bit and 32 bit? Additionally I’m pretty new to Touch, is it typically better to use the Noise TOP as a texture input rather than the built in TDSimplexNoise()? I’m using these noise values for velocity values and my textures are only 32x32. Thanks again!

The one piece to keep in mind is that your values will be slightly quantized in this case.

It’s really up to you here - depending on how you’re sampling your texture you may see some variation, but you can use either technique. The second input of a noise TOP acts as a seed coordinate, so it can be useful to use that mechanic to simply if your shader pipeline, but it’s otherwise a bit of dealer’s choice here.

1 Like