YOUR ACCOUNT

Login or Register to post new topics or replies
kirkl13
Posts: 38
Do someone have an idea how to make kind of "deep composing" from Nuke on Bomber
particles?
I mean not just sort flat particles in a stack like what Bomber can do with its depth input currently but rather use particles own depth grayscale pairs to then have them intersecting with each other properly.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
kirkl13
Posts: 38
That's the easy part. But what about masking colors so particles colored differently would intersect to each other properly. Like what Zcombine node in Blender, or Merge node in Fusion do.

In fact we would need to generate a mask for each particle based on its depth intersection.
I already broke my head trying to figure out how to do so.

Maybe not each particle but each layer of them at least.
  Details E-Mail
Indigo Ray
Adam

Posts: 1442
Filters: 82
Take a look at Sphinx's clay sticks filter, specifically the way the tint is applied in the bomber, and the HSB stuff that comes after. Is that something along the lines of what you are asking about?

(just don't use the obsolete bomber in that filter, because it doesn't have a depth map input!)
  Details E-Mail
kirkl13
Posts: 38
Thanks for interesting example but looks like the color comes from random tint values while I want to scatter particles with existing color values. Fragments rendered in Zbrush paired with their depth companions. Not just randomly tinted.

The bomber does make correct depth based masking for the different tints. It makes an impression it could probably do the same for particle own RGB colors somehow.
  Details E-Mail
Indigo Ray
Adam

Posts: 1442
Filters: 82
OK, my fault for not really explaining. What's important is not the tint per se, but the tiny amount that it is blended in. If you want to use images that already have color, then you need to blend the color information very slightly into the depth information for each image. Later, you'll need to extract the color information.

I've figured out how to "undo" a normal blend in Filter Forge. Applying that to the Bomber, you are doing:

[Bomber(Blend(depth, color, k)) - Bomber(depth) * (1-k)] / k

...where k is a tiny opacity value that you blend the color with

I think. smile;)
  Details E-Mail
kirkl13
Posts: 38
Oh, I think I get the idea. Thank you very much.

Looks like itself Bomber doesn't make any sophisticated particle masking at all. Saturation and hue separations do.

How to do so for every single particle when the color info has varying hue and saturation within a particle picture is still a mystery for me.
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Like so?

  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Here are some tricks with the bomber - check out the internals: there are many different "auxiliary" outputs which you then can use with Lookup, Offset etc to map colors from an image.

(note: the filter does nothing interesting on the front end side of things.. open it up and take a look)

Bomber Tricks.ffxml
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
kirkl13
Posts: 38
Thanks a lot, Sphinx for interesting examples. I does learn a lot from them. But It's not exactly what I am looking for.

I guess you are trying to re-map same image to each and every particle in the first example and re-color particles according to input image XY coordinates in the second one.


I want to scatter a number of rendered pictures of stones having already each own color/alpha plus corresponding depth image . And I want it be scattered the way they would intersect each other. And not to re-color them but rather have them using it's own color info

Perhaps I am still missing something?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
I'm not sure I understand. How can stones intersect? Could you post some example particle images?
  Details E-Mail
kirkl13
Posts: 38
Quote
How can stones intersect?


Same way stars in your example do with only difference each stone is not taking the tint from some third picture but rather uses its own untinted color picture.

https://www.dropbox.com/s/kah5rapiuwkq...s.jpg?dl=0

Here is a stone example png+alpha
https://www.dropbox.com/s/880e21bwv2dv...1.png?dl=0

and its depth also with alpha
https://www.dropbox.com/s/ngv3w7auwbgs...h.png?dl=0

A second stone
https://www.dropbox.com/s/xpyg58ml30mz...2.png?dl=0

its depth
https://www.dropbox.com/s/xbuhvzknvucw...h.tif?dl=0
  Details E-Mail
Indigo Ray
Adam

Posts: 1442
Filters: 82
I replaced the tint with a color map. Thank you, Sphinx (the "floor" method is easier than what I had in mind).

However, I tried your stone images, kirk, but they didn't work. The problem is the alpha in your images is not hard 0/1 (there are in-between values). I don't know what to do about that.

(you need FF5 to open the filter)

Intersected Depth Mapping with Color Map.ffxml
  Details E-Mail
Indigo Ray
Adam

Posts: 1442
Filters: 82
An example

  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Okay, I see. Well you just need to move the fractional x,y lookup gradients to the particle input instead. The blue channel will still be free to give you a per-particle randomization via tint (for tonal variations etc). Here you go.

