COF volumetric shader: refraction

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 09/06/2003 at 22:41, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.100 
Platform:    Mac  ;  
Language(s) :   C.O.F.F.E.E  ;

---------
If I would like to implement refraction in an volumetric shader, do I have to calculate the refracted/reflected ray in the shader myself?

Thanks & Cheers

Kabe

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/06/2003 at 22:24, xxxxxxxx wrote:

Funny - I think this is related to another question I asked before (about tracegeometry) :

var id,p,n;
var ray = new(Ray);

ray->p = vector(0.0);
ray->v = vector(1.0,0.0,0.0); // ray travels from world origin along the X axis
ray->pp0 = ray->pp1 = ray->pp2 = ray->p;
ray->vv0 = ray->vv1 = ray->vv2 = ray->v; // fill mip variables
ray->ior = 1.0; // refraction index for air

id = TraceGeometry(ray,&p;,&n;,0);

So you can define your own IOR for refraction - but TraceGeometry (defined in VolumeData) is wrong documentated - coffee says you need 5 variables and not only 4... happy guessing (at least in R7)...

Well but the rayclass would implement the ior you have asked for. I guess that if you can access the ray that have "shot" you in the point, you can change its IOR and c4d would do the rest... but I am only guessing...

cu

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/06/2003 at 03:20, xxxxxxxx wrote:

Hi,
yes TraceGeometry is wrong documented. The missing paramter is a distance paramter that afai can see defines the maximum ray traveling distance.
The TraceGeometry call should therefore i.e. look like this:

    
    
    vd->TraceGeometry(ray,100000000,min,&p,&n);

Have fun both of you! Hope that helps...

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 15/06/2003 at 09:24, xxxxxxxx wrote:

Well, interesting sidenotes about TraceGeometry (Thanks, Samir!)

However, I was thinking about something different:

To implement refraction, can I jsut set Ray->IOR to the new value and Cinema takes care about calculating the ligh bending?

Or do I have to manipulate the transmitting ray myself?

Thanks for any insight!

Kabe

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 26/10/2011 at 09:13, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Hi,

yes TraceGeometry is wrong documented. The missing paramter is a distance paramter that afai can see defines the maximum ray traveling distance.

The TraceGeometry call should therefore i.e. look like this:

[PRE]vd->TraceGeometry(ray,100000000,min,&p;,&n;);[/PRE]

Have fun both of you! Hope that helps...

It seems like it is still wrong documented even in the R13 C.O.F.F.E.E. SDK documentation!

I hope it'll get fixed one day.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 27/10/2011 at 03:55, xxxxxxxx wrote:

OK, I take note of this missing information in the C.O.F.F.E.E. docs.