Page 1 of 2

Precedence... again (and sorry for that)!

Posted: Thu Nov 18, 2010 1:20 am
by zeitmeister
Hi,

could you please explain again the precedence value?

My example:
- I've got a glass mesh.
- Inside there, I've got a liquid mesh.
- Inside there, I've got some ice cube meshes.
- Inside them, I've got some "air bubbles" meshes.
- Inside the glass mesh bottom, 'Ive got another air bubble mesh.

Which precedence values do I have to specify so that Indigo renders that one correctly?

Thank you very much; I think this could help other n00b users. :mrgreen:

Re: Precedence... again (and sorry for that)!

Posted: Thu Nov 18, 2010 1:59 am
by Zom-B
the highest precedence for intersections wins!

so glass vs water, where the glass gives the border it wins!
icecubes vs water the icecubes are "stronger" and win.
In the icecube the bubbles win
in the glass the bubbles win too
...

so here some copy past numbers:

glass 10
water 9
icecube 10
bubbles 11

Re: Precedence... again (and sorry for that)!

Posted: Thu Nov 18, 2010 3:44 am
by CTZn
Zom-B is correct !

However it is safer to add one degree to ice and bubbles, in order to avoid conflicts if ice comes across the glass a bit (as they are supposed to use different mediums).

Re: Precedence... again (and sorry for that)!

Posted: Fri Nov 19, 2010 9:56 pm
by zeitmeister
Wonderful,

this makes things much clearer for me... thanks a lot!

Re: Precedence... again (and sorry for that)!

Posted: Sat Nov 20, 2010 11:57 pm
by dakiru
I've made a small test and here are the numbers that worked for me:

EDIT:No, I posted the wrong numbers :oops: . These are correct:
Glass: 90
Tea: 60
Ice: 70
Glass bubbles: 100
Tea bubbles: 80
Ice bubbles: 85
precedence_test.jpg

Re: Precedence... again (and sorry for that)!

Posted: Sun Nov 21, 2010 4:44 am
by zeitmeister
Looks great!
Why did you choose such high values?
Do they cause more samples?

Re: Precedence... again (and sorry for that)!

Posted: Sun Nov 21, 2010 4:55 am
by Borgleader
I'll take a glass of that :wink:

Re: Precedence... again (and sorry for that)!

Posted: Sun Nov 21, 2010 5:09 am
by Zom-B
zeitmeister wrote:Looks great!
Why did you choose such high values?
Do they cause more samples?
The value of the precedence is a simple ranking stat!
No difference between 10 vs 100000 and 10 vs 11, the 10 value is smaller... thats the whole point ;)
Choosing such high numbers is more about personal preference...

Re: Precedence... again (and sorry for that)!

Posted: Sun Nov 21, 2010 5:30 am
by zeitmeister
Alrighto,

thanks a lot!

Re: Precedence... again (and sorry for that)!

Posted: Sun Nov 21, 2010 8:03 am
by dakiru
zeitmeister wrote:Looks great!
Why did you choose such high values?
Do they cause more samples?
No, just like Zom-B wrote it's more like a personal preference. Inside me I think it will work better with the wider range between the mediums :lol: But also I know that technically it doesn't work like that :)
Borgleader wrote:I'll take a glass of that :wink:
I tried to make it like hibiscus tea and hibiscus tea is yummy :)

Re: Precedence... again (and sorry for that)!

Posted: Tue Nov 23, 2010 12:55 am
by zeitmeister
Alright...

now coming my two cent concerning bubbles in media.
Bubbles are air in the media, aren't they? Exactly: they lack in the mesh of the media.
So to stay physically correct, I don't have to give them an extra material, right? I have to invert the normals of the bubbles and collapse them with the mesh they do belong: the glass, the liquid, or the ice cubes.
Right?

But:
If I do so with the ice cubes swimming in the liquid, Indigo thinks that the liquid is being computed inside the ice-cube-bubbles, right?

So what should I do now?
Working with precedence, which is some kind of hack in my eyes, or do I have to substract the ice cube meshes from the liquid mesh to stay physically correct?

Questions over questions.

Re: Precedence... again (and sorry for that)!

Posted: Tue Nov 23, 2010 1:23 am
by Zom-B
Some separate spheres (no merging!) with high precedence and a air material should do the job.
(Air material:Uniform=1 Specular with IOR = 1)

Re: Precedence... again (and sorry for that)!

Posted: Tue Nov 23, 2010 1:48 am
by zeitmeister
Hm.

I tried now the following:
- I substracted (booled) slightly larger ice cubes (without the ice cube air bubbles) from the liquid mesh
- I substracted (merged with flipped normals, so they point inside) the ice cube air bubbles from the ice cube mesh

Now everything should be computed physically correctly, shouldn't it?
Because now, inside the bubbles is no other medium any more... which Indigo interpretes as air, right?
And no liquid is being computed there where the ice cubes are.


... but this one produces not so nice black spots inside the ice cubes. :(

Re: Precedence... again (and sorry for that)!

Posted: Tue Nov 23, 2010 3:46 am
by Zom-B
Your method has a logical issue... your bubbles get still filled by fluid!
They are outside the Cube volume (modeled) but still inside the fluid volume!

The explained method should be easier to work with and also to tweak after setting up (moving bubbles, simply by repositioning the sphere primitives...
You need a air material (with higher precedence then the fluid) to get air into the fluid volume.

Re: Precedence... again (and sorry for that)!

Posted: Tue Nov 23, 2010 4:56 am
by zeitmeister
No, the bubbles are not filled with the fluid, because I substracted the whole ice cubes (outer mesh) from the fluid... without the bubbles.
The bubbles only appear in the ice cubes! I have merged these two, and inverted the normals of the bubbles, so it behaves like you would boole the bubbles from the ice cubes.

Anyway:
of course you are right, and this method is not very handy, if logically correct anyway.
But as I said: this method causes ugly black ice cubes, and I really wonder why.
Maybe now the precedence does have to be the same like the glass again? Not stronger than the fluid, because they don't intersect any more?