PDA

View Full Version : particle Vertex render


loran
03-03-2005, 08:17 AM
there is an script in the 3dsmax script help to create a "real time" vertex render. Could it be modified to permit to render sequences, to define the color of the points by the actual material of the particle system... at least there should be some way to affect the point color, transparency and filter color (to make the points be rendered additively / substractively...
I heard Bobo ever work on this but I can t find anything...
waiting for your great helps
here is the Code:
macroScript VertexRender category:"HowTo"

(

local VertexRendererEnabled = false

local screen_width, screen_height, back_vfb, front_vfb

fn VertexRendererFunction =

(

st = timestamp()

copy back_vfb front_vfb

for o in geometry where classof o != TargetObject do

(

theMesh = snapshotAsMesh o

dot_color = #(o.wirecolor)

theVertCount = theMesh.numverts

for v = 1 to theVertCount do

(

thePos = (getVert theMesh 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

display front_vfb

et = timestamp()

pushPrompt ("VertRender " +(1000.0/(et-st)) as string + " fps")

)--end fn



on isChecked return VertexRendererEnabled



on execute do

(

VertexRendererEnabled = not VertexRendererEnabled



if VertexRendererEnabled then

(

screen_width=RenderWidth

screen_height=RenderHeight

back_vfb = bitmap screen_width screen_height

front_vfb = bitmap screen_width screen_height

registerRedrawViewsCallback VertexRendererFunction

RedrawViews()

)

else

(

unRegisterRedrawViewsCallback VertexRendererFunction

close front_vfb

)

)--end on execute

)--end script


here is a render
http://laurent.renaud.free.fr/vertexrender01.jpg

Bobo
03-03-2005, 04:49 PM
there is an script in the 3dsmax script help to create a "real time" vertex render. Could it be modified to permit to render sequences, to define the color of the points by the actual material of the particle system... at least there should be some way to affect the point color, transparency and filter color (to make the points be rendered additively / substractively...
I heard Bobo ever work on this but I can t find anything...
waiting for your great helps
here is the Code:
...


The example you posted was by me, but it was meant to show you how to render vertices in REAL TIME.
What you want to do is rendering millions of particles as a point cloud.
I know that there are at least 3 scripts (usually renderEffects) out there that do this as a "production rendering" and not as realtime rendering.
While the code you posted could be changed to do the magic, it might be easier to search ScriptSpot and the web for an existing point cloud renderer for PFlow...

loran
03-03-2005, 05:13 PM
thx Bobo
I ever search on script spot but nothing related this
If you could have more infos about those magicals "3 scripts" taht would be great
what I need first is an UI to set render sequences. This would be simple but Im not scripter :/

It s strange that nothing Public , no tutorial exist about this amazing function

Great work Bobo, you re the beest!

CGTalk Moderation
03-03-2005, 05:13 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.