[Closed] pFlow's phantoms, how to use them using maxscript?
Hi. Can somebody helps me to find a way to use pFlow’s phantoms on render time using maxscript? At least some direction to dig in? I want to find a fast way to generate pixels in 3D using coordinates of particles from phantoms or something like that. I can find nothing at Maxscript help.
thx a lot!
AFAIK, there are a couple of scripted dot renderers out there that can do that, but if you want to write your own, you could take a look at the new “How To … Develop a Vertex Renderer” tutorial I added to MAXScript Reference 7.0
It will give you the basic view transformation code to draw 2D pixels from 3D positions. Then you just have to write a simple script to loop through all particles of a PF_Source, read their positions and call the pixel drawing function to put a point in the Bitmap. If you add a reading function, you could accumulate colors using additive, blend or another mode.
Wow thats really nice info, Bobo. And this scripts works really cool. But I have a couple of questions…
- Is it the fastest way to generate pixels in 3D using mesh vertexes or particles coordinates? If not – how can I optimize it? Looping through all of the particles should be slow?
- How can I organize animation output with better UI for this script? Something like render effect maybe?
- Is it possible to generate pixels dependant on particles parameters? For example particle age? 5 pixels when grown – and to 1 or 0 on death? Or generate them using distance from camera?
The fastest would be using the particle coordinates of the phantoms. You don’t want meshes on millions of particles :o) You can just “forget” to assign a Shape Operator to them to avoid internal mesh assignments…
The script I pointed to just shows how to transform 3D into 2D. Replace the vertex code with PFlow particle position access code.
Looping through lots of particles is not too slow. Drawing the pixels will be slower.
You can either write a Render Effect (but in that case you will have the rendering phase of Max itself), or write a utility that renders only the particles of each frame into an empty bitmap. Might be faster. Unless you want to apply the particles to a rendered image without compositing…
Everything is possible – you can access these particle properties as properties of the PF Source itself, without using Script Operators. How you draw, what you draw – is your decision.