Intersected Stones.ffxml
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
The output (I'm just playing a bit with the possibilities here)

  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Btw I had to get rid of those minute alpha changes - the limitation of this concept is that the bomber rendering has to be opaque - otherwise you get coordinate "spill" and what not from other particles. Use several bombers to get alpha-blendable layers, if it is important.

How does this "black magic" work?
The idea is simple: since the bomber runs in HDR mode, it is easy to combine integers and fractions using the math components.

To get the lighten combining correct, the main integer signal is carrying the "depth map" of the particle. We simply replicate that value across the channels (but you could really process three particle variation layers at once here).

So the depth info goes in values 1,2..1000000 (or something), pure integers. To get a normal 0..1 range afterwards, we simply divide that by the large 1000000 value. Since it is reduced to integers using Floor, the fractional part i.e. 0..1 is available for another purpose: the x,y particle coordinates (either particle x,y or particle texture x,y as seen in the above examples). The red channel holds the X coordinates and the green channel holds the Y coordinates. The blue channel is available to carry other stuff, like e.g. a random value.

Temporary combined samples could then look like this:

R: 111121.345
G: 111121.045
B: 111121.000

Which means a depth integer value of 111121 (not normalized), a X value of 0.345 and a Y value of 0.045. The X and Y values are extracted by subtracting the integer part.

Thats pretty much it.
  Details E-Mail
kirkl13
Posts: 38
Thanks a lot Sphinx for detailed explanation. Absolutely fantastic idea.

Am I right when think it works for a single particle only and to mix many kind of them I have to do separated bomber trees for each to combine them later ?

Could you please show an example how to do alpha blendable layers from several bombers.

It's actually important since I am going to use it for small twigs and grass blades which would be so so with thresholded alpha.

Indigo Ray, could you explain please why in your example it works without lookup and color remapping . Still looks like "black magick" smile:)
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Well.. It is not like you can't do alpha blending at all; the limitation is only about *semi transparent* particles. Alpha channels with 100% opaque and 100% transparent (alpha = 1 or 0) regions are all good (that is why I had to hard mask those edges with the threshold). And if you have to do semi transparent blending, do it onto the particle before the bombing..

Post your progress and challenges here and I'll help out if possible ☺
  Details E-Mail
kirkl13
Posts: 38
ok, thanks a lot Sphinx
  Details E-Mail
Indigo Ray
Adam

Posts: 1442
Filters: 82
Kirk, thank you for keeping up as we spout all this technical stuff. My understanding increases as I write this, so don't expect too much clarity from me. smile:)

My filter works the same way as Sphinx's, as far as hiding a decimal value for color inside a large integer for depth.

In Sphinx's filter, the bomber acts on a red and green gradient. The lookup component later "transforms" or "maps" red and green into X (left/right) and Y (top/bottom) of the image (of a rock, for instance). In my filter, the actual image is added before the bomber. It's not bombing "space", it's bombing the image, no lookup necessary.

Sphinx's filter also has a third channel (blue), which he chooses to use as a random number generator per particle. My filter doesn't have that feature.

You can use multiple images if you modify either filter, with only 1 bomber component. Well, ok, mine is limited to 5 images because there are 5 particle inputs. Any more, and you'd need more bombers, or if you are feeling adventurous and you own Filter Forge 5, you can use the new Bomber+ component. smile;)
  Details E-Mail
kirkl13
Posts: 38
Thanks Indigo Ray.
I just found I can use original depth input without alpha and use threshold from resulting depth to generate final alpha for all particles in the end of calculations. That way with smooth setting in the threshold node it turns a kind of anti-aliased

https://www.dropbox.com/s/pb1h6ikreq6i...a.jpg?dl=0

It makes a little bit of black fringe although.


Now I have to figure out how to put all this in a single reusable node group, FF5 based
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Quote
kirkl13 wrote:

It makes a little bit of black fringe although.


This is because of a bug related to alpha handling in FFs antialiasing functionality.

The workaround is easy:

Instead of specifying a black transparent "background color" use the same source as the opaque foreground/particles but set the alpha to zero using the Set Alpha component under the Channels category.

Your "Smooth" setting on the Threshold is also causing additional "bleed" of that black color. Try reducing it to zero.
  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,714 Registered Users
+19 new in 30 days!

153,538 Posts
+7 new in 7 days!

15,348 Topics
+72 new in year!

Create an Account

Online Users Last minute:

17 unregistered users.