
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FIXME:

Limit:	Texture access can handle at most 10 channels
Limit:	No Ri call will work outside RiBegin - RiEnd (including RiDeclare)
limit:	Object instances will stick to their original attributes
Limit:	Shaders can not have more that 10000 bytes of variable data
Limit:	Texture channel specifier is another parameter to texture: texture(texture,channel,s,t,...);
Limit:	No logic exists to check the sizes of the parameters for shaders while parsing a rib file.
Limit:	What do I do if another light source with the same index is defined in the rib file ?

Bug:	Possible intensity difference

FIXME:	Shaders can access the environment functions faster if they are evaluated only once during the PRE
FIXME:	Register the types of the used variables and during RIB parsing, convert between types as necessary
FIXME:	CImageDialog destructor is not called causing memory leaks.
FIXME:	Parameter spaces for nurbs and polygons are inconsistent with the interface
FIXME:	The space for the points and vectors are wrong with object instances
FIXME:	RiDisplay does not pass the parameters to the display drivers
FIXME:	Smarter derivatives possible by projecting the footprint of pixel on the surface accurately


CObject		------->	CPrimitive	-----> CGeometry   ------> CQuadric
			|										   |
			+------>	CComposite					   +-----> CPatch
			|										   |
			+------>	CDelayed					   +-----> CPolygon
			|
			+------>	CInstance


			CGeometry		---->	CGprim





Network renderer command flow

Client:									Server:

	# Startup:
		send - name of the rib file		recv - name of the rib file
		recv - 1						send - 1
		send - version info				recv - version info
		recv - ACK / NACK				send - ACK / NACK


	# Main loop:
		recv - req						send - req


	# req = file request
		recv - file name				send - file name
		send - file						recv - file

	# req = frame request
		send - order					recv - order
		recv - bucket					send - bucket





	# For each frame:
		send - READY					recv - READY
		recv - req						send - req

	#	req = Send File
		send - READY					recv - READY
		recv - filename					send - filename
		send - ACK / NACK				recv - ACK / NACK
		send - FILE						recv - FILE
		recv - ACK						send - ACK

		recv - READY					send - READY
		send - order					recv - order
		recv - reply					send - reply

		#order=NET_RENDER_BUCKET
		recv - header					send - header
		send - ACK						recv - ACK
		recv - data						send - data

		#order=NET_FINISH_FRAME
		recv - ACK						send - ACK
		




netman
1.	Start server
2.	Send file

Client										Server
rndr -c okan.rib							rndr -s ServerAddress okan.rib


Pixel Footprint code:



	vector	minor,major;
	float	minorl,majorl;
	float	theta	=	(float) fabs(dotvv(N,P) / (float) sqrt(dotvv(N,N)*dotvv(P,P)));
	float	du1,du2,dv1,dv2,a;
	float	a11,a21,a22,b11,b12,b21,b22;

	float	invDx	=	dxdPixel;
	invDx	/=	imagePlane;

	invDy	/=	imagePlane;

	crossvv(minor,N,P);
	normalizev(minor);
	du[i]	=	minorl	=	invDx * P[COMP_Z];			// Length of the minor axis
	mulvf(minor,minorl);

	crossvv(major,minor,N);
	normalizev(major);
	dv[i]	=	majorl	=	invDx * P[COMP_Z] / theta;	// Length of the major axis
	mulvf(major,majorl);

	a11			=	dotvv(dPdu,dPdu);		//
	a21			=	dotvv(dPdu,dPdv);		//
	a22			=	dotvv(dPdv,dPdv);		//	| a11 a21 |	| du1 du2 | = | b11 b12 |
	b11			=	dotvv(dPdu,minor);		//	| a21 a22 |	| dv1 dv2 | = | b21 b22 |
	b21			=	dotvv(dPdv,minor);		//
	b12			=	dotvv(dPdu,major);		//
	b22			=	dotvv(dPdv,major);		//

	if ((a11*a22 - a21*a21) < EPSILON) {
		int badConditioned	=	1;
	}

	if (a22 > a11) {
		a			=	a21 / a22;

		a11			-=	(a21*a);
		b11			-=	b21*a;
		b12			-=	b22*a;

		du1			=	b11 / a11;
		du2			=	b12 / a11;
		dv1			=	(b21 - a21*du1) / a22;
		dv2			=	(b22 - a21*du2) / a22;
	} else {
		a			=	a21 / a11;

		a22			-=	(a21*a);
		b21			-=	b11*a;
		b22			-=	b12*a;

		dv1			=	b21 / a22;
		dv2			=	b22 / a22;
		du1			=	(b11 - a21*dv1) / a11;
		du2			=	(b12 - a21*dv2) / a11;
	}

	du[i]		=	fabs(du2);
	dv[i]		=	fabs(dv2);

	movvv(dPdu,minor);						//	du is the minor axis
	movvv(dPdv,major);						//	dv is the major axis

	u[j]		=	u[i] + du1;
	v[j]		=	v[i] + dv1;
	time[j]		=	time[i];
	movvv(&I[j*3],&I[i*3]);
	j++;

	u[j]		=	u[i] + du2;
	v[j]		=	v[i] + dv2;
	time[j]		=	time[i];
	movvv(&I[j*3],&I[i*3]);
	j++;
