<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="jit.gl.shader" module="jit" category="Jitter OpenGL">
	<digest>
		Manage a GL shader
	</digest>
	<description>
		Manages the process of compiling, binding and submitting a shader to OpenGL. A shader consists of both a vertex program and a fragment (aka pixel) program, which can be defined in a <link type="tutorial" module="jit" name="jitterchapter99_appendixc">xml shader description file (JXS)</link>, or submitted individually. Currently the high level language GLSL, as well as ARB, and NV assembly programs are supported.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Jitter
		</metadata>
		<metadata name="tag">
			Jitter OpenGL
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				messages to this 3d object
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				matrix output if enabled
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				dumpout
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--OB3D-->
	<OB3D />
	<!--MESSAGES-->
	<methodlist>
		<method name="(drag)">
			<digest>
				Load a shader file
			</digest>
			<description>
				Dragging a JXS file from the <link type="vignette" module="core" name="file_browser">Max File Browser</link> or desktop to a jit.gl.shader object, will load the file.
			</description>
		</method>
		<method name="bind">
			<arglist />
			<digest>
				Binds and compiles the shader object
			</digest>
			<description>
				Manually binds and compiles the shader object.
			</description>
		</method>
		<method name="compile">
			<arglist />
			<digest>
				Compile the shader object
			</digest>
			<description>
				Manually compiles the shader object.
			</description>
		</method>
		<method name="(mouse)">
			<digest>
				Double click to open the shader editor
			</digest>
			<description>
				Double click to open the <link type="vignette" module="core" name="external_editor">shader editor</link>. If no file is loaded the editor will load a starter shader to use as the basis for a new shader. This file must be saved to disk for use after the editor is closed.
			</description>
		</method>
		<method name="dispose">
			<arglist />
			<digest>
				Dispose and unload the current shader
			</digest>
			<description>
				Dispose of and unload the current shader.
			</description>
		</method>
		<method name="dump">
			<arglist>
				<arg name="type" type="symbol" />
			</arglist>
			<digest>
				Dumps shader data to the Max Console
			</digest>
			<description>
				Dumps the indicated shader data to the max console window. Valid types are params, source, assembly.
			</description>
		</method>
		<method name="flush_cache">
			<arglist />
			<digest>
				Clear the shader cache
			</digest>
			<description>
				Clears the shader cache which stores loaded programs that have been compiled in order to minimize compile time for shaders that have already been compiled and have not been modified on disk.
			</description>
		</method>
		<method name="getparamdefault">
			<arglist>
				<arg name="name" type="symbol" />
			</arglist>
			<digest>
				Report parameter defaults
			</digest>
			<description>
				Sends the default data values for the indicated shader parameter out the right-most outlet.
			</description>
		</method>
		<method name="getparamdescription">
			<arglist />
			<digest>
				Get a parameter description
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="getparamlist">
			<arglist />
			<digest>
				Report shader parameters
			</digest>
			<description>
				Sends the names of all the shader parameters out the right-most outlet.
			</description>
		</method>
		<method name="getparamtype">
			<arglist>
				<arg name="name" type="symbol" />
			</arglist>
			<digest>
				Report shader parameter data types
			</digest>
			<description>
				Sends the name of the datatype for the indicated shader parameter out the right-most outlet.
			</description>
		</method>
		<method name="getparamval">
			<arglist>
				<arg name="name" type="symbol" />
			</arglist>
			<digest>
				Report current shader parameter values
			</digest>
			<description>
				Sends the data values for the indicated shader parameter out the right-most outlet.
			</description>
		</method>
		<method name="glsl">
			<arglist>
				<arg name="vpfile" type="symbol" />
				<arg name="fpfile" type="symbol" />
			</arglist>
			<digest>
				Load glsl vertex and fragment programs from disk
			</digest>
			<description>
				Loads the given glsl vertex and fragment programs from disk.
			</description>
		</method>
		<method name="glslfp">
			<arglist>
				<arg name="fpfile" type="symbol" />
			</arglist>
			<digest>
				Load a glsl fragment program from disk
			</digest>
			<description>
				Loads the given glsl fragment program from disk.
			</description>
		</method>
		<method name="glslvp">
			<arglist>
				<arg name="vpfile" type="symbol" />
			</arglist>
			<digest>
				Load a glsl vertex program from disk
			</digest>
			<description>
				Loads the given glsl vertex program from disk.
			</description>
		</method>
		<method name="link">
			<arglist />
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="open">
			<arglist />
			<digest>
				Opens the shader editor
			</digest>
			<description>
				Opens the <link type="vignette" module="core" name="external_editor">shader editor</link>. If no file is loaded the editor will load a starter shader to use as the basis for a new shader. This file must be saved to disk for use after the editor is closed.
			</description>
		</method>
		<method name="param">
			<arglist />
			<digest>
				Set a shader parameter value
			</digest>
			<description>
				Sets the given shader parameter with the given atom values as defined in a JXS (Jitter shader) file.
			</description>
		</method>
		<method name="program_param">
			<arglist />
			<digest>
				Set a geometry shader program parameter
			</digest>
			<description>
				A geometry shader program parameter.
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="filename" type="symbol" />
			</arglist>
			<digest>
				Loads a JXS shader file from disk
			</digest>
			<description>
				Loads the given JXS shader file from disk.
			</description>
		</method>
		<method name="unbind">
			<arglist />
			<digest>
				Unbind the shader object
			</digest>
			<description>
				Manually unbinds the shader object.
			</description>
		</method>
	</methodlist>
	<jittermethodlist>
		<jittermethod name="bang" />
		<jittermethod name="draw" />
		<jittermethod name="drawimmediate" />
		<jittermethod name="drawraw" />
		<jittermethod name="exportattrs" />
		<jittermethod name="exportsummary" />
		<jittermethod name="getattributes" />
		<jittermethod name="getstate" />
		<jittermethod name="importattrs" />
		<jittermethod name="summary" />
	</jittermethodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="file" get="1" set="1" type="symbol" size="1">
			<digest>
				Shader description file (JXS)
			</digest>
			<description>
				The <link type="tutorial" module="jit" name="jitterchapter99_appendixc">shader description file (JXS)</link> to use (default = none)
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="File" />
			</attributelist>
		</attribute>
		<attribute name="image_mipmaps" get="1" set="1" type="int" size="1">
			<digest>
				Enable Image Mipmaps
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Enable Image Mipmaps" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="verbose" get="1" set="1" type="int" size="1">
			<digest>
				Verbose output mode
			</digest>
			<description>
				Enables or disables verbose output to the max console window (default = 0).
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Verbose" />
			</attributelist>
		</attribute>
	</attributelist>
	<jitterattributelist>
		<jitterattribute name="automatic" />
		<jitterattribute name="drawto" />
		<jitterattribute name="enable" />
		<jitterattribute name="layer" />
		<jitterattribute name="material" />
		<jitterattribute name="name" />
	</jitterattributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="jit.gl.shader.png" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="jit.gl.mesh" />
		<seealso name="jit.gl.pix" />
		<seealso name="jit.gl.slab" />
		<seealso name="jit.gl.texture" />
		<seealso name="jitterchapter41" module="jit" type="tutorial" />
		<seealso name="jitterchapter99_appendixc" module="jit" type="tutorial" />
		<seealso name="external_editor" module="core" type="vignette" />
	</seealsolist>
	<discussion>
		Shaders can be attached to any OB3D thru the OB3D shader method. If the shader is attached to an OB3D, the OB3D will automatically manage the compiling and binding for the <o>jit.gl.shader</o> object. The <o>jit.gl.shader</o> object requires one argument: the name of a drawing context. A named drawing context is a named instance of a <o>jit.window</o>, <o>jit.pwindow</o>, or <o>jit.matrix</o> object that has an instance of the <o>jit.gl.render</o> object associated with it. Additionally it can reference the name of a <o>jit.gl.node</o> sub-context. This value may also be set via the OB3D <at>drawto</at> attribute. If no argument is present, the object is implicitly added to the first valid drawing context or sub-context found in the current patch or by searching up the patcher hierarchy.
	</discussion>
</c74object>
