-
Visit LearnMMD.com on Facebook!.
Keep the Faith-MMD... Learn to be a responsible MMDer! .
.

Download and Configure the OldTV MME Effect for MikuMikuDance


A feature article by KillerBeer ... a New Author on LearnMMD.com!How do I use the OldTV MME Effect? It looks weird, how do I change its settings? How do I configure the OldTV MME Effect for MMD? An MMD MikuMikuDance MME Tutorial!

 

Learn to Configure the OldTV MME Effect!

The OldTV MME Effect represents a Really Olde TV! Learn how to reconfigure the OldTV MME Effect.

Classic OldTV is classic

OldTV is an amusing effect that allows your video to look as if it was shown on a *really* old TV set – old-fashioned oval screen, dense static, badly untuned carrier frequency – all the niceties of the archaic age of technology. In its original state it makes the picture practically illegible and usable only for short glimpses – but there’s more to it.

Using OldTV is really simple!

First, of course, you need to DOWNLOAD MME from the LearnMMD Downloads Page, if you haven‘t done it yet. Then you download the OldTV itself from its home page. Unpack it into UserFile/Accessory/Effects folder of your MMD residence, load OldTV.x in MMD‘s Accessory Manipulation panel – and this is it, easy as pie. Turn it off and on when necessary with “Display“ checkbox, and you‘re good to go.

…But wait!

What if you actually *don‘t* want the image in your video to be distorted beyond recognition? What if ye olde TV is not really *that* olde? Well, there‘s an undocumented trick to control the level of distortion to your needs.

Open the file OldTV.fx in the Notepad or other simple text editor you use.  Scroll down to the lower part of it. In the next-to-last block of text, you will find following lines:

   // … and finally distort
img.x += distortionScale * noisy * dst;
float4 image = tex2D(Image, img);

And now add your own multiplier to it:

img.x += distortionScale * noisy * dst * 0.2;

Learn to configure the OldTV MME effect on learnMMD.com

Save the file and look how the output has changed (you don’t have to reload the effect for that). Now you can actually *see* what happens on the screen! There‘s still distortion, but it doesn’t prevent you from getting the picture. By changing the multiplier to zero, you can disable the distortion completely, leaving only static and oval frame components of the effect.

Let’s see what else we can do with this effect.

Right next to the fragment we just edited, there’s this text:

// Combine frame, distorted image and interference
image.rgb += interference * rand;
image.rgb *= frame;
image.a = 1;

Bigger screen

Hmm, does it look like what I think it does? What if I comment out a suspiciously looking line?

//   image.rgb *= frame;

Check the effect again… What do you think, the frame is gone! Well, all right, maybe you liked it. But point is, now you have choice.

Now for the static component. It is neat… but for purposes I had in mind when looking for a suitable effect, something else would be more appropriate… Let’s look at those two .dds files that the effect uses. GIMP can open them if you provide it with a necessary plugin. One of them looks like some weird cloud, and another… well, it’s static! By close examination, we can see that the file consists of 64 frames, each with a different random pattern. Apparently, these frames rotate between each other, creating the effect of noise.

Original textures

Now, let’s replace it with something simpler. Just one layer of the file will be enough.

And the result is…

(blinking of raster lines isn’t part of the effect, it’s what the AVI renderer did to a picture)

What else can we change?

Our raster lines are nearly perfect… but just to add the cherry on top, can we make them float?  Remember the name of the texture that we changed? It’s Random3D.dds. Let’s see where in the script it is used and how.

