PDA

View Full Version : Divide Mode in After Effect: how?


cecofuli
06-20-2007, 01:33 PM
Hello all, i'm a problem. I need to Divide to layer with blending mode. Photoshop not have this blending mode, same Combustoin and, for me, After Effect too.

So, what's the solution for my biiig problem? :cry:

See this picture... and "DIV" operator.

http://www.spot3d.com/vray/help/150R1/images/tutorials/anim/scheme.png


It's possible also in Photoshop?

Thank's

cecofuli
06-20-2007, 01:56 PM
Mmm... mmm

cecofuli
06-20-2007, 03:09 PM
i've do some experiment and tthere are some question on division:

Color RED [255,0,0] is equal to [1,0,0] float

Color BLU [0,0,255] is equal t o[0,1,1] float

So, if i divide this 2 color there are some problem:

1/0 = ???
0/0 = ???
0/1 = 0

there no solution.

If you use a VRayCompTex with 2 VRayColor Map operator RED and BLU, the VRayCompTex thit this 2 map give ma a yellow color?!!!

I found the solution for DIFFERENCE in Photoshop to invert second operator, put on top of first operator and use Color Dodge. But if i use 2 layer RED and BLU (in PS you must put BLUand RED order) the Color dodge it seems give me no solution and the color is RED. but if i put 2 image in VRay and PS the final image is the same.

So, for me there are some issue in VRay.

Mylenium
06-20-2007, 04:09 PM
So, for me there are some issue in VRay.

I think you are simply confusing two unrelated matters. Divide in raytracing refers to operations done directly on the rays, not the resulting pixel buffer. Vector math works differently form simple linear math. As you found out yourself, such a modus operandi doesn't make sense on a merely pixel-based basis, even in float.

Mylenium

cecofuli
06-20-2007, 06:57 PM
See my example:

In Vray exist a map that can compose a map in Blend mode: Add, Subtract, Multiplier and Divide

http://www.treddi.com/upload/cecofuli/Upload/03%20-%20Forum/19%20-%20Divide/01%20-%20VRay.jpg




I try to replicate in PS, but only last column is identical: :argh:

http://www.treddi.com/upload/cecofuli/Upload/03%20-%20Forum/19%20-%20Divide/02%20-%20Photoshop.jpg

But, if i use a bitmap, VRay and Photoshop make identical result



http://www.treddi.com/upload/cecofuli/Upload/03%20-%20Forum/19%20-%20Divide/03%20-%20VRay.jpg




http://www.treddi.com/upload/cecofuli/Upload/03%20-%20Forum/19%20-%20Divide/04%20-%20Photoshop.jpg


It seems that in VRay

0 / 0 = 1 or 0 / 0 = 255

0 / 1 = 0 or 0 / 255 = 0

1 / 0 = 1 or 255 / 0 = 255

1 / 1 = 1 or 255/255=255

but not in PS...

I'm a little confused...





You understand me ?

cecofuli
06-20-2007, 07:12 PM
ah, Gimp, that have a Divide mode by default is identical to Photoshop. ;)

cecofuli
06-20-2007, 07:26 PM
After all... i found the solution.... i one word

Approximation


:thumbsup:

cecofuli
06-20-2007, 11:31 PM
Nop, nope Approximation ...:cry: ...


I'm very confused...

cecofuli
06-20-2007, 11:47 PM
IN VRAY --------- IN PHOTOSHOP

0 / 0 = 1 -------- 0 / 0 = 0
0 / 1 = 0 -------- 0 / 1 = 0
1 / 0 = 1 -------- 1 / 0 = 1
1 / 1 = 1 -------- 1 / 1 = 1

This is the 1° difference

FOR EXAMPLE (see image above)

In VRay

RED/RED = WHITE

1,0,0 / 1,0,0 = 1,1,1

In Photoshop

RED/RED = RED

1,0,0 / 1,0,0 = 1,0,0



