Module Antialias


module Antialias: sig .. end
Antialiasing helper functions. Used by implementations of Application.renderer. These functions are pulled straight from the OpenGL Red Book.

*** Note: this isn't right. I need to get this working again *** Or does it? Could it be my card doesn't support accum buffer? Is that even possible? What the heck is going on???


	inherit renderer

	val mutable antialiasing = NotAntialiased
	val mutable root_node = new some_node_to_render
	val mutable camera = null_camera
	val mutable ext_viewport = (width=640 ;
	                            height=480 ;
								near=0.1 ;
								far=100.0 }
	
	method render =
		GlClear.clear [`color ; `depth ] ;
		let f () =
			GlMat.load_identity () ;
			camera#transform_gl_matrix ;
			root_node#draw_scene ;
			()
		in begin match antialiasing with
		  NotAntialiased -> antialias f ext_viewport 1
		| Antialiased n -> antialias f ext_viewport n
		end ;
		Sdlgl.swap_buffers () ;
		()



val acc_frustrum : left:float ->
right:float ->
bottom:float ->
top:float ->
near:float ->
far:float ->
jitter_x:float ->
jitter_y:float ->
eye_x:float ->
eye_y:float -> focus:float -> viewport_w:int -> viewport_h:int -> unit
val pi : float
Some number I found useful.
val jitter_list : int -> (float * float) list
val acc_perspective : fovy:float ->
aspect:float ->
near:float ->
far:float ->
jitter_x:float ->
jitter_y:float ->
eye_x:float ->
eye_y:float -> focus:float -> viewport_w:int -> viewport_h:int -> unit

type ext_viewport = {
   width : int; (*Height in pixels.*)
   height : int; (*Near clipping distance in world coordinates.*)
   near : float; (*Far clipping distace in world coordinates.*)
   far : float;
}
Details for the viewport.

Renders a scene with antialiasing.
val accumulate : (float * float -> 'a) -> int -> unit
Evaluates render_fun passes times, using the accumulation buffer to create and antialiased rendering.