Panda3D Manual: Using the Particle Panel

That manual page has been empty for too long. There was a topic about this, but as the topic is relatively old, I started a new one. I took the text from the topic and added some more.
panda3d.org/manual/index.php/User:Community

I’d ask you guys to review it and add it to the original manual page.
I wasn’t able to understand what the “segments” and the different “color-blend” modes for SpriteParticleRender were for. I searched the particle panel source code but it wasn’t documented much. Tt would be great if someone could shed some light on these as they are the only ones undocumented right now.

Nice work so far, will you include some screenshots examples?

You mean images of particle effects?

Exactly =)

I guess I could upload few particle effect ptf files I have made for others to learn and post their images.

snow:

I made few general particle effects for the manual page: 2shared.com/file/0YgIxcJL/examples.html
I have a problem, it seems the Panda particle loader doesn’t check if the texture used with the particle is in the same folder as the ptf file, so you will get an error that image wasn’t found, I tried typing the path like this

./file.png

but that didn’t help either. Any ideas?
And what about the documentation?

Maybe the path to the ptf file depends from the path of the main.py, in my project for textures which are in the same folder as the .ptf file and main class I write this

fire.png

I made 2 screenshots for your doc if you want to add about the topic later. This shows fast offscreen particles rendering, the particles are drawn in an offscreen texture buffer (which resolution is less than main window), and are composited back to the main renderer (needs a simple z-testing in the shader to draw them correctly), I can give more info and code examples if you want.

The performance gain is really huge, you don’t get anymore huge overdraws when the camera is really close to the particles, it works fine with low-frequency effects (fog, smoke, fire, aura…).

Here an example with full-res texture buffer (1024x768) and down-sampled texture buffer (32x24 :smiley: )

1024x768:

32x24:

In a real scene with objects in the particles field, you need a more reasonable resolution (/8 for example).

PS: in my screens, there are always vsync glitches, and vsync is activated, I don’t know why I get these.

Yes, but what to do if I want people to just download the particle effects anywhere they want and open them with the particle editor?

Ive heard of that trick. It isn’t a good idea for all the cases, like for rain, when you do need to z order. I think Unity has a helper function for doing that automatically. Maybe you should contact the devs and ask if they would want to add that to the API. As for now, feel free to write about it and I’ll merge it with this page. Note that it wouldn’t be a good idea to mention in the manual if it uses custom shader.

I think the content of the .ptf could be written in the main application class. It seems like a way to store particles effects easily, but the path of the texture is relative to the folder where the program is executed (like any other image or model I’m afraid).

What is this helper function ?
Anyway I’ll post a small code example, won’t be long to do. And maybe someone can help me make soft particles work !

Panda usually looks for assets (models, textures, fonts, sounds etc.) on its model-path. The model-path is an array of paths, where the directory your start script is included by default, along with $PANDADIR/models.

You can get the paths somehow, but I forgot how. Look through the forums for that.

To set them, you can for example create a .prc file (a file which name ends in “.prc”) in your starting directory and put a line like “model-path $MAIN_DIR/assets” or so into it. The prc file will be evaluated automatically. If you don’t want to put a prc file into your main directory, you can also load it through loadPrcFile().
You can also set a single setting, like model-path, in code through loadPrcFileData().

There should be a few examples of that on the forums.

What I mean is I think Unity has a function for doing what you described automatically (render the particle effect to a single billboard).

@Nemesis#13: The particle samples I uploaded above don’t contain a code which runs them, they are meant to be viewed in the particle panel sample program. The archive only contains art assets.
What I’m saying is that for model files for example, the directory of the model file will be searched for textures as well, but it doesn’t seem to be the case for particle effect files.

Bump.
So can I add it like this?

Looks to me like a valuable contribution to the manual. Please feel free to add it to the manual proper. Thanks! :slight_smile:

David

OK, should I also include some sample particle effects?
2shared.com/file/TcsX5Kfo/sa … fects.html

Could you please check if the ptf files try to load the textures from the same directory, or do you need to set the relative path yourself each time?