Old 17th February 2008, 20:00   #1
Soo88
Junior Member
 
Join Date: Feb 2008
Posts: 3
Using textures?

Could anyone tell me how to load, and move a texture?
I put the file into the textures map, and it's called Billy.jpg.

Also, how can i move it around?

Thanks in advance!
Soo88 is offline   Reply With Quote
Old 18th February 2008, 00:47   #2
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
hey, have a look into the manual
code:

sampler sampler_billy;
shader{
ret = tex2D(sampler_billy, uv);
}


this is the way to load and display your texture (stretched).
if you multiply the uv vector by texsize.xy*texsize_billy.zw

code:
ret = tex2D(sampler_billy, 0.5 + (uv-0.5)*texsize.xy*texsize_billy.zw);


your texture should be scaled to its original size.

now just add a float2(offsetx,offsety) to move it around.
Moreover you can pass these values via the q1-q32 variables from the per-frame code to the shader.

code:
ret = tex2D(sampler_billy, 0.5 + (uv-0.5)*texsize.xy*texsize_billy.zw + _qa.xy);

(with q1 = offset_x and q2 = offset_y in the per-frame code)

and as a little homework... go figure out the difference between
sampler_fc_billy,
sampler_fw_billy,
sampler_pc_billy &
sampler_pw_billy


(do you incidentally try kidding me? - the examples in the preset authoring guide are not just by accident also with "billy" or what?)

Last edited by Flexi; 18th February 2008 at 01:08.
Flexi is offline   Reply With Quote
Old 18th February 2008, 12:37   #3
Soo88
Junior Member
 
Join Date: Feb 2008
Posts: 3
yeah, i was trying to use the manual, but i didn't really understand it :P

The texture still doesn't seem to show up. This is what i've got now.

code:

[preset00]
sampler sampler_billy;
shader{ret = tex2D(sampler_billy, uv);}
ret = tex2D(sampler_billy, 0.5 + (uv-0.5)*texsize.xy*texsize_billy.zw);

Soo88 is offline   Reply With Quote
Old 18th February 2008, 15:02   #4
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
...
code:

sampler sampler_billy;
shader{
ret = tex2D(sampler_billy, 0.5 + (uv-0.5)*texsize.xy*texsize_billy.zw);
}


the ret expressions were ment to be replaced.
Flexi is offline   Reply With Quote
Old 18th February 2008, 18:19   #5
Soo88
Junior Member
 
Join Date: Feb 2008
Posts: 3
Could you maybe point me to an example of a preset that uses textures?

Thanks!
Soo88 is offline   Reply With Quote
Old 18th February 2008, 18:53   #6
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
Attached Files
File Type: milk texture demo.milk (11.3 KB, 439 views)
Flexi is offline   Reply With Quote
Old 21st February 2008, 06:28   #7
Zylot
Major Dude
 
Zylot's Avatar
 
Join Date: Jul 2001
Location: Pa, US(of)A
Posts: 803
My "Age of Science" posted early uses moving textures, as do "My World" and "Blue Jewel" presets, for further examples

-------------
What do you wish for?
--Instrumentality
Zylot is offline   Reply With Quote
Old 10th March 2008, 06:38   #8
Patsy7z7
Junior Member
 
Join Date: Mar 2008
Posts: 1
I think what he means is using a texture much like a sprite.

I do not believe that textures can be manipulated beyond stretching/tiling. What you are looking for is more along the lines of sprites. In which case, sprites are separate from the MilkDrop presets.

As far as i know, you cannot have a preset project a single image across the screen. Unless some very clever code has been developed without me knowing.
Patsy7z7 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop > MilkDrop Presets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump