It is possible to extend the list of available rendering features by creating a custom rendering interface file.
IMPORTANT: When creating custom rendering features for a production, make sure that it will be supported by the final game engine.
Note: If features are missing for our UE4, Unity, Lumberyard plugins, you can contact us at firstname.lastname@example.org so we can discuss adding those to our roadmap.
This page will describe how to create a rendering interface, containing a single rendering feature. This rendering feature will be added to the existing example material created. This remains experimental so it is recommended to follow those steps exactly, you can contact us at email@example.com if something doesn’t work as expected.
Before doing anything, it’s currently required to enable “Developer Mode” in your editor settings. This will allow edition of materials.
To make sure everything is organized correctly for your production:
- Never directly modify anything located in the Library/PopcornFXCore folder. Everything contained in that folder is subject to change when updating PopcornFX to a newer version
- Create a custom folder for your project in Library/ (here, we’ll be creating one in Library/ExampleContent/)
We’ll follow the existing directory structured described here, and create an Interface folder:
Creating the rendering interface
No creation dialog is available to create rendering interfaces. It’s best to Clone an existing one (here, Editor.pkri):
After properly naming your interface, you can move it to the desired folder:
You can now open the newly created .pkri file, it will display on the left the list of all rendering features present in Editor.pkri. Delete them all.
For this example, we’ll be creating one rendering feature named “ExampleFeature”. This feature will have one property named “UVMultiplier” being a Link (per particle value), that will act as it name implies as a multiplier for the uvs used to sample the diffuse texture:
You can now save the .pkri file, and open the material where this feature should be added (we’ll be opening the one created here). Once the material editor is opened you can add your custom feature:
A material can be composed of features from Editor.pkri and other interfaces.
This ensures you are only extending the list of features instead of forking Editor.pkri into your own version.
Now that you material has your rendering feature, its fragment shader code modified, applying it to a billboard renderer provides the following result: