07-04-2020, 08:30 AM
(06-04-2020, 11:57 PM)tr5414 Wrote: Hi, new Obi User here. This is a great tool really liking it so far! What I am trying to do at the moment is to color each particle individually based off an image. Its for project I am making where users can make their colors/image. So lets say I have a picture, like that of a rainbow, I would like to color the fluid being emitted to that of the picture, so that like, there were different bands of color within the fluid based off the picture. I guess how would I start doing this then? Also, I dont have much experience making my own sharers but I am learning.
The solver has a "colors" array containing the color of each individual particle. You could set your own colors here. See:
http://obi.virtualmethodstudio.com/tutor...icles.html
However, there's an undocumented emitter shape (ObiEmitterShapeImage) that lets you specify a texture as the emission surface, and sets each particle color according to the texture. Note that your source texture must be readable (have Read/Write enabled) and use a format compatible with GetPixels, for instance RGBA32.