Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
image_shader(3)			 Arcan Lua API		       image_shader(3)

NAME
       image_shader - Set the active shader for	an object.

SYNOPSIS
       oldshid
       image_shader( vid:image,	string:identifier )
       image_shader( vid:image,	integer:identifier )
       image_shader( vid:image,	string:identifier, integer:attributes )
       image_shader( vid:image,	integer:identifier, integer:attributes )

DESCRIPTION
       Processing  programs can	be created using the build_shader  call. These
       programs	can then be assigned to	an image  through  this	 function.  if
       attributes  are provided, the value is expected to be one of these con-
       stants:

       SHADER_DOMAIN_RENDERTARGET    :	find a rendertarget bound to image and
       assign the shader as the	default	program	for objects using this render-
       target. if image	 does not contain a rendertarget,  it  is  a  terminal
       state transition.

       SHADER_DOMAIN_RENDERTARGET_HARD	: same as for SHADER_DOMAIN_RENDERTAR-
       GET  ,  except all shaders on objects attached to the rendertarget will
       be ignored. This	is useful for a	temporary suspension of	 all  shaders,
       as well as for rendertargets created using define_linktarget .

NOTES
       1      if only the vid is provided, the active program won't be changed
	      and  the	function is then used to query the active program of a
	      video object.

       2      if a string argument is supplied as  the	second	argument,  the
	      routine  will  first resolve it by looking for a previously com-
	      piled shader with	a name that matches the	argument.

       3      the shader state of all video objects are	set  to	 '  DEFAULT  '
	      which  is	some platform default safe sate	that follows obj_opac-
	      ity and normal texturing.

EXAMPLE
       function	image_shader0()
	     shid = build_shader(nil, [[
		   void	image_shader0(){
			 gl_FragColor =	vec4(0.5, 1.0, 0.5, 1.0);
		   }
	     ]], "demoshader");
	     a = fill_surface(64, 64, 0, 0, 0);
	     show_image(a);
	     image_shader(a, shid);
       end

SEE ALSO:
       build_shader(3) shader_ugroup(3)	shader_uniform(3)

image				  April	2025		       image_shader(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=image_shader&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help