PDA

View Full Version : vertex particle color


loran
03-13-2005, 08:20 PM
Can any scripter help me?
when use Bobo's real time pixel particle render script (http://laurent.renaud.free.fr/divers/bobo-vertex_realtime.ms), (could be find in 3dsmax7 help as vertex render) the color of pixel correspond to the color of PF Diplay Operator. This way you can use Age Test operator to animate color by age.
http://laurent.renaud.free.fr/divers/realtimepixelrender.jpg


But the modified script (http://laurent.renaud.free.fr/divers/sequence_vertex_render_UI.ms) (share by PKonst and wich I add an UI )to render image sequence, render PF source object color (generaly grey). The script code about color seam to be the same for both script.
Anyone to solve this?

Bobo
03-13-2005, 09:35 PM
The script still keeps a FOR o in selection... loop, while not really using it. Why?
The script already uses $ (bad idea!) to capture the currently selected object, BUT it snaps the color of the currently selected object o!

It should be rather something like


...
for o in selection where classof o == PF_Source do
(
dot_color = #(o.wirecolor)
o.updateparticles o t
partpos = o.getparticleposition
particleCount = o.numparticles()
for v = 1 to particleCount do
(
thePos = (partpos v)* viewport.getTM()
screen_origin = mapScreenToView [0,0] (thePos.z) [screen_width,screen_height]
end_screen = mapScreenToView [screen_width,screen_height] (thePos.z) [screen_width,screen_height]
world_size = screen_origin-end_screen
x_aspect = screen_width/(abs world_size.x)
y_aspect = screen_height/(abs world_size.y)
screen_coords = point2 (x_aspect*(thePos.x-screen_origin.x)) (-(y_aspect*(thePos.y-screen_origin.y)))
setPixels front_vfb screen_coords dot_color
)--end v loop
)--end o loop
...

In this case, you can select ANY objects in the scene, only those that are PF_Sources will be rendered.
I don't see the color problem, my particles rendered in the Display operator color using your code...

Also don't forget to provide a file name to the bitmap for saving...

loran
03-14-2005, 09:49 AM
thx Bobo,
But your code correction doesnt works :/ no image are saved when I use this.
and the pixels colors are always from the Pf source object and not from display operator.
here is the link to a test file. maxscene (http://laurent.renaud.free.fr/divers/color_by_age.max)

Bobo
03-14-2005, 04:44 PM
thx Bobo,
But your code correction doesnt works :/ no image are saved when I use this.
and the pixels colors are always from the Pf source object and not from display operator.
here is the link to a test file. maxscene (http://laurent.renaud.free.fr/divers/color_by_age.max)


My code is not responsible for saving images, YOURS is. I edited the beginning where the object is taken and drawn into the front buffer. Whether you save it to disk or not is not my problem - notice the ... in the beginning and end showing you that you have to add your other code and UI around....

I copied YOUR script into a new window (without my changes), created a simple PFlow and rendered a frame - the colors were correct. But if you have multiple events with different display colors for example, I don't know what would happen.

Anyway, I don't need this script myself, please keep on trying.
(we have our own inhouse stand-alone point renderer which can render billions of particles - we used it on a couple of movies already, incl. the smoke in the end scenes of Cursed)

loran
03-14-2005, 04:54 PM
ok ok Bobo...
I hope some else could help me :/

maybe the solution could be to make your script (vertex renderer from 3dsmax 7 help) able to read the scene frame by frame and save each rendered frame.

but I m not scripter at all.

I just want the sequence renderer to be able to render exactly the same your script do.
There is a problem with color. Even with one lone event.

I m curious to see some sample from your inhouse particle renderer!

Bobo
03-14-2005, 06:11 PM
I m curious to see some sample from your inhouse particle renderer!

Right now there is nothing available online. Probably next Siggraph...
(you could watch Cursed, but I would't recommend it ;))
There is another movie coming this spring which had tons of particles (up to 4 billions per frame!), but I cannot talk about it before it hits the screens...

CGTalk Moderation
03-14-2005, 06:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.