Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coloring each particle separately
#1
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.
Reply
#2
(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.
Reply
#3
(07-04-2020, 08:30 AM)josemendez Wrote: 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.

Thank you very much, this helps! Ive got one more question, is there a way to make the colors more vibrant? Just experimenting with a rainbow pride flag, Ive noticed that the fluid colors are pretty muted compared to the original image.


Attached Files Thumbnail(s)
   

.jpg   download (10).jpg (Size: 4.95 KB / Downloads: 17)
Reply