View Single Post
Old 24th August 2011, 19:32   #2
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 868
Hi Psyne

MD has three predefined noise textures: sampler_noise_lq, _mq, and _hq.
Call them like this

ret = tex2D (sampler_noise_hq,uv);

As sampler_main, they can be called using the modifiers _pc_, _pw_, _fw_ and _fc_ which affect the smoothing and folding. Example

ret = tex2D (sampler_pw_noise_lq,uv);

The default is _fw_, to use the other versions you need to specify them in the shader header first

sampler sampler_pw_noise_lq;

Custom texture is simply a picture, jpg or pcx or whatever formats are supported. You need to define it in the header first

sampler sampler_mypicture;

and can then use it within the shader body by

ret = tex2D (sampler_mypicture, uv);

Normally the picture will not have the same aspect ratio as your screen so you'll may want to adjust this as specified in the authoring guide.

Martin
Nitorami is offline   Reply With Quote