• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[3D Art] PopcornFX Basics

I should note that this is not a complete guide, but something of a starting point for creating custom PopcornFX particle effects. Purpose of this article is to show that this is possible. I still have many misunderstandings and questions, but I hope that there will be people in our community who can continue and complete this research 🙂

Unfortunately, we do not have any documentation or plugins for baking particles in Warcraft, so we have to check this experimentally.

Apparently, PopcornFX and Warcraft have different coordinate system, which is why particles can move in unexpected direction (for example, when I exported the fire effect, spark particles went to the side, not up). Also, without some optimization, quickly baked effects cause FPS drops (quality of particles must be reduced for use in game engine, as is done with models and textures). In addition I guess that it is necessary to take into account features of Reforged shader in order to obtain expected results.

Here are couple of simple examples, as well longer video of pkb importing process.



Here I replaced the standard Impale effect with a custom Blast effect.


I'll try to explain what's going on here.
  1. We know that Warcraft uses the popcornFX build 2.5.1.63447. That is, we need to bake particles intended for this version. We can download PopcornFX Editor here. It is free for personal, non-commercial use. Unfortunately, this particular build is not available for download, so I tried the two closest to it. We can download any of them and install on PC.
    aa6138d204f9001d.png



  2. Next we need to create a project. Since I have no experience in creating VFX, I used samples available for download in the PK-Editor. They can be imported in one click into your project on the "Online Packages" tab.

    pkeditor1.png


    1. We need to set the baking settings in the project settings. Here is official documentation on how to do this . My example here on pic.
      pkeditor2.png
  3. After setting project, we can use Quick Bake function to bake particle effect into binary format. All necessary files will be built in directory that we specified in baking settings. In my example, this is the Builded folder in the project root.
    pkeditor3.png

  4. Importing files into custom map. Here I will try to describe in more detail.


    1. .PKFX. After baking, we receive particle in binary format that can be read by Reforged. But we have to make a few changes. Since particle was most likely baked in version different from Warcraft PopcornFX version, we will have to open file in hexadecimal format and change a few bytes in the header that are responsible for version. It’s a little bit cringy, but I don’t know about another way, I’ll be glad if someone tells me how to set up build version in PK-Editor. Necessary bytes can be copied from any pkb file from game CASC archive. This is shown in pic below.
      hexeditor.png

      We also need to change the file extension from .pkfx to .pkb. This can be done in Windows Explorer, for example. After these steps, particle can be used in the game. We can replace any default pkb by importing a custom file with the right path, or use it separately. To do this, I highly recommend using TRMS, which has GUI for editing PopcornFX nodes.
      Surely the Blizzard/LemonSky artists didn't do this, and they had a custom baking tool.

    2. Textures. PK-Editor supports different image formats, but I think .dds is the best one to use for Reforged. Diffuse textures must be saved with BC3 compression. I'm not sure about other texture maps. Remember to use the correct path. That is, if the .pkfx file contains a path like "Textures/FX/Diffuse.dds", then we must import it into the map with same path.

    3. .PKAT. This file format can also be read by Warcraft. Something like UV mapping stored in external file. Wiki. This is simple text file that does not require any changes and can be directly imported into Reforged.

    4. .PKMA. These files cause me the most confusion. These are so-called Feature Sets. These are text files, similar to pkfx, and they also contain build version. I'm not sure if they need to be imported into the map. In general, the most of Blizzard particles have links to these files, and it in following format: “Popcorn/Library/PopcornFXCore/Materials/FILENAME.pkma”. In my custom effects baked in popcorn, these links are in the format "Library/PopcornFXCore/Materials/FILENAME.pkma". Yes, we can change this path in Editor project, but is it necessary? I hope that someone will look into this issue in more detail. According to my experiments, presence or absence of these files in map did not affect anything, the “wrong” path also did not prevent effects from working.

    5. Sounds. mp3, flac, wav, etc. I couldn't get the particle sounds to work, maybe PopcornFX sound system is disabled in Warcraft.

    6. Meshes. As you guys know Warcraft only supports mdx and mdl (and mrf with some conventions). Therefore, standard formats like .fbx or .obj must be converted to Warcraft formats. Haven't tested this much. By the way ball lightning reacted quite well to Riffleman mesh (you can see it in the video above).

  5. It seems that PopcornFX particles cannot be used on their own and must be referenced in Warcraft MDX models. As it turns out, PopcornFX particles can be used directly in game as models. For example, you can explicitly specify pathtofile.pkb in the Art - Model File field of Object Editor for units or other object types. You can also create special effect instance by specifying path to pkb. For example, code
    Lua:
    AddSpecialEffect("sharedfx\\hero_glow\\hero_glow.pkb", 0, 0)
    will create team glow in the map center.

    However, Blizzard preferred to link pkb to models using special nodes. As I said before, you can replace default pkb file or use TRMS to create your own links.
    trms.png

Test map is available for download. Good luck have fun!​

 

Attachments

  • pkbtest.w3m
    1.7 MB · Views: 3
Last edited:
Top