Assigning random colors to Pflow

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2013   #1
Assigning random colors to Pflow

Hellloooooo!

Is it possible to assign colors per particle without Box #2/3?

I am currently working on a project where the goal is to display light reflections over the course of a year. Where the reflected light intersects the target, I would like to place my particle (I have that script) and color/material it based on the month it happens in.
__________________
www.davetyner.com
 
Old 02 February 2013   #2
U can try multisub material with random in PF...
__________________
website
Showreel 2014
 
Old 02 February 2013   #3
Originally Posted by em3: Hellloooooo!

Is it possible to assign colors per particle without Box #2/3?

I am currently working on a project where the goal is to display light reflections over the course of a year. Where the reflected light intersects the target, I would like to place my particle (I have that script) and color/material it based on the month it happens in.


Yes, you can use a Script Operator and the function
setParticleMapping < index >particleIndex < int >mapChannel < point3 >mapValue
with mapChannel set to 0 to affect the Vertex Color channel.

Then add a Material with Vertex Color Map in the Diffuse slot to the PFlow and you are ready to go!

For example, set up a PFlow with Speed set to Random 3D and values 100.0 and variation 100.0. Then add a Script Operator and put this in it:

on ChannelsUsed pCont do
(
	pCont.useSpeed = true
	pCont.useMapping = true
)

on Init pCont do ()

on Proceed pCont do 
(
	count = pCont.NumParticles()
	for i in 1 to count do
	(
		pCont.particleIndex = i
		theVal = length (pCont.particleSpeed*25.0)
		pCont.setParticleMapping i 0 [1.0-theVal, theVal, 0]
	)
)

on Release pCont do ()


Add a Material Static, drop a Standard material, assign Vertex Color Map to Diffuse channel and render in Scanline - fast particles will be green, slow particles will be red...
__________________
Bobo
 
Old 02 February 2013   #4
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:49 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.