I have posted this when vray was still in 1.45, but aparently this problem still exists and must be resolved. When vray mtl wrapper is set to recieve GI it does not catch any object emitted gj. Only environment emitted GI. I’ve done small mockup:
Here is a self illuminated teapot on the plane with standart mats. No wrappers. You can see that teapot is casting green gi onto the plane.
My goal is to preserve that emitted gi onto matte object to apply in post.
I set the plane to have vrayMtl wrapper, alpha -1 shadows checked.
No GI appears on the matte. Now, I found that if you lift the environment color from black 0,0,0 to 1,1,1 or higher the gi suddenly is recieved and much brighter then the one cast on the plane in first example.
however nothing is written in the alpha channel so that is not usable aswell.
This is not a bug really, if you think how the matte objects work.
As you should know, the formula for computing the alpha for a matte object is 1.0-(lighting_with_occlusion/lighting_without_occlusion).
If lighting_without_occlusion is black (as when happens when the environment is black), you get a division by zero and the result is undefined which is why you don’t get any alpha.
Further on, in your case, since the teapot generates a lot of light, this pushes the resulting alpha towards black. If you increase the GI environment, you will see the alpha getting stronger, just as the formula implies.
Well, not to sound like a whiny bastard, but do you not see how this behaviour is counter productive for a lot of people. Usually I pre multiply my stuff with 100% black. This is mostly to avoid having to manually check prem. colours in my comps, and to make sure that any other less experienced people handling the comps don’t get it wrong. Would it not be possible for you to make this behaviour happen as default even though the environment bg colour is set to black?
Please correct me if I’m missing some important aspect here.
Would it not be possible for you to make this behaviour happen as default even though the environment bg colour is set to black?How do you propose to calculate the alpha color in that case?
Ideally you would be calculating the minimum usable value ( float, not 8 bit colour) even though one sets the environment colour to black. As if you just truncate the last smallest bit off the scale so it never reaches 100% black, then re-apply this to the users bg colour so the computed alpha channel can be multiplied against it. Are there any instances where doing it the existing way gives you a result you can use for anything? (Against pure black I mean).
(edit) Quite obviously I’m no programmer, so this might make no sense in the land of bits and bytes
Well, mattes are one area where you need to define precisely what you want from a renderer… for many people a matte object is “an object that renders the way I want it to”, but I can’t really use that as a definition to code it There are at least several different ways that a matte object can appear, depending on how you are planning to use it.
Well, then thinking along those lines, I would presume you wish to keep the behaviour “computationally correct” for the matte object properties when using the vray object properties. Then I would think, that one could maybe make a dedicated matte material\map that behaves in the way described in Dmitry’s post (as he expects it to work), that allows for pure black bg colours and still gives the desired gi alpha contribution, so there are no issues in compositing. I might be alone on wanting this, but for me, the logical way of using mattes 99% of the time, is to see gi/shadows visible in the matte rgb and alpha as it would in the final render if one was not using a matte, and at the same time pre multiplying the alpha against pure black. Others might obviously do this differently, but I was under the impression this was the most common way, hence the posts in this part of the forum regarding this issue. I hope this makes more sense than the previous posts I made.
“As you should know, the formula for computing the alpha for a matte object is 1.0-(lighting_with_occlusion/lighting_without_occlusion).”
Vlado, would lighting_with_occlusion include gi emitted by objects or no?
Perhaps the GI emitted by object can be identified as a special value, which can be recognized by matte material as a separete funcion.
For now, I think I am going to render them with no alpha and use screen mode to blend them in.
Perhaps the GI emitted by object can be identified as a special value, which can be recognized by matte material as a separete funcion.It’s not that easy… the teapot may simply be reflecting a very bright beam of direct light falling on it. The matte material has no way of knowing if the GI is a result of self-illumination or not.
In my case it hot lava emiting extra gi to illuminate the surrounding matte objects. So really its an sss mat thats causing this to happen, which is refractive caustics. But matte object cannot catch that eather.
It may be easier to just use the Raw GI channel instead… it will give you the full amount of GI falling on the objects, including the illumination from the lava.
Vlado, I will give it a try… I didnt finish my thought…
So, really it shouldnt matter what the object is sending out as long as its a gi sent out by that object, it can be self illuminated, reflected, or whatever else. If one can identify the object as a special paramiter for sent GI in the scene which is unique from other types of gi, like environment gi and so on, then it can be specified in matte that this type of gi can be recieved by the matte.
Anyway…good to know that you are aware of this
Just tried it, and I think it can work. But as mentioned in another thread about gbuffers, vray automaticly exports rgb and alpha, is there a way not to do that? Since I like manual control over everything.