WHY!!! :(

cecofuli
06-21-2007, 12:01 AM
Another question


try DIVIDE this 2 color in PS, GIMP (that has a DIVIDE mode operator) or VRay (in this case, the result is identicle)

209 , 132 , 49 /
255 , 0 , 0 =
-----------------
209 , 255 , 255


or in float number

0,82 | 0,51 | 0,19 /
1 | 0 | 0 =
---------------------
0,82 | 1 | 1


Why a number divided by 0 give me 1???

Please, you can help my to undertant the DIVISION?

thank's!!!

thev
06-21-2007, 03:59 PM
The specific logic that the VRayCompTex uses for division is this:

For each color component R, G, B:
(*) find the difference of the two colors for that component
(*) if the difference is very small, then assume the result is 1.0 (or 255) for that component
(*) otherwise if the difference is large, but component of the second color is close to zero, then assume the result is 1.0 (or 255) for that component
(*) otherwise compute the component of the resulting color as the component of the first color divided by the component of the second color

You can get similar results if you use the division blending mode of Corel Photopaint.

Best regards,
Vlado

cecofuli
06-21-2007, 06:32 PM
I will try with new "considerations".

thank's :D

cecofuli
06-21-2007, 08:01 PM
Sorry Vlado, see my exaple: RED / GREEN

[ 1 , 0 , 0 ] /
[ 0 , 1 , 0 ] =

In VRay

[ 1 , 0 , 1 ]


In Photoshop

[ 1 , 0 , 0 ]

And in your considerations,

1. you talk about "difference", not "division".
Can you make an numeric example? Or solve and explain my "equation".

2. What 'means for you the word "small" or "large"?

Sorry for that, but it's very intresting, like a rubik cube ;)

thank's :thumbsup:

cecofuli
06-21-2007, 08:08 PM
Or this equation


0,82 ; 0,51 ; 0.19 /

0 ; 1 ; 0 =
---------------------

1 ; 0.51 ; 1


Why? I'm too nooobie, sorry

:sad:

cecofuli
06-21-2007, 08:36 PM
Again, similar to previous, but


0,82 ; 0,51 ; 0.19 /

0.002 ; 1 ; 0.0002 =
---------------------

410 ; 0.51 ; 95


In Photoshop like in VRay

cecofuli
06-22-2007, 12:48 AM
+- i can see the light, only in VRay ;), but,


(*) why Photoshop, or Gimp not use the same specific logic like VRayCompTex.

(*) Or better, why VRay not use the Photoshop's method for divide blending mode?

(*) do you know what method phoshop use?


thank's

doctorx256
06-22-2007, 03:58 PM
i run into this problem several times when trying to go throught this tutorial... i hope
vlado will someday tell us the equalivent modes of the tutorial in after effects.
I believe most of the people have problem understanding this compositing example.

I personally tried many many times and didn't managed to finish the example.

cecofuli
06-22-2007, 07:23 PM
It's simple:

DIVIDE OPERATOR:

C= A/B,

right?

you hav e aDIVIDE operator in gimp, but not in PS

In PS or AE the equivalent is:

C = 1-B/A

where DIVIDE is Color dodge

so

1-B = Invert

and

C = 1-B/A = Color Dodge

you have a DIVIDE operator in PS (or AE).

thev
06-22-2007, 09:27 PM
(*) why Photoshop, or Gimp not use the same specific logic like VRayCompTex.I couldn't possibly tell you that... however, other applications (e.g. Corel Photopaint) do just what is needed.

(*) Or better, why VRay not use the Photoshop's method for divide blending mode?Because the tutorial would not work with it. In order for this to work properly, I needed exactly this kind of behaviour, so this is why I also provided the 3dsmax VRayCompTex in case you don't have Photopaint or similar.

(*) do you know what method phoshop use?Nope... to be honest, I've never really used Photoshop; I've always found it somewhat illogical, but then I'm a programmer, not an artist :-)

Best regards,
Vlado

cecofuli
06-22-2007, 10:32 PM
Thank's Vlado.


Anyway, i try in Photoshop and your comp's tutorial (Photoshop DIVIDE with Inverse Color Dodge method and SUB with Apply Image Option) and works very well. Why do you tell

(*)Because the tutorial would not work with it. In order for this to work properly, I needed exactly this kind of behaviour, so this is why I also provided the 3dsmax VRayCompTex in case you don't have Photopaint or similar.

Again thank's for your time :thumbsup:

You and Peter (and other Chaosgroup's friends) are not a programmer, are a scientists http://digilander.libero.it/le.faccine/faccinea/cartelli/00060031.gif

CGTalk Moderation
06-22-2007, 10:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.