texture3D Rand_Tex
<
string ResourceName = Random3D.dds;
>;
sampler Rand = sampler_state
{
Texture = (Rand_Tex);

// Interference … just a texture filled with rand()
float rand = tex3D(Rand, float3(1.5 * pos, time_0_X)).r – 0.2;

That’s the part that forms an image of static noise (and now, with our new texture, raster lines) that is later applied to the final picture. By playing with numbers in this formula, we can figure that the 1.5 multiplier changes thickness of our raster lines, so apparently… what if we change it a bit?

float rand = tex3D(Rand, float3(1.5 * pos + 0.1, time_0_X)).r – 0.2;

Now if you save the script while MMD window with the effect still works and keep close attention to the screen, you’ll notice that our raster lines shifted a bit down. Now, if only we could make that addend change its value automatically, then raster lines would scroll down by themselves. But how? Keep exploring the script further.

The second coordinate in the formula above has a rather suggestive name: “time_0_X”. We no longer use multiple-layered .dds file, but originally the script selected one of many pictures packed in it, based on… time? Where do we get it from? Search the program for the name and find

float time_0_X : TIME;

You can bet your hat that this way the script gets current time using a standard function… in other words, a variable that increases itself automatically. Just what we needed! Now let’s modify the script once more:

   // Interference … just a texture filled with rand()
float fracttime = time_0_X/20 – int(time_0_X/20);
float rand = tex3D(Rand, float3(1.5 * pos + fracttime, time_0_X)).r – 0.2;

The added line gets a fractional part of the time-based value that we can add to coordinates of a pixel we extract from the texture – the texture that is responsible for appearence of raster lines. Now we see them actually scrolling down! By changing the divider 20 to something else, you can regulate the speed of scrolling, if you want to.

 This is it. *That* is the effect I looked for!

Do you think that’s all you can do?

In the next episode… Sliders! Learn to improve OldTV further, making it adjustable straight from MMD!


– SEE BELOW for MORE MMD TUTORIALS…




Visit the LearnMMD.com Homepage! Plenty of Mikumikudance instruction and info!

15 Comments

  1. February 5, 2017    

    I don’t understand this at all….when I put img.x += distortionScale * noisy * dst * 0.2; in I get an error message saying it can’t load the effect or something like that. what am I doing wrong?? D:

    • February 5, 2017    

      Apparently, there’s *something* you do wrong, but it’s hard to tell what exactly without seeing the script itself. Can you copypaste the fragment around the line you edited with the margin of 2-3 lines more? Also, the error message must have contained a “[line,column]” piece specifying the position of an error more precisely, what are those numbers?

  2. chowchow chowchow
    May 14, 2016    

    I’m having a problem, I can’t get the lines even when I add a layer to the file “Random3D”

    • May 14, 2016    

      You mean, you want to get horizontal raster picture like in the article, but can’t draw it strictly horizontally? Try to press Shift key while drawing (or is it Ctrl?). You also can zoom the picture really big to make your hand steadier.

      • chowchow chowchow
        May 14, 2016    

        yes, I don’t understand how they got the horizontal lines in the picture

  3. Macite Macite
    April 30, 2016    

    Where can I download the GIMP plug-in?

    • April 30, 2016    

      The link to plugin’s homepage is right in the article.

  4. Pepper Pepper
    March 7, 2016    

    Could I please have a link for the old tv effect? I looked everywhere and all I could find was a .rar.

    • March 7, 2016    

      A .rar is an archive; the effect you look for is *inside*. You need an archiving program to unpack it – there are many of them, including free ones. I recommend Bandizip, for it allows proper decoding of Japanese file names, and dealing with MMD, you’ll face the need often enough.

  5. Yumeko Yumeko
    April 12, 2015    

    Thank you for your reply!
    It finally worked, I just noticed that I wrote the wrong number (I’m a bit absent-minded sorry…).

  6. Yumeko Yumeko
    April 11, 2015    

    Hello!
    I have a problem, I can’t open the OldTV .fx file in MMD. Is there a way to edit the .x file to obtain the same result as with the .x one ?

    Sorry sor my bad english…

    • Reggie_Dentmore Reggie_Dentmore
      April 11, 2015    

      Can you use other MME effects? … This one should simply “work”. In the Accessory panel, you load the .x file … and use Display to turn the effect on and off. You don’t have to do anything with the .fx file unless you want to edit that file to modify that effect. You open the .fx file in Notepad, or a similar simple text editor. You might change the file extension to .txt, then open and edit the file, and then save the changes, and then change the file name extension back to .fx … but, again, no need to open the .fx file.

  7. KillerBeer KillerBeer
    February 4, 2014    

    2Ghostie: I’d hazard a guess that you placed “*” and the multiplier after the semicolon instead of wedging them between the semicolon and the operator itself. A semicolon signifies an end of a sentence. But of course, without seeing your code in person it’s hard to tell.

    And if you’re interested in OldTV, don’t miss the second article – https://learnmmd.com/http:/learnmmd.com/customize-mme-effects-by-editing-fx-files/ . It gets even better.

  8. Ghostie Ghostie
    February 4, 2014    

    Very helpful! I like how you explained things to make the technical jargon understandable. Just the adjustments I wanted for this effect!

    My only problem is that it doesn’t work when I edit the .fx file in Notepad. I get a strange error message: Failed to load effect file. error X3000: syntax error: unexpected token ‘*’

    It doesn’t like the * before the distortion multiplier. But removing the * just leaves the distortion at the normal level.

    Am I doing something wrong?

  9. Arizona Arizona
    December 13, 2013    

    VERY good first article!

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the latest version of MMD MikuMikuDance! Step-by-step instructions to help you make an MMD Music Video! bo-beep-bo-beep! LearnMMD's Step-by-Step MMD instructions for MikuMikuDance!

MMD Tutorials:


Really Learn MMD as you face the 15-second Animation Challenge!

Visit LearnMMD.com on Facebook!