THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/11/2007 at 07:54, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9600
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I have a volumetric environement shader and I would like to support c4ds hair renderering (raster) because a lot of my customers are now using hair.
My shader is dependant on the current ray hit information and changes vd->col and vd->trans. It has no problems with AA of normal polygonal objects. It´s retained.
However, when I use the Hair fragments data to detect hair in the scene and take its transparency information to blend with my shaders color and transparency, the hair AA is destroyed.
While debugging a pixel the fragment information gives me a transparency of 0.86 for example. However, when I do render the pixel, it looks like the transparency is like full opacity (probably due to AA I assume).
This is how I get the transparency from the fragments:
> _vd- >GetXY(x,y,scale);
> //Assuming x and y should be in screen resolution not render resolution
> HairFragment *hf = hpost->GetFragments(Real(x)/Real(scale),Real(y)/Real(scale),cnt,vd->GetCurrentCPU());
>
> if (bit8)
> {
> for (i=0;i<cnt;i++)
> {
> hairtrans=hairtrans*hf->trans;
> }
> }
> _
What is the correct way to maintain the Hair AA and correctly blend with my volumetric data? Or rather how do I correctly get the "real" transparency of the hair at that pixel from within CalcVolumetric in an environment shader?
Thank you