Thanks again mind-raper!
..and to post another variant for randomly-created particle attributes per a request in the MATRIX BULLET TRAIL thread on how to get emitted particle instances (or even just particles) to emit at random scale values: Quote:
|
Controlling speed for instanced Object
when you have instanced an object to particle specially a moving geometry its sometime very difficult to handle cause sometime movement of particles is higher than your instanced object or the other way your object speed is higher then particles(e.g you have created a crown moving through the scene and when you have instanced it to particle they are moving (sliding). there are other manual ways to fix it but i will show you how to do it with expressions, And For this we use a matching script with it you can query how much fast is....particle/object is moving and then according to it you can plug that value into your instanced object/Particles.
A real good way while you are using instanced Geometry, is to use Custom Attributes and then write the expression on the custom attribute and then plug that custom attribute into your instanced geometry. for a situation where let say you have (crowd) walking animation you instanced it with particles first you instance like you do normally with basic cautions thats you take before instancing any geometry create custom attibute from Particle Attribute goto ADD DYNAMIC ATTRIBUTE and add a attribute with you desired setting customAge float and Per Particle Array you will see a new attribute in per particle array attributes named customAge we'll write a custom expression as follow:- float $Speed = mag(particle2Shape.velocity); particleShape1.customAge = particleShape1.age * $Speed /10 (this number can differ as per your need you have to keep playing untill your object is no longer sliding !) ; mag is for Magnitude ! see documentation for it ! if you are not getting a very good try low down da lifespan of the particle through the scene hope it helps enjoy instancing :bannana: |
Rock on m8! That's a keeper!
|
this one selects a random element from an array
proc int selectRandArrayVal(string $arr[]) { int $randomInt = floor(rand(size($arr)))+1; return $randomInt ; } :) Cool thread btw Alan |
Hehe, I think mind_raper is raping all the gnomon video expressions
|
Hummmm
lolz
yeah.......... Cause not everyOne has the material so i think.....its helpfull ...! but offcourse not all of them.....the are from different authors they are also mentioned ! |
its all cool
|
Either way, an expression is an expression, so keep em coming guys! :)
|
Ok here's one which I just figured out.
Driving a shader attribute with distance from camera Let's dig in to this with an example: 1. Create a lambert shader 2. Create a ramp texture (delete the place2dTexture node if it is created) 3. Connect the ramp's output to the lambert's color channel 4. Create a sampler info node 5. Create an expression with following code: Code:
// NOTE: I'm using default object names here |
WOW! Kinda like the Yuya Depth shader, only better!
Good one Kman! |
I just figured out that controlling things based on the distance from camera is really usefull. For example HW particles (mainly points and streaks) are sized in pixels. So no matter how far they are, they will be (HW) rendered the same size -> not exactly realistic looking. If you add a runtime expression which scales the opacityPP based on the distance from the current camera it will look a lot better.
Example: Code:
vector $vPPos = lpos; // last position of the particle |
And with this expression, who says a lot of rain spoils a shot?
Good one again Kman! |
yeah that helps in densed(populated) particles scene where it need lots of camera adjustment will cut down lots of time !
|
I don't care from where they come here
Hi.
Cool thread ! I'm new here and I'd learned alot from these expressions. I don't care from where they come here, all of them are good for me. Thank mind_raper and everyone. Why the thread had stoped ? Sorry about my poor English. |
Hasn't really stopped, just slowed down a bit because folks are a little busy.
It is a "sticky" thread so that way it is always at the top for reference:) Feel free to post any questions, and we will see if we can help:) |
All times are GMT. The time now is 08:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018